require_options 1.1.0 → 1.1.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/TODO ADDED
@@ -0,0 +1 @@
1
+ * Make gem
@@ -4,7 +4,7 @@ module RequireOptions
4
4
 
5
5
  values = required_keys.flatten.map do |key|
6
6
  val = options[key]
7
- raise "#{key} required" unless options[key]
7
+ raise "#{key} required" if options[key].nil?
8
8
  val
9
9
  end
10
10
  values.size == 1 ? values.first : values
@@ -12,6 +12,12 @@ describe RequireOptions do
12
12
  speed.should == 200
13
13
  end
14
14
 
15
+ it "respects key that have a false value" do
16
+ opts = {:fast => false}
17
+ fast = require_options(opts, :fast)
18
+ fast.should be_false
19
+ end
20
+
15
21
  it "returns a value rather than a list of values if only one key is given" do
16
22
  opts = {:name => "John"}
17
23
  name = require_options(opts, :name)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: require_options
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Atomic Object
@@ -9,7 +9,7 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-02-03 00:00:00 -05:00
12
+ date: 2010-02-08 00:00:00 -05:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
@@ -22,11 +22,13 @@ extensions: []
22
22
  extra_rdoc_files:
23
23
  - LICENSE
24
24
  - README.rdoc
25
+ - TODO
25
26
  files:
26
27
  - LICENSE
27
28
  - Rakefile
28
29
  - lib/require_options.rb
29
30
  - README.rdoc
31
+ - TODO
30
32
  has_rdoc: true
31
33
  homepage: http://github.com/atomicobject/require_options
32
34
  licenses: []