live_ast_ruby_parser 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGES.rdoc CHANGED
@@ -1,6 +1,10 @@
1
1
 
2
2
  = live_ast_ruby_parser Changes
3
3
 
4
+ == Version 0.6.3
5
+
6
+ * handlers for "def self.foo" and "def A.foo" were missing
7
+
4
8
  == Version 0.6.2
5
9
 
6
10
  * add required_ruby_version to gemspec
@@ -16,7 +16,7 @@ class LiveASTRubyParser
16
16
 
17
17
  def process(sexp)
18
18
  case sexp.first
19
- when :defn
19
+ when :defn, :defs
20
20
  store_sexp(sexp, sexp.line)
21
21
  when :iter
22
22
  #
@@ -30,6 +30,17 @@ module LiveASTRubyParser::Test
30
30
  s(:defn, name, s(:args), s(:scope, s(:block, s(:str, ret))))
31
31
  end
32
32
 
33
+ #
34
+ # singleton_no_arg_def(:f, "foo") returns the ast of
35
+ #
36
+ # def self.f
37
+ # "foo"
38
+ # end
39
+ #
40
+ def singleton_no_arg_def(name, ret)
41
+ s(:defs, s(:self), name, s(:args), s(:scope, s(:block, s(:str, ret))))
42
+ end
43
+
33
44
  #
34
45
  # no_arg_def_return(no_arg_def(:f, "A#f")) == "A#f"
35
46
  #
@@ -52,6 +63,22 @@ module LiveASTRubyParser::Test
52
63
  s(:block, s(:call, s(:lvar, :x), op, s(:arglist, s(:lvar, :y))))))
53
64
  end
54
65
 
66
+ #
67
+ # singleton_binop_def(:A, :f, :+) returns the ast of
68
+ #
69
+ # def A.f(x, y)
70
+ # x + y
71
+ # end
72
+ #
73
+ def singleton_binop_def(const, name, op)
74
+ s(:defs,
75
+ s(:const, const),
76
+ name,
77
+ s(:args, :x, :y),
78
+ s(:scope,
79
+ s(:block, s(:call, s(:lvar, :x), op, s(:arglist, s(:lvar, :y))))))
80
+ end
81
+
55
82
  #
56
83
  # binop_define_method(:f, :*) returns the ast of
57
84
  #
@@ -1,3 +1,3 @@
1
1
  class LiveASTRubyParser
2
- VERSION = "0.6.2"
2
+ VERSION = "0.6.3"
3
3
  end
metadata CHANGED
@@ -2,7 +2,7 @@
2
2
  name: live_ast_ruby_parser
3
3
  version: !ruby/object:Gem::Version
4
4
  prerelease:
5
- version: 0.6.2
5
+ version: 0.6.3
6
6
  platform: ruby
7
7
  authors:
8
8
  - James M. Lawrence
@@ -10,8 +10,7 @@ autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
12
 
13
- date: 2011-03-15 00:00:00 -04:00
14
- default_executable:
13
+ date: 2011-05-17 00:00:00 Z
15
14
  dependencies:
16
15
  - !ruby/object:Gem::Dependency
17
16
  name: ruby_parser
@@ -55,7 +54,6 @@ files:
55
54
  - lib/live_ast_ruby_parser/unparser.rb
56
55
  - lib/live_ast_ruby_parser/version.rb
57
56
  - MANIFEST
58
- has_rdoc: true
59
57
  homepage: http://quix.github.com/live_ast_ruby_parser
60
58
  licenses: []
61
59
 
@@ -82,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
82
80
  requirements: []
83
81
 
84
82
  rubyforge_project:
85
- rubygems_version: 1.6.2
83
+ rubygems_version: 1.7.1
86
84
  signing_key:
87
85
  specification_version: 3
88
86
  summary: This is the default RubyParser-based parser used by LiveAST.