build 2.6.0 → 2.6.1

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
  SHA256:
3
- metadata.gz: 0ad08615d58ed88206dd99c9a77400daf263343bf9e00d8c724cc73050abb702
4
- data.tar.gz: 840fde0567eccfce19a4eb3b99219f8aec9d798ca6443a67dafa825bef8c01df
3
+ metadata.gz: 1d19cc4bbe6685576a37aaa0abc93c2f264660d0ae4265c8c9eb8cc7eea9a462
4
+ data.tar.gz: c40c1bd3188a406d6c5f836ed02181f7fa4ccb8ea6b4b42367df01586d097e8b
5
5
  SHA512:
6
- metadata.gz: 86a6d619396f7215c3b816a12bfbfb4c6b3aecf57b83ae48a57549cddf94b4ee77d08a41ffcc222241c981d73fb3686b56b23f818044200512c0cfbda70fb61a
7
- data.tar.gz: 99ff73db7486709ab8691d6243bffd28342bce8de5afc0783b90c72a396fccc15bd838e4ddfd8b3d25f212abdaa111d31ae5bf54402cd4a84306e1b7ed640794
6
+ metadata.gz: 466d9379b0c9c35ac3e2ea9494ea1b870ceec42d74494572e79aa6938e02a28da7185bac37165e8ee62b70d59640c928adb25276b52554b5b0a4fcf2dd952dcf
7
+ data.tar.gz: 6fe800fc5113bbf0831b04a853a3e9fc2340884662feac512f86b92e6595467d4df8049c5852dcef6644b8b45f22b2b9d8a9fb438ae7bc7ef2351f2c12d2f443
checksums.yaml.gz.sig ADDED
Binary file
@@ -99,10 +99,10 @@ module Build
99
99
  @node.dirty?
100
100
  end
101
101
 
102
- def spawn(*arguments)
102
+ def spawn(*arguments, **options)
103
103
  if wet?
104
- @logger&.info(self) {Console::Event::Spawn.for(*arguments)}
105
- status = @group.spawn(*arguments)
104
+ @logger&.info(self) {Console::Event::Spawn.for(*arguments, **options)}
105
+ status = @group.spawn(*arguments, **options)
106
106
 
107
107
  if status != 0
108
108
  raise CommandFailure.new(self, arguments, status)
@@ -114,8 +114,8 @@ module Build
114
114
  @shell_environment ||= environment.flatten.export
115
115
  end
116
116
 
117
- def run!(*arguments)
118
- self.spawn(shell_environment, *arguments)
117
+ def run!(*arguments, **options)
118
+ self.spawn(shell_environment, *arguments, **options)
119
119
  end
120
120
 
121
121
  def touch(path)
data/lib/build/version.rb CHANGED
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Build
22
- VERSION = "2.6.0"
22
+ VERSION = "2.6.1"
23
23
  end
data.tar.gz.sig ADDED
Binary file
metadata CHANGED
@@ -1,29 +1,57 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.6.0
4
+ version: 2.6.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
- autorequire:
8
+ autorequire:
9
9
  bindir: bin
10
- cert_chain: []
11
- date: 2019-10-07 00:00:00.000000000 Z
10
+ cert_chain:
11
+ - |
12
+ -----BEGIN CERTIFICATE-----
13
+ MIIEhDCCAuygAwIBAgIBATANBgkqhkiG9w0BAQsFADA3MTUwMwYDVQQDDCxzYW11
14
+ ZWwud2lsbGlhbXMvREM9b3Jpb250cmFuc2Zlci9EQz1jby9EQz1uejAeFw0yMTA4
15
+ MTYwNjMzNDRaFw0yMjA4MTYwNjMzNDRaMDcxNTAzBgNVBAMMLHNhbXVlbC53aWxs
16
+ aWFtcy9EQz1vcmlvbnRyYW5zZmVyL0RDPWNvL0RDPW56MIIBojANBgkqhkiG9w0B
17
+ AQEFAAOCAY8AMIIBigKCAYEAyXLSS/cw+fXJ5e7hi+U/TeChPWeYdwJojDsFY1xr
18
+ xvtqbTTL8gbLHz5LW3QD2nfwCv3qTlw0qI3Ie7a9VMJMbSvgVEGEfQirqIgJXWMj
19
+ eNMDgKsMJtC7u/43abRKx7TCURW3iWyR19NRngsJJmaR51yGGGm2Kfsr+JtKKLtL
20
+ L188Wm3f13KAx7QJU8qyuBnj1/gWem076hzdA7xi1DbrZrch9GCRz62xymJlrJHn
21
+ 9iZEZ7AxrS7vokhMlzSr/XMUihx/8aFKtk+tMLClqxZSmBWIErWdicCGTULXCBNb
22
+ E/mljo4zEVKhlTWpJklMIhr55ZRrSarKFuW7en0+tpJrfsYiAmXMJNi4XAYJH7uL
23
+ rgJuJwSaa/dMz+VmUoo7VKtSfCoOI+6v5/z0sK3oT6sG6ZwyI47DBq2XqNC6tnAj
24
+ w+XmCywiTQrFzMMAvcA7rPI4F0nU1rZId51rOvvfxaONp+wgTi4P8owZLw0/j0m4
25
+ 8C20DYi6EYx4AHDXiLpElWh3AgMBAAGjgZowgZcwCQYDVR0TBAIwADALBgNVHQ8E
26
+ BAMCBLAwHQYDVR0OBBYEFB6ZaeWKxQjGTI+pmz7cKRmMIywwMC4GA1UdEQQnMCWB
27
+ I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MC4GA1UdEgQnMCWB
28
+ I3NhbXVlbC53aWxsaWFtc0BvcmlvbnRyYW5zZmVyLmNvLm56MA0GCSqGSIb3DQEB
29
+ CwUAA4IBgQBVoM+pu3dpdUhZM1w051iw5GfiqclAr1Psypf16Tiod/ho//4oAu6T
30
+ 9fj3DPX/acWV9P/FScvqo4Qgv6g4VWO5ZU7z2JmPoTXZtYMunRAmQPFL/gSUc6aK
31
+ vszMHIyhtyzRc6DnfW2AiVOjMBjaYv8xXZc9bduniRVPrLR4J7ozmGLh4o4uJp7w
32
+ x9KCFaR8Lvn/r0oJWJOqb/DMAYI83YeN2Dlt3jpwrsmsONrtC5S3gOUle5afSGos
33
+ bYt5ocnEpKSomR9ZtnCGljds/aeO1Xgpn2r9HHcjwnH346iNrnHmMlC7BtHUFPDg
34
+ Ts92S47PTOXzwPBDsrFiq3VLbRjHSwf8rpqybQBH9MfzxGGxTaETQYOd6b4e4Ag6
35
+ y92abGna0bmIEb4+Tx9rQ10Uijh1POzvr/VTH4bbIPy9FbKrRsIQ24qDbNJRtOpE
36
+ RAOsIl+HOBTb252nx1kIRN5hqQx272AJCbCjKx8egcUQKffFVVCI0nye09v5CK+a
37
+ HiLJ8VOFx6w=
38
+ -----END CERTIFICATE-----
39
+ date: 2022-05-23 00:00:00.000000000 Z
12
40
  dependencies:
13
41
  - !ruby/object:Gem::Dependency
14
- name: build-graph
42
+ name: build-dependency
15
43
  requirement: !ruby/object:Gem::Requirement
16
44
  requirements:
17
45
  - - "~>"
18
46
  - !ruby/object:Gem::Version
19
- version: '2.1'
47
+ version: '1.5'
20
48
  type: :runtime
21
49
  prerelease: false
22
50
  version_requirements: !ruby/object:Gem::Requirement
23
51
  requirements:
24
52
  - - "~>"
25
53
  - !ruby/object:Gem::Version
26
- version: '2.1'
54
+ version: '1.5'
27
55
  - !ruby/object:Gem::Dependency
28
56
  name: build-environment
29
57
  requirement: !ruby/object:Gem::Requirement
@@ -39,19 +67,19 @@ dependencies:
39
67
  - !ruby/object:Gem::Version
40
68
  version: '1.12'
41
69
  - !ruby/object:Gem::Dependency
42
- name: build-dependency
70
+ name: build-graph
43
71
  requirement: !ruby/object:Gem::Requirement
44
72
  requirements:
45
73
  - - "~>"
46
74
  - !ruby/object:Gem::Version
47
- version: '1.5'
75
+ version: '2.1'
48
76
  type: :runtime
49
77
  prerelease: false
50
78
  version_requirements: !ruby/object:Gem::Requirement
51
79
  requirements:
52
80
  - - "~>"
53
81
  - !ruby/object:Gem::Version
54
- version: '1.5'
82
+ version: '2.1'
55
83
  - !ruby/object:Gem::Dependency
56
84
  name: build-makefile
57
85
  requirement: !ruby/object:Gem::Requirement
@@ -67,7 +95,7 @@ dependencies:
67
95
  - !ruby/object:Gem::Version
68
96
  version: '1.0'
69
97
  - !ruby/object:Gem::Dependency
70
- name: graphviz
98
+ name: console
71
99
  requirement: !ruby/object:Gem::Requirement
72
100
  requirements:
73
101
  - - "~>"
@@ -81,7 +109,7 @@ dependencies:
81
109
  - !ruby/object:Gem::Version
82
110
  version: '1.0'
83
111
  - !ruby/object:Gem::Dependency
84
- name: console
112
+ name: graphviz
85
113
  requirement: !ruby/object:Gem::Requirement
86
114
  requirements:
87
115
  - - "~>"
@@ -95,7 +123,7 @@ dependencies:
95
123
  - !ruby/object:Gem::Version
96
124
  version: '1.0'
97
125
  - !ruby/object:Gem::Dependency
98
- name: covered
126
+ name: bundler
99
127
  requirement: !ruby/object:Gem::Requirement
100
128
  requirements:
101
129
  - - ">="
@@ -109,7 +137,7 @@ dependencies:
109
137
  - !ruby/object:Gem::Version
110
138
  version: '0'
111
139
  - !ruby/object:Gem::Dependency
112
- name: bundler
140
+ name: covered
113
141
  requirement: !ruby/object:Gem::Requirement
114
142
  requirements:
115
143
  - - ">="
@@ -123,48 +151,39 @@ dependencies:
123
151
  - !ruby/object:Gem::Version
124
152
  version: '0'
125
153
  - !ruby/object:Gem::Dependency
126
- name: rspec
154
+ name: rake
127
155
  requirement: !ruby/object:Gem::Requirement
128
156
  requirements:
129
- - - "~>"
157
+ - - ">="
130
158
  - !ruby/object:Gem::Version
131
- version: '3.6'
159
+ version: '0'
132
160
  type: :development
133
161
  prerelease: false
134
162
  version_requirements: !ruby/object:Gem::Requirement
135
163
  requirements:
136
- - - "~>"
164
+ - - ">="
137
165
  - !ruby/object:Gem::Version
138
- version: '3.6'
166
+ version: '0'
139
167
  - !ruby/object:Gem::Dependency
140
- name: rake
168
+ name: rspec
141
169
  requirement: !ruby/object:Gem::Requirement
142
170
  requirements:
143
- - - ">="
171
+ - - "~>"
144
172
  - !ruby/object:Gem::Version
145
- version: '0'
173
+ version: '3.6'
146
174
  type: :development
147
175
  prerelease: false
148
176
  version_requirements: !ruby/object:Gem::Requirement
149
177
  requirements:
150
- - - ">="
178
+ - - "~>"
151
179
  - !ruby/object:Gem::Version
152
- version: '0'
153
- description:
180
+ version: '3.6'
181
+ description:
154
182
  email:
155
- - samuel.williams@oriontransfer.co.nz
156
183
  executables: []
157
184
  extensions: []
158
185
  extra_rdoc_files: []
159
186
  files:
160
- - ".gitignore"
161
- - ".rspec"
162
- - ".travis.yml"
163
- - Gemfile
164
- - Gemfile.local
165
- - README.md
166
- - Rakefile
167
- - build.gemspec
168
187
  - lib/build.rb
169
188
  - lib/build/build_node.rb
170
189
  - lib/build/chain_node.rb
@@ -178,17 +197,11 @@ files:
178
197
  - lib/build/rulebook.rb
179
198
  - lib/build/task.rb
180
199
  - lib/build/version.rb
181
- - spec/build/controller_spec.rb
182
- - spec/build/name_spec.rb
183
- - spec/build/rule_spec.rb
184
- - spec/build/rulebook_spec.rb
185
- - spec/build/target.rb
186
- - spec/spec_helper.rb
187
- homepage: ''
200
+ homepage: https://github.com/kurocha/build
188
201
  licenses:
189
202
  - MIT
190
203
  metadata: {}
191
- post_install_message:
204
+ post_install_message:
192
205
  rdoc_options: []
193
206
  require_paths:
194
207
  - lib
@@ -203,14 +216,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
203
216
  - !ruby/object:Gem::Version
204
217
  version: '0'
205
218
  requirements: []
206
- rubygems_version: 3.0.4
207
- signing_key:
219
+ rubygems_version: 3.1.6
220
+ signing_key:
208
221
  specification_version: 4
209
- summary: Build is a framework for working with task based build systems.
210
- test_files:
211
- - spec/build/controller_spec.rb
212
- - spec/build/name_spec.rb
213
- - spec/build/rule_spec.rb
214
- - spec/build/rulebook_spec.rb
215
- - spec/build/target.rb
216
- - spec/spec_helper.rb
222
+ summary: Build is a framework for creating task based build systems.
223
+ test_files: []
metadata.gz.sig ADDED
Binary file
data/.gitignore DELETED
@@ -1,23 +0,0 @@
1
- *.gem
2
- *.rbc
3
- .bundle
4
- .config
5
- .yardoc
6
- Gemfile.lock
7
- InstalledFiles
8
- _yardoc
9
- coverage
10
- doc/
11
- lib/bundler/man
12
- pkg
13
- rdoc
14
- spec/reports
15
- test/tmp
16
- test/version_tmp
17
- tmp
18
- *.bundle
19
- *.so
20
- *.o
21
- *.a
22
- mkmf.log
23
- .rspec_status
data/.rspec DELETED
@@ -1,4 +0,0 @@
1
- --format documentation
2
- --backtrace
3
- --warnings
4
- --require spec_helper
data/.travis.yml DELETED
@@ -1,12 +0,0 @@
1
- language: ruby
2
- dist: xenial
3
- cache: bundler
4
-
5
- matrix:
6
- include:
7
- - rvm: 2.3
8
- - rvm: 2.4
9
- - rvm: 2.5
10
- - rvm: 2.6
11
- - rvm: 2.6
12
- env: COVERAGE=BriefSummary,Coveralls
data/Gemfile DELETED
@@ -1,4 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in build.gemspec
4
- gemspec
data/Gemfile.local DELETED
@@ -1,24 +0,0 @@
1
- source 'https://rubygems.org'
2
-
3
- # Specify your gem's dependencies in build.gemspec
4
- gemspec
5
-
6
- group :development do
7
- gem 'pry'
8
- gem 'pry-coolline'
9
-
10
- gem 'build-environment', path: '../build-environment'
11
- gem 'build-files', path: '../build-files'
12
- gem 'build-graph', path: '../build-graph'
13
- gem 'build-makefile', path: '../build-makefile'
14
-
15
- gem 'process-daemon', path: '../process-daemon'
16
- gem 'process-group', path: '../process-group'
17
-
18
- gem 'graphviz', path: '../graphviz'
19
- end
20
-
21
- group :test do
22
- gem 'simplecov'
23
- gem 'coveralls', require: false
24
- end
data/README.md DELETED
@@ -1,57 +0,0 @@
1
- # Build
2
-
3
- Build is a ruby gem providing systems for building task driven build systems similar to make.
4
-
5
- [![Build Status](https://secure.travis-ci.org/ioquatix/build.svg)](http://travis-ci.org/ioquatix/build)
6
- [![Code Climate](https://codeclimate.com/github/ioquatix/build.svg)](https://codeclimate.com/github/ioquatix/build)
7
- [![Coverage Status](https://coveralls.io/repos/ioquatix/build/badge.svg)](https://coveralls.io/r/ioquatix/build)
8
-
9
- ## Installation
10
-
11
- Add this line to your application's Gemfile:
12
-
13
- gem 'build'
14
-
15
- And then execute:
16
-
17
- $ bundle
18
-
19
- Or install it yourself as:
20
-
21
- $ gem install build
22
-
23
- ## Usage
24
-
25
- This gem is a container for `build-files` and `build-graph`.
26
-
27
- ## Contributing
28
-
29
- 1. Fork it
30
- 2. Create your feature branch (`git checkout -b my-new-feature`)
31
- 3. Commit your changes (`git commit -am 'Add some feature'`)
32
- 4. Push to the branch (`git push origin my-new-feature`)
33
- 5. Create new Pull Request
34
-
35
- ## License
36
-
37
- Released under the MIT license.
38
-
39
- Copyright, 2015, by [Samuel G. D. Williams](http://www.codeotaku.com/samuel-williams).
40
-
41
- Permission is hereby granted, free of charge, to any person obtaining a copy
42
- of this software and associated documentation files (the "Software"), to deal
43
- in the Software without restriction, including without limitation the rights
44
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
45
- copies of the Software, and to permit persons to whom the Software is
46
- furnished to do so, subject to the following conditions:
47
-
48
- The above copyright notice and this permission notice shall be included in
49
- all copies or substantial portions of the Software.
50
-
51
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
52
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
53
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
54
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
55
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
56
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
57
- THE SOFTWARE.
data/Rakefile DELETED
@@ -1,10 +0,0 @@
1
-
2
- require "bundler/gem_tasks"
3
- require "rspec/core/rake_task"
4
-
5
- # Load all rake tasks:
6
- import(*Dir.glob('tasks/**/*.rake'))
7
-
8
- RSpec::Core::RakeTask.new(:spec)
9
-
10
- task :default => :spec
data/build.gemspec DELETED
@@ -1,32 +0,0 @@
1
-
2
- require_relative 'lib/build/version'
3
-
4
- Gem::Specification.new do |spec|
5
- spec.name = "build"
6
- spec.version = Build::VERSION
7
- spec.authors = ["Samuel Williams"]
8
- spec.email = ["samuel.williams@oriontransfer.co.nz"]
9
- spec.summary = %q{Build is a framework for working with task based build systems.}
10
- spec.homepage = ""
11
- spec.license = "MIT"
12
-
13
- spec.files = `git ls-files -z`.split("\x0")
14
- spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
15
- spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
16
- spec.require_paths = ["lib"]
17
-
18
- spec.required_ruby_version = '>= 2.0'
19
-
20
- spec.add_dependency "build-graph", "~> 2.1"
21
- spec.add_dependency "build-environment", "~> 1.12"
22
- spec.add_dependency "build-dependency", "~> 1.5"
23
- spec.add_dependency "build-makefile", "~> 1.0"
24
-
25
- spec.add_dependency "graphviz", "~> 1.0"
26
- spec.add_dependency "console", "~> 1.0"
27
-
28
- spec.add_development_dependency "covered"
29
- spec.add_development_dependency "bundler"
30
- spec.add_development_dependency "rspec", "~> 3.6"
31
- spec.add_development_dependency "rake"
32
- end
@@ -1,129 +0,0 @@
1
- #!/usr/bin/env rspec
2
-
3
- # Copyright, 2015, by Samuel G. D. Williams. <http://www.codeotaku.com>
4
- #
5
- # Permission is hereby granted, free of charge, to any person obtaining a copy
6
- # of this software and associated documentation files (the "Software"), to deal
7
- # in the Software without restriction, including without limitation the rights
8
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
- # copies of the Software, and to permit persons to whom the Software is
10
- # furnished to do so, subject to the following conditions:
11
- #
12
- # The above copyright notice and this permission notice shall be included in
13
- # all copies or substantial portions of the Software.
14
- #
15
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
- # THE SOFTWARE.
22
-
23
- require 'build/rulebook'
24
- require 'build/controller'
25
-
26
- require_relative 'target'
27
-
28
- RSpec.describe Build::Controller do
29
- let(:base) {Build::Environment.new(name: "base")}
30
-
31
- context "failure exit status" do
32
- let(:make_target) do
33
- Target.new("make") do |target|
34
- target.provides "make" do
35
- define Build::Rule, "make.file" do
36
- output :destination
37
-
38
- apply do |parameters|
39
- run! "exit -1"
40
- end
41
- end
42
- end
43
- end
44
- end
45
-
46
- let(:build_target) do
47
- Target.new("foo") do |target|
48
- target.depends "make"
49
-
50
- target.provides "foo" do
51
- foo_path = Build::Files::Path['foo']
52
-
53
- make destination: foo_path
54
- end
55
- end
56
- end
57
-
58
- it "build graph should fail" do
59
- chain = Build::Dependency::Chain.expand(["foo"], [make_target, build_target])
60
-
61
- controller = Build::Controller.new do |controller|
62
- controller.add_chain(chain, [], base)
63
- end
64
-
65
- controller.logger.level = Logger::DEBUG
66
-
67
- controller.update
68
-
69
- expect(controller.failed?).to be_truthy
70
- end
71
- end
72
-
73
- context "copying files" do
74
- let(:files_target) do
75
- Target.new("files") do |target|
76
- target.provides "files" do
77
- define Build::Rule, "make.file" do
78
- output :destination
79
-
80
- apply do |parameters|
81
- run! 'sleep 0.1'
82
- touch parameters[:destination]
83
- end
84
- end
85
-
86
- define Build::Rule, "copy.file" do
87
- input :source
88
- output :destination
89
-
90
- apply do |parameters|
91
- cp parameters[:source], parameters[:destination]
92
- end
93
- end
94
- end
95
- end
96
- end
97
-
98
- let(:build_target) do
99
- Target.new("build") do |target|
100
- target.depends "files"
101
-
102
- target.provides "foo" do
103
- foo_path = Build::Files::Path['foo']
104
- bar_path = Build::Files::Path['bar']
105
-
106
- make destination: foo_path
107
- copy source: foo_path, destination: bar_path
108
- end
109
- end
110
- end
111
-
112
- it "should execute the build graph" do
113
- chain = Build::Dependency::Chain.expand(["foo"], [files_target, build_target])
114
-
115
- controller = Build::Controller.new do |controller|
116
- controller.add_chain(chain, [], base)
117
- end
118
-
119
- expect(controller.nodes.size).to be 1
120
-
121
- controller.update
122
-
123
- expect(File).to be_exist('foo')
124
- expect(File).to be_exist('bar')
125
-
126
- FileUtils.rm ['foo', 'bar']
127
- end
128
- end
129
- end
@@ -1,52 +0,0 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'build/name'
22
-
23
- RSpec.describe Build::Name do
24
- let(:name) {Build::Name.new('Foo Bar')}
25
- it "retains the original text" do
26
- expect(name.text).to be == 'Foo Bar'
27
- end
28
-
29
- it "should generate useful identifiers" do
30
- expect(name.identifier).to be == 'FooBar'
31
- end
32
-
33
- it "should generate useful target names" do
34
- expect(name.target).to be == 'foo-bar'
35
- end
36
-
37
- it "should generate useful key names" do
38
- expect(name.key('executable')).to be == 'foo_bar_executable'
39
- end
40
-
41
- it "should generate useful macro names" do
42
- expect(name.macro).to be == 'FOO_BAR'
43
- end
44
-
45
- it "should generate useful macro names" do
46
- expect(name.macro).to be == 'FOO_BAR'
47
- end
48
-
49
- it "can be constructed from target name" do
50
- expect(Build::Name.from_target(name.target).text).to be == name.text
51
- end
52
- end
@@ -1,53 +0,0 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'build/rule'
22
-
23
- RSpec.describe Build::Rule do
24
- it "should validate input and output parameters" do
25
- rule = Build::Rule.new("compile", "cpp")
26
-
27
- rule.input :source
28
- rule.output :destination
29
-
30
- expect(rule.parameters.size).to be 2
31
-
32
- expect(rule.applicable?(source: 'foo', destination: 'bar')).to be_truthy
33
- expect(rule.applicable?(source: 'foo')).to be_falsey
34
- end
35
-
36
- it "respects false argument" do
37
- rule = Build::Rule.new("compile", "cpp")
38
-
39
- rule.parameter :install, default: true
40
-
41
- expect(
42
- rule.normalize({}, binding)
43
- ).to be == {install: true}
44
-
45
- expect(
46
- rule.normalize({install: true}, binding)
47
- ).to be == {install: true}
48
-
49
- expect(
50
- rule.normalize({install: false}, binding)
51
- ).to be == {install: false}
52
- end
53
- end
@@ -1,52 +0,0 @@
1
- # Copyright, 2012, by Samuel G. D. Williams. <http://www.codeotaku.com>
2
- #
3
- # Permission is hereby granted, free of charge, to any person obtaining a copy
4
- # of this software and associated documentation files (the "Software"), to deal
5
- # in the Software without restriction, including without limitation the rights
6
- # to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
7
- # copies of the Software, and to permit persons to whom the Software is
8
- # furnished to do so, subject to the following conditions:
9
- #
10
- # The above copyright notice and this permission notice shall be included in
11
- # all copies or substantial portions of the Software.
12
- #
13
- # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
14
- # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
15
- # FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
16
- # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
17
- # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
18
- # OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
19
- # THE SOFTWARE.
20
-
21
- require 'build/environment'
22
- require 'build/rulebook'
23
-
24
- RSpec.describe Build::Rulebook do
25
- it "should generate a valid rulebook" do
26
- environment = Build::Environment.new do
27
- define Build::Rule, "copy.file" do
28
- input :source
29
- output :destination
30
-
31
- apply do |parameters|
32
- cp parameters[:source], parameters[:destination]
33
- end
34
- end
35
-
36
- define Build::Rule, "delete.file" do
37
- input :target
38
-
39
- apply do |parameters|
40
- rm parameters[:target]
41
- end
42
- end
43
- end
44
-
45
- rulebook = Build::Rulebook.for(environment.flatten)
46
-
47
- expect(rulebook.rules.size).to be 2
48
-
49
- expect(rulebook.rules).to be_include 'copy.file'
50
- expect(rulebook.rules).to be_include 'delete.file'
51
- end
52
- end
data/spec/build/target.rb DELETED
@@ -1,20 +0,0 @@
1
-
2
- require 'build/dependency'
3
-
4
- class Target
5
- include Build::Dependency
6
-
7
- def initialize(name = nil)
8
- @name = name
9
-
10
- if block_given?
11
- yield self
12
- end
13
- end
14
-
15
- attr :name
16
-
17
- def inspect
18
- "\#<#{self.class}: #{@name}>"
19
- end
20
- end
data/spec/spec_helper.rb DELETED
@@ -1,12 +0,0 @@
1
-
2
- require 'covered/rspec'
3
- require 'build'
4
-
5
- RSpec.configure do |config|
6
- # Enable flags like --only-failures and --next-failure
7
- config.example_status_persistence_file_path = ".rspec_status"
8
-
9
- config.expect_with :rspec do |c|
10
- c.syntax = :expect
11
- end
12
- end