scash 0.3.0 → 0.3.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 1544314116a37cfa4425e4e03d8b5ef88d8ca5a9
4
- data.tar.gz: 10457d9d63dce1ebd2fdd3fe924ee76c5bdcdade
3
+ metadata.gz: 4176c2aeb1fef862467a9776c9f3a4524f9c69db
4
+ data.tar.gz: 40ea5d25325f7a2de15f82d73850bb37a1913dac
5
5
  SHA512:
6
- metadata.gz: 7089aad512341a09766a2874c5f9a800a466b634e326eb4c369bb35bcacfd68c963882c5916aeb394664d2d69d236312c7c410ec9b0be5461dca5b9e86188161
7
- data.tar.gz: 22b5976ab4f5356bc133303b6a26ff45362dc2bcade5f17f7e361a1d637b9b2c6e32e755ecf7af849f1ac161e86242d90c540d3b150ecd4ee0724c5ee0530a8e
6
+ metadata.gz: 1de6938194f4189ee0aa1e060e16b914e9c1d4dcb63477347122ee83afd66ba3a512bb9f6158e6667ba0c3efe3332342244124b064b118093d88818a8c2df506
7
+ data.tar.gz: df6d5ea94b6b15d583695b953b7e21817b6d7a53e12fa9d749f4936c52e067434c451992b52a0b6a7beee7f0a82f104be100b4f45c49fff7b36aa9ab01e6c67c
data/lib/scash.rb CHANGED
@@ -34,9 +34,9 @@ class Scash
34
34
  ensure
35
35
  variables.keys.each{|key| @hash.delete(key)}
36
36
  variables.keys.each{|key| @inverse_hash.delete(key)}
37
- @hash.merge!(@global_variables)
38
37
  @inverse_hash.merge!(previous_inverse_hash)
39
38
  @hash.merge!(previous_hash)
39
+ @hash.merge!(@global_variables)
40
40
  end
41
41
  alias :with :scope
42
42
 
@@ -54,7 +54,7 @@ class Scash
54
54
 
55
55
  def define_global_variables(variables)
56
56
  @hash.merge! variables
57
- @global_variables.merge! convert(variables)
57
+ @global_variables.merge! variables
58
58
  end
59
59
 
60
60
  private
data/lib/scash/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  class Scash
2
- VERSION = "0.3.0"
2
+ VERSION = "0.3.1"
3
3
  end
data/test/test_scash.rb CHANGED
@@ -179,6 +179,15 @@ describe Scash do
179
179
 
180
180
  assert_equal "foo", scash[:result]
181
181
  assert_equal "bar", scash[:b]
182
+
183
+ scash.with({:a => 1}) do
184
+ scash.with({:a => 2}) do
185
+ scash.define_global_variables :a => 3
186
+ assert_equal 3, scash[:a]
187
+ end
188
+ assert_equal 3, scash[:a]
189
+ end
190
+ assert_equal 3, scash[:a]
182
191
  end
183
192
  end
184
193
 
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: scash
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.3.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Stephan Kaag