Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

bump version. add README.erb

  • Loading branch information...
commit 38acf096827e2da56c612061d452a884e59a635c 1 parent 243f948
@ahoward authored
Showing with 38 additions and 3 deletions.
  1. +35 −0 README.erb
  2. +1 −1  lib/options.rb
  3. +2 −2 options.gemspec
View
35 README.erb
@@ -0,0 +1,35 @@
+NAME
+ options.rb
+
+DESCRIPTION
+ options.rb simplifies the common idiom of dealing with keyword options in
+ ruby functions. it also deals correctly with symbol vs string keywords and
+ prevents many subtle programming errors that can arise from doing so
+ incorrectly. options.rb doesn't hack ruby's core with one exception: the
+ method Array#options.
+
+SYNOPSIS
+ require 'options'
+
+ def method(*args, &block)
+ args, options = Options.parse(args)
+
+ a = args.shift
+ b = args.shift
+
+ force = options.getopt(:force, default = false)
+ verbose = options.getopt([:verbose, :VERBOSE])
+ foo, bar = options.getopt(:foo, :bar)
+ end
+
+INSTALL
+ gem install options
+
+HISTORY
+ 2.1.0:
+ - 1.9 compatibility
+ - Validation of passed options
+
+SAMPLES
+
+ <%= samples %>
View
2  lib/options.rb
@@ -1,5 +1,5 @@
module Options
- VERSION = '2.1.0'
+ VERSION = '2.1.1'
class << Options
def version
View
4 options.gemspec
@@ -3,11 +3,11 @@
Gem::Specification::new do |spec|
spec.name = "options"
- spec.version = "2.0.0"
+ spec.version = "2.1.1"
spec.platform = Gem::Platform::RUBY
spec.summary = "options"
- spec.files = ["CHANGELOG", "lib", "lib/options.rb", "options.gemspec", "Rakefile", "README", "README.rb", "samples", "samples/a.rb", "samples/b.rb", "samples/c.rb", "samples/d.rb", "spec", "spec/options_spec.rb", "spec/spec_helper.rb"]
+ spec.files = ["lib", "lib/options.rb", "options.gemspec", "Rakefile", "README", "README.erb", "samples", "samples/a.rb", "samples/b.rb", "samples/c.rb", "samples/d.rb", "spec", "spec/options_spec.rb", "spec/spec_helper.rb"]
spec.executables = []
spec.require_path = "lib"
Please sign in to comment.
Something went wrong with that request. Please try again.