Up / ChangeLog / dpklib-1.0.6.tar.gz
dpklib is the miscellany library for Ruby including sample executable scripts.
Least requirement is:
dpklib provides following command-line programs.
Evalute EXPRESSION and prints as lines.
$ dpkruby-array -r gtk Gtk::Text.new.methods
Copies entire directory. If DESTDIR does not exists, it is created.
$ dpkruby-dcp dir-a/ dir-b/
Service discovery protocol server daemon. If PROGRAM is specified dpkruby-discoveryd executes PROGRAM and waits until PROGRAM exiting.
$ dpkruby-discoveryd -m my-server -p 5555 my-serverd
Evaluate SCRIPT for each FILE, and replace it with result.
$ dpkruby-filter-replace -r kconv 'Kconv.toeuc(src)' file1 file2
Finds file from search path using dpklib/resource. (Dpklib::ResourceLoader)
$ dpkruby-findres -e PATH command
Parse GNU getopt-like options and prints borune shell script for setting values. dpkruby-dcp is good example of this command.
#!/bin/sh eval `dpkruby-getopts nvX cvs-exclude :: "$@"` $OPT_USAGE && usage if $OPT_n ...
Installs files FILES into DESTDIR.
$ dpkruby-install -x bin/* `dpkruby-rbconfig bindir`
Renames file FILES name by pattern matching and replacing.
$ dpkruby-mvgsub -s .rb .cgi file1.rb file2.rb
Manipulate MD5-encrypted password file like htpasswd(1).
Parse ext-module's C source from stdin, and prints skelton Ruby code.
After loading each RBFILE, runs every test suites like 'require "rubyunit"' does. Requires RubyUnit.
$ dpkruby-runit -qL unittest/test-*.rb
Rewrites source-file part of common stacktrace. It strips PREFIX_OF_PATH from soruce file path, finds file in directories FIND_FROM, and substitute with found file's path.
dpklib/parsearg.rb provides GNU getopt-like option parser.
Dpklib.parse_args(argv, short_option_spec, *long_option_spec, ...)Parses array of argument argv, and returns ParsedArguments object. If failed for invalid usage, returns nil.
short_option_spec and long_option_spec's usage is same as GNU getopt(3). Following extended usage is allowed:
Example:
argv = ["-ab", "b", "--long", "long1", "--long", "long2", "arg1"] opts = Dpklib.parse_args(argv, "ab:c", "long::") p opts[:a] # => true p opts[:b] # => "b" p opts[:c] # => nil p opts[:long] # => ["long1", "long2"] p opts.args # => ["arg1"]
This program is free software distributed under BSD-style license term described in file COPYING.
Copyright 2003-, Shirai,Kaoru <shirai@korinkan.co.jp>