ast 1.0.1 → 1.0.2

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: d9b626d3142fac2406e66bee130edf576bf3cdac
4
- data.tar.gz: abd5643281c42dbcab8b126fd35ed0713258f790
3
+ metadata.gz: ffb0669773d51b4159753b35caed71e3604b05ed
4
+ data.tar.gz: 44b5ffd4fd2a825983756b00be2bddee94f4a6a7
5
5
  SHA512:
6
- metadata.gz: 508ff146c2009a9c972ff4179d87facfbee08dc0b49e9a2d4caa1b595d42dab95844afa5d1efbaf7b71d487ed447a390528b1f63e05baadd89d3f341cec4c7c2
7
- data.tar.gz: e60093401376180a850d61861b836881acc404156d1e3830e59e6d76e987fd3fa04836e1db589fd41f62a9dbbcfe1a76574bff04edc58cfeca028d71fa4d1b37
6
+ metadata.gz: bd9233a6247b68f71d084f4e9418110f2d75e9498b94447c2a72c8396eea550a6d25c6004e99b63584cd0770245584d5d3633682f2f95872d27999fd123118e5
7
+ data.tar.gz: b065211fc576a555764ba0d1c41eb1acaa47b2e9324579e8c1faacc9e82f352338b73d6f916301bff03ab0872cfde241ec45eb62ab1869098fbb5635c17034e6
@@ -1,6 +1,13 @@
1
1
  language: ruby
2
2
  rvm:
3
+ - 1.8.7
4
+ - 1.9.2
3
5
  - 1.9.3
4
6
  - 2.0
7
+ - jruby-18mode
5
8
  - jruby-19mode
9
+ - rbx-18mode
6
10
  - rbx-19mode
11
+ matrix:
12
+ allow_failures:
13
+ - rvm: rbx-19mode
data/README.md CHANGED
@@ -2,6 +2,7 @@
2
2
 
3
3
  [![Build Status](https://travis-ci.org/whitequark/ast.png?branch=master)](https://travis-ci.org/whitequark/ast)
4
4
  [![Code Climate](https://codeclimate.com/github/whitequark/ast.png)](https://codeclimate.com/github/whitequark/ast)
5
+ [![Coverage Status](https://coveralls.io/repos/whitequark/ast/badge.png?branch=master)](https://coveralls.io/r/whitequark/ast)
5
6
 
6
7
  AST is a small library for working with immutable abstract syntax trees.
7
8
 
data/Rakefile CHANGED
@@ -5,7 +5,7 @@ task :default => :test
5
5
 
6
6
  desc "Run test suite"
7
7
  task :test do
8
- sh "bacon -a"
8
+ sh "bacon -Itest -a"
9
9
  end
10
10
 
11
11
  PAGES_REPO = 'git@github.com:whitequark/ast'
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'ast'
3
- s.version = '1.0.1'
3
+ s.version = '1.0.2'
4
4
  s.authors = ["Peter Zotov"]
5
5
  s.email = ["whitequark@whitequark.org"]
6
6
  s.homepage = "http://github.com/whitequark/ast"
@@ -12,10 +12,13 @@ Gem::Specification.new do |s|
12
12
  s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
13
13
  s.require_paths = ["lib"]
14
14
 
15
- s.add_development_dependency 'rake', '~> 10.0'
16
- s.add_development_dependency 'bacon', '~> 1.2'
15
+ s.add_development_dependency 'rake', '~> 10.0'
16
+
17
+ s.add_development_dependency 'bacon', '~> 1.2'
17
18
  s.add_development_dependency 'bacon-colored_output'
18
19
  s.add_development_dependency 'simplecov'
20
+ s.add_development_dependency 'coveralls'
21
+
19
22
  s.add_development_dependency 'yard'
20
23
  s.add_development_dependency 'kramdown'
21
24
  end
data/lib/ast.rb CHANGED
@@ -11,7 +11,7 @@
11
11
  # recommendations and design patterns.
12
12
  #
13
13
  module AST
14
- require_relative "ast/node"
15
- require_relative "ast/processor"
16
- require_relative "ast/sexp"
14
+ require 'ast/node'
15
+ require 'ast/processor'
16
+ require 'ast/sexp'
17
17
  end
@@ -2,6 +2,13 @@ require 'bacon'
2
2
  require 'bacon/colored_output'
3
3
 
4
4
  require 'simplecov'
5
- SimpleCov.start
5
+ require 'coveralls'
6
+
7
+ SimpleCov.start do
8
+ self.formatter = SimpleCov::Formatter::MultiFormatter[
9
+ SimpleCov::Formatter::HTMLFormatter,
10
+ Coveralls::SimpleCov::Formatter
11
+ ]
12
+ end
6
13
 
7
14
  require 'ast'
@@ -1,4 +1,4 @@
1
- require_relative 'helper'
1
+ require 'helper'
2
2
 
3
3
  describe AST::Node do
4
4
  extend AST::Sexp
@@ -9,7 +9,7 @@ describe AST::Node do
9
9
 
10
10
  before do
11
11
  @node = AST::Node.new(:node, [ 0, 1 ])
12
- @metanode = MetaNode.new(:node, [ 0, 1 ], meta: 'value')
12
+ @metanode = MetaNode.new(:node, [ 0, 1 ], :meta => 'value')
13
13
  end
14
14
 
15
15
  it 'should have accessors for type and children' do
@@ -47,7 +47,7 @@ describe AST::Node do
47
47
  updated.type.should.equal @node.type
48
48
  updated.children.should.equal [1, 1]
49
49
 
50
- updated = @metanode.updated(nil, nil, meta: 'other_value')
50
+ updated = @metanode.updated(nil, nil, :meta => 'other_value')
51
51
  updated.meta.should.equal 'other_value'
52
52
  end
53
53
 
@@ -108,6 +108,18 @@ describe AST::Node do
108
108
  (node << s(:integer, 1) << s(:string, "foo")).
109
109
  should.equal s(:array, s(:integer, 1), s(:string, "foo"))
110
110
  end
111
+
112
+ begin
113
+ eval <<-CODE
114
+ it 'should not trigger a rubinius bug' do
115
+ bar = [ s(:bar, 1) ]
116
+ baz = s(:baz, 2)
117
+ s(:foo, *bar, baz).should.equal s(:foo, s(:bar, 1), s(:baz, 2))
118
+ end
119
+ CODE
120
+ rescue SyntaxError
121
+ # Running on 1.8, ignore.
122
+ end
111
123
  end
112
124
 
113
125
  describe AST::Processor do
@@ -163,11 +175,11 @@ describe AST::Processor do
163
175
  it 'should visit every node' do
164
176
  @processor.process(@ast).should.equal @ast
165
177
  @processor.counts.should.equal({
166
- root: 1,
167
- def: 1,
168
- arglist: 1,
169
- body: 1,
170
- invoke: 2
178
+ :root => 1,
179
+ :def => 1,
180
+ :arglist => 1,
181
+ :body => 1,
182
+ :invoke => 2,
171
183
  })
172
184
  end
173
185
 
@@ -201,15 +213,15 @@ describe AST::Processor do
201
213
  end
202
214
 
203
215
  it 'should refuse to process non-nodes' do
204
- -> { @processor.process(nil) }.should.raise NoMethodError, %r|to_ast|
205
- -> { @processor.process([]) }.should.raise NoMethodError, %r|to_ast|
216
+ lambda { @processor.process(nil) }.should.raise NoMethodError, %r|to_ast|
217
+ lambda { @processor.process([]) }.should.raise NoMethodError, %r|to_ast|
206
218
  end
207
219
 
208
220
  it 'should allow to visit nodes with process_all(node)' do
209
221
  @processor.process_all s(:foo, s(:bar), s(:integer, 1))
210
222
  @processor.counts.should.equal({
211
- bar: 1,
212
- integer: 1,
223
+ :bar => 1,
224
+ :integer => 1,
213
225
  })
214
226
  end
215
227
  end
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.1
4
+ version: 1.0.2
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-01 00:00:00.000000000 Z
11
+ date: 2013-04-07 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -66,6 +66,20 @@ dependencies:
66
66
  - - '>='
67
67
  - !ruby/object:Gem::Version
68
68
  version: '0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: coveralls
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - '>='
74
+ - !ruby/object:Gem::Version
75
+ version: '0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - '>='
81
+ - !ruby/object:Gem::Version
82
+ version: '0'
69
83
  - !ruby/object:Gem::Dependency
70
84
  name: yard
71
85
  requirement: !ruby/object:Gem::Requirement