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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ffb0669773d51b4159753b35caed71e3604b05ed
4
- data.tar.gz: 44b5ffd4fd2a825983756b00be2bddee94f4a6a7
3
+ metadata.gz: 96c7dc9848d3ba4b34349181d246a995c6069ca3
4
+ data.tar.gz: 305049a41e9a331d5eb804d3f0837205dfaabe51
5
5
  SHA512:
6
- metadata.gz: bd9233a6247b68f71d084f4e9418110f2d75e9498b94447c2a72c8396eea550a6d25c6004e99b63584cd0770245584d5d3633682f2f95872d27999fd123118e5
7
- data.tar.gz: b065211fc576a555764ba0d1c41eb1acaa47b2e9324579e8c1faacc9e82f352338b73d6f916301bff03ab0872cfde241ec45eb62ab1869098fbb5635c17034e6
6
+ metadata.gz: 97fb761b1bd3d1371892551884cd42eb4ac520a11a6dd79c5d08813cf4a3448860b81754a0983cfaf5a798b3d616b098fae5582808604989d5cb441c289511bd
7
+ data.tar.gz: 3d6011553e169bdd41619ead8ba2e62ec75544edf3ab68c205d3624a3eb5d4e5caff44f038321aa6e4af050e6eb8b7ccd78f00bda10fe734206d041d8a6a7fca
@@ -0,0 +1,9 @@
1
+ Changelog
2
+ =========
3
+
4
+ v1.1.0 (2013-06-17)
5
+ -------------------
6
+
7
+ API changes:
8
+
9
+ * AST::Processor#process will return nil if passed nil, instead of raising NoMethodError.
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ast'
3
- s.version = '1.0.2'
3
+ s.version = '1.1.0'
4
4
  s.authors = ["Peter Zotov"]
5
5
  s.email = ["whitequark@whitequark.org"]
6
6
  s.homepage = "http://github.com/whitequark/ast"
@@ -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
@@ -9,6 +9,9 @@ SimpleCov.start do
9
9
  SimpleCov::Formatter::HTMLFormatter,
10
10
  Coveralls::SimpleCov::Formatter
11
11
  ]
12
+
13
+ # Exclude the testsuite itself.
14
+ add_filter "/test/"
12
15
  end
13
16
 
14
17
  require 'ast'
@@ -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.2
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-04-07 00:00:00.000000000 Z
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