ns-options 1.1.3 → 1.1.4

Sign up to get free protection for your applications and to get access to all the features.
@@ -38,13 +38,8 @@ module NsOptions
38
38
  # if reading a lazy_proc, call the proc and return its coerced return val
39
39
  # otherwise, just return the stored value
40
40
  def value
41
- if self.lazy_proc?(@value)
42
- self.coerce(@value.call)
43
- elsif @value.respond_to?(:returned_value)
44
- @value.returned_value
45
- else
46
- @value
47
- end
41
+ val = self.lazy_proc?(@value) ? self.coerce(@value.call) : @value
42
+ val.respond_to?(:returned_value) ? val.returned_value : val
48
43
  end
49
44
 
50
45
  def value=(new_value)
@@ -1,3 +1,3 @@
1
1
  module NsOptions
2
- VERSION = "1.1.3"
2
+ VERSION = "1.1.4"
3
3
  end
@@ -520,6 +520,9 @@ class NsOptions::Option
520
520
  should "should honor `returned_value` when returning option values" do
521
521
  @hosted_at.value = "path/to/resource/"
522
522
  assert_equal '/path/to/resource', @hosted_at.value
523
+
524
+ @hosted_at.value = proc{ "path/to/resource/" }
525
+ assert_equal '/path/to/resource', @hosted_at.value
523
526
  end
524
527
 
525
528
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ns-options
3
3
  version: !ruby/object:Gem::Version
4
- hash: 21
4
+ hash: 27
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 3
10
- version: 1.1.3
9
+ - 4
10
+ version: 1.1.4
11
11
  platform: ruby
12
12
  authors:
13
13
  - Collin Redding
@@ -16,12 +16,11 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-03-26 00:00:00 Z
19
+ date: 2013-05-02 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: assert
23
22
  prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
23
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
24
  none: false
26
25
  requirements:
27
26
  - - ~>
@@ -31,8 +30,9 @@ dependencies:
31
30
  - 2
32
31
  - 0
33
32
  version: "2.0"
33
+ requirement: *id001
34
+ name: assert
34
35
  type: :development
35
- version_requirements: *id001
36
36
  description: A DSL for defining, organizing and accessing options.
37
37
  email:
38
38
  - collin.redding@me.com
@@ -116,7 +116,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
116
116
  requirements: []
117
117
 
118
118
  rubyforge_project:
119
- rubygems_version: 1.8.24
119
+ rubygems_version: 1.8.15
120
120
  signing_key:
121
121
  specification_version: 3
122
122
  summary: A DSL for defining, organizing and accessing options.