sexp_processor 4.0.1 → 4.1.0

Sign up to get free protection for your applications and to get access to all the features.
data.tar.gz.sig CHANGED
Binary file
data/History.txt CHANGED
@@ -1,3 +1,9 @@
1
+ === 4.1.0 / 2012-10-22
2
+
3
+ * 1 minor enhancement:
4
+
5
+ * Added Environment#current so you can explicitly shadow variables. (meh)
6
+
1
7
  === 4.0.1 / 2012-07-03
2
8
 
3
9
  * 4 minor enhancements:
@@ -34,7 +34,7 @@ require 'sexp'
34
34
 
35
35
  class SexpProcessor
36
36
 
37
- VERSION = '4.0.1'
37
+ VERSION = '4.1.0'
38
38
 
39
39
  ##
40
40
  # Automatically shifts off the Sexp type before handing the
@@ -370,10 +370,14 @@ class SexpProcessor
370
370
  end
371
371
 
372
372
  def []= name, val
373
- hash = @env.find { |closure| closure.has_key? name } || @env.first
373
+ hash = @env.find { |closure| closure.has_key? name } || current
374
374
  hash[name] = val
375
375
  end
376
376
 
377
+ def current
378
+ @env.first
379
+ end
380
+
377
381
  def scope
378
382
  @env.unshift({})
379
383
  begin
@@ -81,4 +81,16 @@ class TestEnvironment < MiniTest::Unit::TestCase
81
81
 
82
82
  assert_equal Math::PI, @env[:var]
83
83
  end
84
+
85
+ def test_current_shadow
86
+ @env[:var] = 42
87
+ assert_equal 42, @env[:var]
88
+
89
+ @env.scope do
90
+ @env.current[:var] = 23
91
+ assert_equal 23, @env[:var]
92
+ end
93
+
94
+ assert_equal 42, @env[:var]
95
+ end
84
96
  end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sexp_processor
3
3
  version: !ruby/object:Gem::Version
4
- hash: 61
4
+ hash: 59
5
5
  prerelease:
6
6
  segments:
7
7
  - 4
8
- - 0
9
8
  - 1
10
- version: 4.0.1
9
+ - 0
10
+ version: 4.1.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Ryan Davis
@@ -36,7 +36,7 @@ cert_chain:
36
36
  FBHgymkyj/AOSqKRIpXPhjC6
37
37
  -----END CERTIFICATE-----
38
38
 
39
- date: 2012-07-04 00:00:00 Z
39
+ date: 2012-10-22 00:00:00 Z
40
40
  dependencies:
41
41
  - !ruby/object:Gem::Dependency
42
42
  name: minitest
@@ -46,11 +46,11 @@ dependencies:
46
46
  requirements:
47
47
  - - ~>
48
48
  - !ruby/object:Gem::Version
49
- hash: 7
49
+ hash: 25
50
50
  segments:
51
- - 3
52
- - 0
53
- version: "3.0"
51
+ - 4
52
+ - 1
53
+ version: "4.1"
54
54
  type: :development
55
55
  version_requirements: *id001
56
56
  - !ruby/object:Gem::Dependency
@@ -76,11 +76,11 @@ dependencies:
76
76
  requirements:
77
77
  - - ~>
78
78
  - !ruby/object:Gem::Version
79
- hash: 7
79
+ hash: 5
80
80
  segments:
81
81
  - 3
82
- - 0
83
- version: "3.0"
82
+ - 1
83
+ version: "3.1"
84
84
  type: :development
85
85
  version_requirements: *id003
86
86
  description: |-
metadata.gz.sig CHANGED
Binary file