teapot 0.9.1 → 0.9.2

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,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- OTU3OWI1OTkxZTUxMGJjY2FhMmVmZTMyNDQ5OGUxNDcwMDcyNjk1Nw==
4
+ NTE5MDYzM2ZmZjM5ZWQzM2M3YjhiYzRlZDFjZThmY2Y4NjdjZWE2NQ==
5
5
  data.tar.gz: !binary |-
6
- ZWVmYzY1OGZjZjkxYzhmNTliOGY1ZjFmZDNiMjBlNTU0OTE4YjkxNw==
6
+ NjllN2QwNmU5NmZjNzU1YzMwOWQ2ZGU1MDBhN2MyN2JkMDAyNzM0YQ==
7
7
  !binary "U0hBNTEy":
8
8
  metadata.gz: !binary |-
9
- YjNmMzFkNGM1NmM2ZGY2ZDE4MDVlNzBlMGZjODExMzU5YzdlNWM3MzEwNjVm
10
- MmNlZTc0ZDY3MWU0ZDhhYzc4ZTA2NTFmNjU5NjU3ZTdlZTQ5YjkwM2VlZjU0
11
- YmNkOTM2ZDQ3MWU1NjJjM2I5ZDI0MGYzZDEzMmUyYjE5MWI3MzI=
9
+ YmU1Y2NkMmQzZGM3YzRmM2NlMTk1ZjUzZjMwNDA4ZmZhNTU2YTNmY2IyMjQ2
10
+ YTkwMjcwNGEyNDQ5MzJkYjIzOTgzMDg0OTBkYmZjZGMxZDA5YmU3MGI0ODg4
11
+ YjI3OTQ1NGRmZTY3ZDBhZWIzNmJmMmM1NzFmMzMyODk1ZDY4OTA=
12
12
  data.tar.gz: !binary |-
13
- Y2M1NmI5NTY1Y2ZmYmEyMTlhMjRhYTBkY2Q3OGI4YmRkMzdjYmJmYzUxZjMz
14
- OTVmOTZjY2JhMmQ1ODQ5ODE0NTM3NmVmY2YzNjc3YzZmZDI2MmE3MzUxYmIx
15
- OWVlMzU1ZTk5MWI5ZDFlMDMwZTBjOGQzOWI4NjUzZDEzMDQwMGU=
13
+ YjI0MDYyM2E4YWY4M2Y5MzQ1NzZmY2NmZGU5MWQ1NmE3MzIzNjQ2OTJjMzFm
14
+ YjM5OWI2YmYzMzQwZDE2YTEzNTY5ZWExYWI2YmE2MzEyMmNlODFmNDQ0YzJl
15
+ YjFlNGExY2Y1YmVkYTU5ODhlNjhiZjViYjM0MGVmNzg0NjQ4M2I=
@@ -160,28 +160,39 @@ module Teapot
160
160
  # We will now satisfy this dependency by satisfying any dependent dependencies, but we no longer need to revisit this one.
161
161
  @resolved << dependency
162
162
 
163
+ # If the provision was an Alias, make sure to resolve the alias first:
163
164
  if Alias === provision
164
165
  # puts "** Resolving alias #{provision}".color(:magenta)
165
166
 
166
167
  provision.dependencies.each do |dependency|
167
168
  expand(dependency, provider)
168
169
  end
169
- elsif provision != nil
170
- # puts "** Appending #{dependency} -> provisions".color(:magenta)
171
- @provisions << provision
172
170
  end
173
171
 
174
172
  unless @resolved.include?(provider)
175
173
  # We are now satisfying the provider by expanding all its own dependencies:
176
174
  @resolved << provider
177
175
 
176
+ # Make sure we satisfy the provider's dependencies first:
178
177
  provider.dependencies.each do |dependency|
179
178
  expand(dependency, provider)
180
179
  end
181
180
 
182
181
  # puts "** Appending #{dependency} -> ordered".color(:magenta)
182
+
183
+ # Add the provider to the ordered list.
183
184
  @ordered << [provider, dependency]
184
185
  end
186
+
187
+ # This goes here because we want to ensure 1/ that if
188
+ unless provision == nil or Alias === provision
189
+ # puts "** Appending #{dependency} -> provisions".color(:magenta)
190
+
191
+ # Add the provision to the set of required provisions.
192
+ @provisions << provision
193
+ end
194
+
195
+ # For both @ordered and @provisions, we ensure that for [...xs..., x, ...], x is satisfied by ...xs....
185
196
  end
186
197
  end
187
198
 
@@ -58,5 +58,13 @@ module Teapot
58
58
  def to_s
59
59
  "<#{self.class} #{self.values}>"
60
60
  end
61
+
62
+ def inspect(output = $stdout, indent = "")
63
+ @values.each do |(key, value)|
64
+ output.puts "#{indent}#{key}: #{value}"
65
+ end
66
+
67
+ @parent.inspect(output, indent + "\t") if @parent
68
+ end
61
69
  end
62
70
  end
data/lib/teapot/graph.rb CHANGED
@@ -67,7 +67,7 @@ module Teapot
67
67
  @nodes.fetch(path) do
68
68
  node = @nodes[path] = Node.new(self, path)
69
69
  node.extract_dependencies!
70
-
70
+
71
71
  node
72
72
  end
73
73
  end
@@ -87,6 +87,8 @@ module Teapot
87
87
  attr :dependencies
88
88
 
89
89
  def changed_since?(modified_time)
90
+ return true unless @path.exist?
91
+
90
92
  if @changed == nil
91
93
  # If the file was modified in the future relative to old modified_time:
92
94
  if @path.mtime > modified_time
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Teapot
22
- VERSION = "0.9.1"
22
+ VERSION = "0.9.2"
23
23
  end
@@ -31,8 +31,9 @@ class TestEnvironment < Test::Unit::TestCase
31
31
 
32
32
  b = Teapot::Environment.new(a, {})
33
33
  b[:cflags] = ["-stdlib=libc++"]
34
+ b[:rcflags] = lambda {cflags.reverse}
34
35
 
35
- expected = {:cflags => ["-std=c++11", "-stdlib=libc++"]}
36
+ expected = {:cflags => ["-std=c++11", "-stdlib=libc++"], :rcflags => ["-stdlib=libc++", "-std=c++11"]}
36
37
 
37
38
  assert_equal expected, b.flatten.to_hash
38
39
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teapot
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.1
4
+ version: 0.9.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams