decode 0.3.0 → 0.4.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
  SHA256:
3
- metadata.gz: ff2eab99b63426974eb84926f0133f68958fc4cab1795428aac3d9da0ebd7c62
4
- data.tar.gz: 5f283c90a3854be19d94b4ac527fd129dce16377e3bd011363b6e0fc97f05254
3
+ metadata.gz: 519235a3a7f2db0117c0f725a101a602189d77d2a5be2154d925e7a76a7ade53
4
+ data.tar.gz: 82e6a4a252e12d01b82054011bfcec2c5fb0c2bad3996467e388c9b93370d4cb
5
5
  SHA512:
6
- metadata.gz: '0970346c88f4db7f0d94dd4dfe2ca4a06cb67325c3b8d4e356132d7dcb3bdb66f1b592699bac6cb2505e3837486cbc421a5fa30607e1c120042d76405caa2151'
7
- data.tar.gz: b77f18e09c394c3490827c24cd21bac285bf4ed8a2dc66763e7f3786594d2fb6906d3e5326f8fc87d3b0f81e899b1cef35f416b593539ff0305b1d63837a67c2
6
+ metadata.gz: 60c0fda6909175c3717d762aadccf3f7e8a7dd8582bc390fd1082c5b3d71d5e901224d9072700e7feb4e41052a7f45aa6619522e5a9e65cb7882fee26fef7081
7
+ data.tar.gz: 413727720678c4b956539331bed678d7d8e18ebc8a23a10f6e6f4cec3bfa9cb0a2b849c3a48af23efdafa32340ad179553bb8e82ded52cc15e4f858e11637af1
data/.gitignore CHANGED
@@ -7,5 +7,7 @@
7
7
  /spec/reports/
8
8
  /tmp/
9
9
 
10
+ /gems.locked
11
+
10
12
  # rspec failure tracking
11
13
  .rspec_status
data/lib/decode/index.rb CHANGED
@@ -39,7 +39,7 @@ module Decode
39
39
  def update(paths)
40
40
  paths.each do |path|
41
41
  source = Source.new(path)
42
- @sources[path.relative_path] = Source.new(path)
42
+ @sources[path] = Source.new(path)
43
43
 
44
44
  source.parse do |definition|
45
45
  @symbols[definition.qualified_name] = definition
@@ -130,7 +130,9 @@ module Decode
130
130
  # The last comment must butt up against the node:
131
131
  if comment = prefix.last
132
132
  if comment.location.line == (node.location.line - 1)
133
- return prefix.map(&:text)
133
+ return prefix.map do |comment|
134
+ comment.text.sub(/\A\#\s?/, '')
135
+ end
134
136
  end
135
137
  end
136
138
  end
data/lib/decode/symbol.rb CHANGED
@@ -82,7 +82,7 @@ module Decode
82
82
  attr :comments
83
83
 
84
84
  def documentation
85
- if @comments.any?
85
+ if @comments&.any?
86
86
  @documentation ||= Documentation.new(@comments)
87
87
  end
88
88
  end
data/lib/decode/trie.rb CHANGED
@@ -42,10 +42,10 @@ module Decode
42
42
  end
43
43
 
44
44
  def traverse(path = [], &block)
45
- yield path, values if values
46
-
47
- @children.each do |name, node|
48
- node.traverse([*path, name], &block)
45
+ if yield(path, self)
46
+ @children.each do |name, node|
47
+ node.traverse([*path, name], &block)
48
+ end
49
49
  end
50
50
  end
51
51
  end
@@ -74,7 +74,7 @@ module Decode
74
74
 
75
75
  # Given a base path, enumerate all paths under that.
76
76
  # @yield (path, values) pairs
77
- def each(path, &block)
77
+ def each(path = [], &block)
78
78
  if node = @root.lookup(path)
79
79
  node.traverse(&block)
80
80
  end
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Decode
22
- VERSION = "0.3.0"
22
+ VERSION = "0.4.0"
23
23
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: decode
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.3.0
4
+ version: 0.4.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
@@ -120,7 +120,6 @@ files:
120
120
  - ".rspec"
121
121
  - README.md
122
122
  - decode.gemspec
123
- - gems.locked
124
123
  - gems.rb
125
124
  - lib/decode.rb
126
125
  - lib/decode/documentation.rb
data/gems.locked DELETED
@@ -1,170 +0,0 @@
1
- PATH
2
- remote: .
3
- specs:
4
- decode (0.3.0)
5
- parser
6
-
7
- GEM
8
- remote: https://rubygems.org/
9
- specs:
10
- ast (2.4.0)
11
- async (1.25.2)
12
- console (~> 1.0)
13
- nio4r (~> 2.3)
14
- timers (~> 4.1)
15
- async-container (0.16.4)
16
- async (~> 1.0)
17
- async-io (~> 1.26)
18
- process-group
19
- async-http (0.52.0)
20
- async (~> 1.25)
21
- async-io (~> 1.28)
22
- async-pool (~> 0.2)
23
- protocol-http (~> 0.18.0)
24
- protocol-http1 (~> 0.12.0)
25
- protocol-http2 (~> 0.14.0)
26
- async-http-cache (0.2.0)
27
- async-http (~> 0.51)
28
- async-io (1.29.0)
29
- async (~> 1.14)
30
- async-pool (0.3.0)
31
- async (~> 1.25)
32
- async-rest (0.12.2)
33
- async-http (~> 0.42)
34
- protocol-http (~> 0.7)
35
- bake (0.12.1)
36
- samovar (~> 2.1)
37
- bake-bundler (0.3.1)
38
- bake (~> 0.9)
39
- rspec
40
- build-environment (1.13.0)
41
- build-files (1.5.0)
42
- rb-fsevent
43
- rb-inotify
44
- concurrent-ruby (1.1.6)
45
- console (1.8.2)
46
- covered (0.13.1)
47
- async-rest
48
- console (~> 1.0)
49
- msgpack
50
- parser
51
- diff-lcs (1.3)
52
- falcon (0.36.4)
53
- async (~> 1.13)
54
- async-container (~> 0.16.0)
55
- async-http (~> 0.52.0)
56
- async-http-cache (~> 0.2.0)
57
- async-io (~> 1.22)
58
- build-environment (~> 1.13)
59
- localhost (~> 1.1)
60
- process-metrics (~> 0.2.0)
61
- rack (>= 1.0)
62
- samovar (~> 2.1)
63
- ffi (1.12.2)
64
- http-accept (2.1.1)
65
- kramdown (2.2.1)
66
- rexml
67
- kramdown-parser-gfm (1.1.0)
68
- kramdown (~> 2.0)
69
- localhost (1.1.6)
70
- mail (2.7.1)
71
- mini_mime (>= 0.1.1)
72
- mapping (1.1.1)
73
- mime-types (3.3.1)
74
- mime-types-data (~> 3.2015)
75
- mime-types-data (3.2020.0425)
76
- mini_mime (1.0.2)
77
- msgpack (1.3.3)
78
- nio4r (2.5.2)
79
- parser (2.7.1.2)
80
- ast (~> 2.4.0)
81
- process-group (1.2.1)
82
- process-terminal (~> 0.2.0)
83
- process-metrics (0.2.1)
84
- console (~> 1.8)
85
- samovar (~> 2.1)
86
- process-terminal (0.2.0)
87
- ffi
88
- protocol-hpack (1.4.2)
89
- protocol-http (0.18.0)
90
- protocol-http1 (0.12.0)
91
- protocol-http (~> 0.18)
92
- protocol-http2 (0.14.0)
93
- protocol-hpack (~> 1.4)
94
- protocol-http (~> 0.18)
95
- rack (2.2.2)
96
- rackula (1.1.0)
97
- falcon (~> 0.34)
98
- samovar (~> 2.1)
99
- variant
100
- rake (13.0.1)
101
- rake-compiler (1.1.0)
102
- rake
103
- rb-fsevent (0.10.3)
104
- rb-inotify (0.10.1)
105
- ffi (~> 1.0)
106
- rexml (3.2.4)
107
- rspec (3.9.0)
108
- rspec-core (~> 3.9.0)
109
- rspec-expectations (~> 3.9.0)
110
- rspec-mocks (~> 3.9.0)
111
- rspec-core (3.9.1)
112
- rspec-support (~> 3.9.1)
113
- rspec-expectations (3.9.1)
114
- diff-lcs (>= 1.2.0, < 2.0)
115
- rspec-support (~> 3.9.0)
116
- rspec-mocks (3.9.1)
117
- diff-lcs (>= 1.2.0, < 2.0)
118
- rspec-support (~> 3.9.0)
119
- rspec-support (3.9.2)
120
- samovar (2.1.4)
121
- console (~> 1.0)
122
- mapping (~> 1.0)
123
- thread-local (1.0.0)
124
- timers (4.3.0)
125
- trenni (3.9.0)
126
- rake-compiler
127
- utopia (2.14.0)
128
- concurrent-ruby (~> 1.0)
129
- console (~> 1.0)
130
- http-accept (~> 2.1)
131
- mail (~> 2.6)
132
- mime-types (~> 3.0)
133
- msgpack
134
- rack (~> 2.2)
135
- samovar (~> 2.1)
136
- trenni (~> 3.0)
137
- variant (~> 0.1)
138
- utopia-gallery (2.5.0)
139
- trenni (~> 3.9)
140
- utopia (~> 2.0)
141
- vips-thumbnail (~> 1.6)
142
- utopia-wiki (0.3.0)
143
- bake
144
- falcon
145
- kramdown
146
- kramdown-parser-gfm
147
- rackula
148
- utopia (~> 2.14)
149
- utopia-gallery
150
- variant (0.1.1)
151
- thread-local
152
- vips (8.9.1)
153
- ffi (~> 1.9)
154
- vips-thumbnail (1.6.0)
155
- vips (~> 8.9)
156
-
157
- PLATFORMS
158
- ruby
159
-
160
- DEPENDENCIES
161
- bake-bundler
162
- build-files
163
- bundler
164
- covered
165
- decode!
166
- rspec
167
- utopia-wiki
168
-
169
- BUNDLED WITH
170
- 2.1.4