sexp_processor 3.2.0 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
data/lib/sexp.rb CHANGED
@@ -88,6 +88,17 @@ class Sexp < Array # ZenTest FULL
88
88
  self.delete_if { |o| o.nil? }
89
89
  end
90
90
 
91
+ ##
92
+ # Recursively enumerates the sexp yielding to +block+ for every element.
93
+ # TODO: test
94
+
95
+ def deep_each(&block)
96
+ self.each_sexp do |sexp|
97
+ block[sexp]
98
+ sexp.deep_each(&block)
99
+ end
100
+ end
101
+
91
102
  ##
92
103
  # Enumeratates the sexp yielding to +b+ when the node_type == +t+.
93
104
 
@@ -100,6 +111,18 @@ class Sexp < Array # ZenTest FULL
100
111
  end
101
112
  end
102
113
 
114
+ ##
115
+ # Recursively enumerates all sub-sexps skipping non-Sexp elements.
116
+ # TODO: test
117
+
118
+ def each_sexp
119
+ self.each do |sexp|
120
+ next unless Sexp === sexp
121
+
122
+ yield sexp
123
+ end
124
+ end
125
+
103
126
  ##
104
127
  # Replaces all elements whose node_type is +from+ with +to+. Used
105
128
  # only for the most trivial of rewrites.
@@ -279,7 +302,6 @@ class Sexp < Array # ZenTest FULL
279
302
  def to_s # :nodoc:
280
303
  inspect
281
304
  end
282
-
283
305
  end
284
306
 
285
307
  class SexpMatchSpecial < Sexp; end
@@ -34,7 +34,7 @@ require 'sexp'
34
34
 
35
35
  class SexpProcessor
36
36
 
37
- VERSION = '3.2.0'
37
+ VERSION = '4.0.0'
38
38
 
39
39
  ##
40
40
  # Automatically shifts off the Sexp type before handing the
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: 15
4
+ hash: 63
5
5
  prerelease:
6
6
  segments:
7
- - 3
8
- - 2
7
+ - 4
9
8
  - 0
10
- version: 3.2.0
9
+ - 0
10
+ version: 4.0.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-04-15 00:00:00 Z
39
+ date: 2012-06-07 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: 27
49
+ hash: 7
50
50
  segments:
51
- - 2
52
- - 12
53
- version: "2.12"
51
+ - 3
52
+ - 0
53
+ version: "3.0"
54
54
  type: :development
55
55
  version_requirements: *id001
56
56
  - !ruby/object:Gem::Dependency
metadata.gz.sig CHANGED
Binary file