open_dsl 0.3 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -66,12 +66,16 @@ module OpenDsl
66
66
  @stack.bottom << value
67
67
  else
68
68
  define_getter_and_setter_if_needed(name)
69
- @stack.bottom.send("#{name}=", value)
69
+ if @toplevel_object_already_exists && value.nil?
70
+ @stack.bottom.send("#{name}=", true)
71
+ else
72
+ @stack.bottom.send("#{name}=", value)
73
+ end
70
74
  end
71
75
  end
72
76
 
73
77
  def define_getter_and_setter_if_needed(name)
74
- return if name.respond_to?("#{name}=")
78
+ return if @stack.bottom.respond_to?("#{name}=")
75
79
  raise "Expected #{@toplevel_object.class.name} to have defined a setter method for '#{name}'" if @toplevel_object_already_exists
76
80
 
77
81
  @stack.bottom.class.instance_eval do
data/lib/open_dsl.rb CHANGED
@@ -8,7 +8,7 @@ require 'open_dsl/context'
8
8
  require 'open_dsl/eval_stack'
9
9
 
10
10
  module OpenDsl
11
- VERSION = '0.3'
11
+ VERSION = '0.3.1'
12
12
  end
13
13
 
14
14
  def open_dsl(&blk)
metadata CHANGED
@@ -1,12 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: open_dsl
3
3
  version: !ruby/object:Gem::Version
4
- hash: 13
4
+ hash: 17
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- version: "0.3"
9
+ - 1
10
+ version: 0.3.1
10
11
  platform: ruby
11
12
  authors:
12
13
  - Ian Leitch