build-graph 1.0.6 → 1.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/.rspec +1 -1
- data/Rakefile +1 -3
- data/build-graph.gemspec +2 -1
- data/lib/build/graph/call_stack.rb +1 -1
- data/lib/build/graph/node.rb +1 -1
- data/lib/build/graph/task.rb +2 -2
- data/lib/build/graph/version.rb +1 -1
- data/lib/build/graph/walker.rb +8 -2
- data/spec/build/graph/call_stack_spec.rb +12 -14
- data/spec/build/graph/graph_spec.rb +1 -1
- data/spec/build/graph/inherit_spec.rb +1 -1
- data/spec/build/graph/node_spec.rb +1 -1
- data/spec/build/graph/task_spec.rb +1 -1
- data/spec/build/graph/walker_spec.rb +1 -1
- data/spec/spec_helper.rb +13 -0
- metadata +23 -9
- data/.simplecov +0 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 1b75e42193ea41f6a0d0e03133368edc9b07d264c68fb969b5c92efd2e28db32
|
4
|
+
data.tar.gz: 6b26953d62482339e1762915618b0d4a3946d282004a6adaa896abb9db70e65b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b61a58f2aa3daff22b1727bd0b0eb86b0d8ede3ee126d0fde39071b165f21edd6de52a7c75a4c9032c9ad460eb249a8f464950a93b7257ad49dd25e94e2e6ceb
|
7
|
+
data.tar.gz: '095cd63881f370fe454e36f5dc3cb09ae8356a094d80fd60a33dcc9214add66be63338f865d4c0a1e2821dee8a58fea89c790a8b84aa20256d2a34d42b656aab'
|
data/.rspec
CHANGED
data/Rakefile
CHANGED
data/build-graph.gemspec
CHANGED
@@ -29,7 +29,8 @@ Gem::Specification.new do |spec|
|
|
29
29
|
|
30
30
|
spec.add_dependency "rainbow", "~> 2.0"
|
31
31
|
|
32
|
-
spec.add_development_dependency "
|
32
|
+
spec.add_development_dependency "covered"
|
33
|
+
spec.add_development_dependency "bundler"
|
33
34
|
spec.add_development_dependency "rspec", "~> 3.4"
|
34
35
|
spec.add_development_dependency "rake"
|
35
36
|
end
|
data/lib/build/graph/node.rb
CHANGED
@@ -51,7 +51,7 @@ module Build
|
|
51
51
|
end
|
52
52
|
|
53
53
|
def missing?
|
54
|
-
@
|
54
|
+
@outputs.any?{|path| !path.exist?} || @inputs.any?{|path| !path.exist?}
|
55
55
|
end
|
56
56
|
|
57
57
|
# This is a canonical dirty function. All outputs must exist and must be newer than all inputs. This function is not efficient, in the sense that it must query all files on disk for last modified time.
|
data/lib/build/graph/task.rb
CHANGED
@@ -105,8 +105,8 @@ module Build
|
|
105
105
|
return self
|
106
106
|
end
|
107
107
|
|
108
|
-
def invoke(node)
|
109
|
-
child_task = @walker.call(node)
|
108
|
+
def invoke(node, **options)
|
109
|
+
child_task = @walker.call(node, **options)
|
110
110
|
|
111
111
|
raise ArgumentError.new("Invalid child task") unless child_task
|
112
112
|
|
data/lib/build/graph/version.rb
CHANGED
data/lib/build/graph/walker.rb
CHANGED
@@ -87,8 +87,14 @@ module Build
|
|
87
87
|
end
|
88
88
|
end
|
89
89
|
|
90
|
-
def
|
91
|
-
@call_stack.with(state) do
|
90
|
+
def with(**state)
|
91
|
+
@call_stack.with(**state) do
|
92
|
+
yield
|
93
|
+
end
|
94
|
+
end
|
95
|
+
|
96
|
+
def call(node, **state)
|
97
|
+
@call_stack.with(**state) do
|
92
98
|
# We try to fetch the task if it has already been invoked, otherwise we create a new task.
|
93
99
|
@tasks.fetch(node) do
|
94
100
|
@logger.debug{"Update: #{node}"}
|
@@ -21,22 +21,20 @@
|
|
21
21
|
|
22
22
|
require 'build/graph/call_stack'
|
23
23
|
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
24
|
+
RSpec.describe Build::Graph::CallStack do
|
25
|
+
it "should merge state" do
|
26
|
+
outer_state = nil
|
27
|
+
inner_state = nil
|
28
|
+
|
29
|
+
subject.with(x: 10) do
|
30
|
+
outer_state = subject.last
|
29
31
|
|
30
|
-
subject.with(x:
|
31
|
-
|
32
|
-
|
33
|
-
subject.with(x: 20, y: 30) do
|
34
|
-
inner_state = subject.last
|
35
|
-
end
|
32
|
+
subject.with(x: 20, y: 30) do
|
33
|
+
inner_state = subject.last
|
36
34
|
end
|
37
|
-
|
38
|
-
expect(outer_state).to include(:x)
|
39
|
-
expect(inner_state).to include(:x, :y)
|
40
35
|
end
|
36
|
+
|
37
|
+
expect(outer_state).to include(:x)
|
38
|
+
expect(inner_state).to include(:x, :y)
|
41
39
|
end
|
42
40
|
end
|
@@ -24,7 +24,7 @@ require_relative 'process_graph'
|
|
24
24
|
module Build::Graph::GraphSpec
|
25
25
|
include ProcessGraph
|
26
26
|
|
27
|
-
describe Build::Graph do
|
27
|
+
RSpec.describe Build::Graph do
|
28
28
|
let(:group) {Process::Group.new}
|
29
29
|
|
30
30
|
let(:logger) {Logger.new($stderr).tap{|logger| logger.level = Logger::DEBUG}}
|
@@ -27,7 +27,7 @@ module Build::Graph::InheritSpec
|
|
27
27
|
include Build::Graph
|
28
28
|
include Build::Files
|
29
29
|
|
30
|
-
describe Build::Graph::Walker do
|
30
|
+
RSpec.describe Build::Graph::Walker do
|
31
31
|
it "should inherit children outputs", :focus do
|
32
32
|
test_glob = Glob.new(__dir__, "*.rb")
|
33
33
|
listing_output = Paths.directory(__dir__, ["listing.txt"])
|
@@ -27,7 +27,7 @@ module Build::Graph::NodeSpec
|
|
27
27
|
include Build::Graph
|
28
28
|
include Build::Files
|
29
29
|
|
30
|
-
describe Build::Graph::Node do
|
30
|
+
RSpec.describe Build::Graph::Node do
|
31
31
|
it "should be unique" do
|
32
32
|
test_glob = Glob.new(__dir__, "*.rb")
|
33
33
|
listing_output = Paths.directory(__dir__, ["listing.txt"])
|
@@ -28,7 +28,7 @@ module Build::Graph::TaskSpec
|
|
28
28
|
include Build::Graph
|
29
29
|
include Build::Files
|
30
30
|
|
31
|
-
describe Build::Graph::Task do
|
31
|
+
RSpec.describe Build::Graph::Task do
|
32
32
|
it "should wait for children" do
|
33
33
|
node_a = Node.new(Paths::NONE, Paths::NONE, "a")
|
34
34
|
node_b = Node.new(Paths::NONE, Paths::NONE, "b")
|
@@ -28,7 +28,7 @@ module Build::Graph::WalkerSpec
|
|
28
28
|
include Build::Graph
|
29
29
|
include Build::Files
|
30
30
|
|
31
|
-
describe Build::Graph::Walker do
|
31
|
+
RSpec.describe Build::Graph::Walker do
|
32
32
|
let(:logger) {Logger.new($stderr).tap{|logger| logger.level = Logger::DEBUG}}
|
33
33
|
|
34
34
|
it "should be unique" do
|
data/spec/spec_helper.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
|
2
|
+
require 'covered/rspec'
|
3
|
+
|
4
|
+
RSpec.configure do |config|
|
5
|
+
config.disable_monkey_patching!
|
6
|
+
|
7
|
+
# Enable flags like --only-failures and --next-failure
|
8
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
9
|
+
|
10
|
+
config.expect_with :rspec do |c|
|
11
|
+
c.syntax = :expect
|
12
|
+
end
|
13
|
+
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: build-graph
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0
|
4
|
+
version: 1.1.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Samuel Williams
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-14 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: process-group
|
@@ -66,20 +66,34 @@ dependencies:
|
|
66
66
|
- - "~>"
|
67
67
|
- !ruby/object:Gem::Version
|
68
68
|
version: '2.0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: covered
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
84
|
name: bundler
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
|
-
- - "
|
87
|
+
- - ">="
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
89
|
+
version: '0'
|
76
90
|
type: :development
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
|
-
- - "
|
94
|
+
- - ">="
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
96
|
+
version: '0'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
98
|
name: rspec
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -119,7 +133,6 @@ extra_rdoc_files: []
|
|
119
133
|
files:
|
120
134
|
- ".gitignore"
|
121
135
|
- ".rspec"
|
122
|
-
- ".simplecov"
|
123
136
|
- ".travis.yml"
|
124
137
|
- Gemfile
|
125
138
|
- README.md
|
@@ -146,6 +159,7 @@ files:
|
|
146
159
|
- spec/build/graph/program/main.cpp
|
147
160
|
- spec/build/graph/task_spec.rb
|
148
161
|
- spec/build/graph/walker_spec.rb
|
162
|
+
- spec/spec_helper.rb
|
149
163
|
homepage: ''
|
150
164
|
licenses:
|
151
165
|
- MIT
|
@@ -165,8 +179,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
165
179
|
- !ruby/object:Gem::Version
|
166
180
|
version: '0'
|
167
181
|
requirements: []
|
168
|
-
|
169
|
-
rubygems_version: 2.6.10
|
182
|
+
rubygems_version: 3.0.2
|
170
183
|
signing_key:
|
171
184
|
specification_version: 4
|
172
185
|
summary: Build::Graph is a framework for build systems, with specific functionality
|
@@ -186,3 +199,4 @@ test_files:
|
|
186
199
|
- spec/build/graph/program/main.cpp
|
187
200
|
- spec/build/graph/task_spec.rb
|
188
201
|
- spec/build/graph/walker_spec.rb
|
202
|
+
- spec/spec_helper.rb
|