method_parser 0.1.5 → 0.1.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: a14d2b95e816300afcb8ebf4604d0489a31fb02c
4
- data.tar.gz: d73e007a09d8000b648f23da795f2cdb46e66a69
3
+ metadata.gz: c9fbfec1dc45af1d3260144e849a2242273ee147
4
+ data.tar.gz: 0075271c447126bd54dd93edc5c7e7827352b803
5
5
  SHA512:
6
- metadata.gz: 83707fbc4a5f0d4bc57126e488df2c72ab6ef2a0df40a84c405ba8fe4b7782e9cc8e09936139db0c50b9af728966d3fd2e324ed46580559ce2cebec1bbb7d655
7
- data.tar.gz: 4d3a03cd470880e5f267da6c46ab0bd8da0f36c4ccdaba0c5fb6a1627bc23feadddc9f19093ce156f9bb2853df6458133a1699cc6c501bad62096daa4b8805d9
6
+ metadata.gz: f40085bf790a263f905415f1d82a76d231e59cf6a9c5b16a0d6d1107d0023b475c52d2b07410ab5d5a583905d22f0cb20e960b10f8470efde1f38c7c7893c585
7
+ data.tar.gz: b4d9e2d7a288bf123f92b38601a7356b4894e9a93bd86dbd964de27b1ceb3c1aefb1e0d77ca9ce1f19093ede7458c8a296affb6d94d22ec938e40611de4e3e51
Binary file
data.tar.gz.sig CHANGED
Binary file
@@ -11,7 +11,9 @@ class MethodParser
11
11
  attr_reader :to_a
12
12
 
13
13
  def initialize(s)
14
- @to_a = nestify(flatten_down(scan Parser::CurrentRuby.parse(s)))
14
+ a = scan Parser::CurrentRuby.parse(s)
15
+ a2 = flatten_down(a)
16
+ @to_a = nestify(a2)
15
17
  end
16
18
 
17
19
  def to_xml
@@ -23,8 +25,8 @@ class MethodParser
23
25
  container, name, children = x
24
26
  xml.send(container.to_s.sub(/^c/,'k').to_sym, name: name.to_s) do
25
27
  children.each do |y|
26
- _, name, scope = y.map(&:to_s)
27
- xml.send(y.first, name: name, scope: scope)
28
+ _, name, scope, args = y[0..2].map(&:to_s) << y[-1]
29
+ xml.send(y.first, name: name, scope: scope, args: args.join(', '))
28
30
  end
29
31
  end
30
32
  end
@@ -52,7 +54,7 @@ class MethodParser
52
54
  a2 = case x.type
53
55
 
54
56
  when :def
55
- [x.type, x.to_a.first]
57
+ [x.type, x.to_a.first, x.children[1].children.map{|x| x.children[0]}]
56
58
  when :class
57
59
  [x.type, x.to_a.first.to_a[1]]
58
60
 
@@ -98,9 +100,9 @@ class MethodParser
98
100
  case mx.first
99
101
  when :def
100
102
 
101
- method = mx.last
103
+ method = mx[1]
102
104
  r.last.last <<
103
- [:def, method, method == :initialize ? :private : scope]
105
+ [:def, method, method == :initialize ? :private : scope, mx[2]]
104
106
  when :private
105
107
  scope = :private
106
108
  when :protected
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: method_parser
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - James Robertson
@@ -31,7 +31,7 @@ cert_chain:
31
31
  K9vYBtxHayYvCD96peQuwgcRodXugw0ODC9ArfnGO7NPFRPFyIK5SgmNh1YY3yse
32
32
  jfv3+Ayxw5bDxA==
33
33
  -----END CERTIFICATE-----
34
- date: 2014-09-15 00:00:00.000000000 Z
34
+ date: 2014-09-22 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: parser
metadata.gz.sig CHANGED
Binary file