teapot 0.9.1 → 0.9.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +8 -8
- data/lib/teapot/dependency.rb +14 -3
- data/lib/teapot/environment/base.rb +8 -0
- data/lib/teapot/graph.rb +3 -1
- data/lib/teapot/version.rb +1 -1
- data/test/test_environment.rb +2 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
---
|
2
2
|
!binary "U0hBMQ==":
|
3
3
|
metadata.gz: !binary |-
|
4
|
-
|
4
|
+
NTE5MDYzM2ZmZjM5ZWQzM2M3YjhiYzRlZDFjZThmY2Y4NjdjZWE2NQ==
|
5
5
|
data.tar.gz: !binary |-
|
6
|
-
|
6
|
+
NjllN2QwNmU5NmZjNzU1YzMwOWQ2ZGU1MDBhN2MyN2JkMDAyNzM0YQ==
|
7
7
|
!binary "U0hBNTEy":
|
8
8
|
metadata.gz: !binary |-
|
9
|
-
|
10
|
-
|
11
|
-
|
9
|
+
YmU1Y2NkMmQzZGM3YzRmM2NlMTk1ZjUzZjMwNDA4ZmZhNTU2YTNmY2IyMjQ2
|
10
|
+
YTkwMjcwNGEyNDQ5MzJkYjIzOTgzMDg0OTBkYmZjZGMxZDA5YmU3MGI0ODg4
|
11
|
+
YjI3OTQ1NGRmZTY3ZDBhZWIzNmJmMmM1NzFmMzMyODk1ZDY4OTA=
|
12
12
|
data.tar.gz: !binary |-
|
13
|
-
|
14
|
-
|
15
|
-
|
13
|
+
YjI0MDYyM2E4YWY4M2Y5MzQ1NzZmY2NmZGU5MWQ1NmE3MzIzNjQ2OTJjMzFm
|
14
|
+
YjM5OWI2YmYzMzQwZDE2YTEzNTY5ZWExYWI2YmE2MzEyMmNlODFmNDQ0YzJl
|
15
|
+
YjFlNGExY2Y1YmVkYTU5ODhlNjhiZjViYjM0MGVmNzg0NjQ4M2I=
|
data/lib/teapot/dependency.rb
CHANGED
@@ -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
|
data/lib/teapot/version.rb
CHANGED
data/test/test_environment.rb
CHANGED
@@ -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
|