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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ec5d0ab4bdc83eb5c218bbb21ea890494cdcdca8
4
- data.tar.gz: fd10bb475ae1510831f08c66fa0b2e405a43e3c9
3
+ metadata.gz: 7303f8c51c3dc470c603b2b76a1a7ae8c977436c
4
+ data.tar.gz: df5145cf3bee6c201ccdcd65d6c3665c1d4dc738
5
5
  SHA512:
6
- metadata.gz: 5240a1374a9dfc4abe586c5acb53588b5cc24eb84c7f51c3a932bf311ece1417aaaab3a7b5d2ffb1691176ad00c528db11ce700b0e35ca026985df10db8d0fc3
7
- data.tar.gz: f91f119bf3f5440bf9843d40a314ddf79104a5b776e621399dd96e21381faa1746e10cccb2704f5cc18a4d6c0e3faa89f181aaa722f33ab8c688db27e604a3e3
6
+ metadata.gz: e0f0eab59f299b14b5d8624357fb9dd6f610e6dc4a80abf42c3b79967b1e508ea82569793ea350076158202b30ab8157d6a6ef194d59970281fa7b81a77f3c96
7
+ data.tar.gz: 6e9a1e00d89165197ae2194d9dfc8d49ca92fd655462225f0a6cafba1e836ad6e728e6175a9072798f5f6306e78dfa86c02d143ac7be120609ddc871a7488349
data/README.md CHANGED
@@ -242,7 +242,7 @@ end
242
242
  #### Examples
243
243
 
244
244
  ```ruby
245
- source language: :c do
245
+ source language: :c, headers: ['include'] do
246
246
  import 'src/main.c'
247
247
  option :ffreestanding
248
248
  define :NDEBUG
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Comet
2
- VERSION = '0.1.3'.freeze
2
+ VERSION = '0.1.4'.freeze
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: comet-build
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Thomas Beneteau