ns-options 1.1.5 → 1.1.6

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.
@@ -48,7 +48,10 @@ module NsOptions
48
48
  end
49
49
 
50
50
  def method_missing(meth, *args, &block)
51
- @__data__.ns_method_missing(caller, meth, *args, &block)
51
+ @__data__.ns_method_missing(meth, *args, &block)
52
+ rescue StandardError => exception
53
+ exception.set_backtrace(caller)
54
+ raise exception
52
55
  end
53
56
 
54
57
  def ==(other_ns)
@@ -129,7 +129,7 @@ module NsOptions
129
129
  false
130
130
  end
131
131
 
132
- def ns_method_missing(bt, meth, *args, &block)
132
+ def ns_method_missing(meth, *args, &block)
133
133
  dslm = DslMethod.new(meth, *args, &block)
134
134
 
135
135
  if is_namespace_reader?(dslm)
@@ -138,14 +138,9 @@ module NsOptions
138
138
  get_option(dslm.name)
139
139
  elsif is_option_writer?(dslm)
140
140
  add_option(dslm.name) unless has_option?(dslm.name)
141
- begin
142
- set_option(dslm.name, dslm.data)
143
- rescue NsOptions::Option::CoerceError => err
144
- error! bt, err # reraise this exception with a sane backtrace
145
- end
141
+ set_option(dslm.name, dslm.data)
146
142
  else # namespace writer or unknown
147
- # raise a no meth err with a sane backtrace
148
- error! bt, NoMethodError.new("undefined method `#{meth}' for #{@ns.inspect}")
143
+ raise NoMethodError.new("undefined method `#{meth}' for #{@ns.inspect}")
149
144
  end
150
145
  end
151
146
 
@@ -163,9 +158,5 @@ module NsOptions
163
158
  !has_namespace?(dsl_method.name) && dsl_method.has_args?
164
159
  end
165
160
 
166
- def error!(backtrace, exception)
167
- exception.set_backtrace(backtrace); raise exception
168
- end
169
-
170
161
  end
171
162
  end
@@ -1,3 +1,3 @@
1
1
  module NsOptions
2
- VERSION = "1.1.5"
2
+ VERSION = "1.1.6"
3
3
  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: 25
4
+ hash: 31
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 1
9
- - 5
10
- version: 1.1.5
9
+ - 6
10
+ version: 1.1.6
11
11
  platform: ruby
12
12
  authors:
13
13
  - Collin Redding
@@ -16,12 +16,10 @@ autorequire:
16
16
  bindir: bin
17
17
  cert_chain: []
18
18
 
19
- date: 2013-10-29 00:00:00 Z
19
+ date: 2013-11-06 00:00:00 Z
20
20
  dependencies:
21
21
  - !ruby/object:Gem::Dependency
22
- name: assert
23
- prerelease: false
24
- requirement: &id001 !ruby/object:Gem::Requirement
22
+ version_requirements: &id001 !ruby/object:Gem::Requirement
25
23
  none: false
26
24
  requirements:
27
25
  - - ~>
@@ -32,7 +30,9 @@ dependencies:
32
30
  - 0
33
31
  version: "2.0"
34
32
  type: :development
35
- version_requirements: *id001
33
+ requirement: *id001
34
+ prerelease: false
35
+ name: assert
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.