ast 1.0.2 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +9 -0
- data/ast.gemspec +1 -1
- data/lib/ast/processor.rb +3 -1
- data/test/helper.rb +3 -0
- data/test/test_ast.rb +4 -1
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 96c7dc9848d3ba4b34349181d246a995c6069ca3
|
4
|
+
data.tar.gz: 305049a41e9a331d5eb804d3f0837205dfaabe51
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 97fb761b1bd3d1371892551884cd42eb4ac520a11a6dd79c5d08813cf4a3448860b81754a0983cfaf5a798b3d616b098fae5582808604989d5cb441c289511bd
|
7
|
+
data.tar.gz: 3d6011553e169bdd41619ead8ba2e62ec75544edf3ab68c205d3624a3eb5d4e5caff44f038321aa6e4af050e6eb8b7ccd78f00bda10fe734206d041d8a6a7fca
|
data/CHANGELOG.md
ADDED
data/ast.gemspec
CHANGED
data/lib/ast/processor.rb
CHANGED
@@ -227,8 +227,10 @@ module AST
|
|
227
227
|
# value of the handler is passed along.
|
228
228
|
#
|
229
229
|
# @param [AST::Node, nil] node
|
230
|
-
# @return [AST::Node]
|
230
|
+
# @return [AST::Node, nil]
|
231
231
|
def process(node)
|
232
|
+
return if node.nil?
|
233
|
+
|
232
234
|
node = node.to_ast
|
233
235
|
|
234
236
|
# Invoke a specific handler
|
data/test/helper.rb
CHANGED
data/test/test_ast.rb
CHANGED
@@ -212,8 +212,11 @@ describe AST::Processor do
|
|
212
212
|
SEXP
|
213
213
|
end
|
214
214
|
|
215
|
+
it 'should return nil if passed nil' do
|
216
|
+
@processor.process(nil).should == nil
|
217
|
+
end
|
218
|
+
|
215
219
|
it 'should refuse to process non-nodes' do
|
216
|
-
lambda { @processor.process(nil) }.should.raise NoMethodError, %r|to_ast|
|
217
220
|
lambda { @processor.process([]) }.should.raise NoMethodError, %r|to_ast|
|
218
221
|
end
|
219
222
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: ast
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Peter Zotov
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-
|
11
|
+
date: 2013-06-17 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|
@@ -118,6 +118,7 @@ files:
|
|
118
118
|
- .gitignore
|
119
119
|
- .travis.yml
|
120
120
|
- .yardopts
|
121
|
+
- CHANGELOG.md
|
121
122
|
- Gemfile
|
122
123
|
- LICENSE.MIT
|
123
124
|
- README.YARD.md
|