comet-build 0.1.3 → 0.1.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/lib/comet/dsl/include_walker.rb +7 -5
- data/lib/comet/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7303f8c51c3dc470c603b2b76a1a7ae8c977436c
|
4
|
+
data.tar.gz: df5145cf3bee6c201ccdcd65d6c3665c1d4dc738
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e0f0eab59f299b14b5d8624357fb9dd6f610e6dc4a80abf42c3b79967b1e508ea82569793ea350076158202b30ab8157d6a6ef194d59970281fa7b81a77f3c96
|
7
|
+
data.tar.gz: 6e9a1e00d89165197ae2194d9dfc8d49ca92fd655462225f0a6cafba1e836ad6e728e6175a9072798f5f6306e78dfa86c02d143ac7be120609ddc871a7488349
|
data/README.md
CHANGED
@@ -6,7 +6,9 @@ module Comet
|
|
6
6
|
@@cache[[file, include_paths]]
|
7
7
|
end
|
8
8
|
|
9
|
-
def search(file, include_paths)
|
9
|
+
def search(file, include_paths, visited)
|
10
|
+
return visited[file] if visited.key? file
|
11
|
+
|
10
12
|
includes = []
|
11
13
|
|
12
14
|
File.read(file).scan(PATTERN) do
|
@@ -14,17 +16,17 @@ module Comet
|
|
14
16
|
includes << find_included_file(header, include_paths)
|
15
17
|
end
|
16
18
|
|
19
|
+
visited[file] = []
|
17
20
|
includes.compact.uniq.dup.each do |included|
|
18
|
-
includes.concat search(included, include_paths)
|
21
|
+
includes.concat search(included, include_paths, visited)
|
19
22
|
end
|
20
|
-
|
21
|
-
includes.compact.uniq
|
23
|
+
visited[file] = includes.compact.uniq
|
22
24
|
end
|
23
25
|
|
24
26
|
private
|
25
27
|
|
26
28
|
@@cache = Hash.new do |h, k|
|
27
|
-
h[k] = IncludeWalker.search(*k)
|
29
|
+
h[k] = IncludeWalker.search(*k, {})
|
28
30
|
end
|
29
31
|
|
30
32
|
PATTERN = /^\s*#\s*include\s*(?:(?:<([^>]+)>)|(?:"([^"]+)"))\s*$/m
|
data/lib/comet/version.rb
CHANGED