build 2.4.4 → 2.4.5

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: 8b7921d3b8f07853ccccdd021aeba784001c856078cbd272bad7948dda19199a
4
- data.tar.gz: e3ae69fe9aa59716ce07eb2e0755f75d8a9fe2e2b82b66b73f73fbbcfdfcad0e
3
+ metadata.gz: 0a7dc5ba6382c7406b79f7a5963fab483b90f7420cd337e3d3e5c912b6a8dc1e
4
+ data.tar.gz: 2667f5375ed38172f5abe47f595951c82b545d58b27cbcb449b5f1fd8b367ef8
5
5
  SHA512:
6
- metadata.gz: 96f81bd9b9b8d61e0d4409c66d4731083cae8836fe04b693fe68b3a2e106fc3040f4ea80f92c792dcdd894f6cdbffb252d95ecdc9e6c565ba87876b84ed2954c
7
- data.tar.gz: dd759132956ca254cbd977699ee32bdc22fcb537478de63d1a4b264462d24fb22ac6cecdcd3e043b71a9db55347cb8bca393115775eb5813dd327ce83c1faa25
6
+ metadata.gz: 0be1a4642c4b95e46abfc8d49f2a80c77acb819aa906e4912e1161f0422af22bd50056910b80f60e8475c27e28402f64aa15feed23bfc838704916341c0e7a5e
7
+ data.tar.gz: ab49021a6454da45bf8f299cf62b81aa44201e652bc2720d329b97189a5154485f20f064b42cc2bd9dd241adcda32fc36107d718d573a8e1e2513b4d188699fd
@@ -88,13 +88,15 @@ module Build
88
88
  def compute(arguments, scope)
89
89
  if implicit?
90
90
  # Can be replaced if supplied:
91
- arguments[@name] || scope.instance_exec(arguments, &@dynamic)
91
+ arguments[@name] || scope.instance_exec(arguments, &@dynamic) || @options[:default]
92
92
  elsif dynamic?
93
93
  # Argument is optional:
94
- scope.instance_exec(arguments[@name], arguments, &@dynamic)
95
- else
94
+ scope.instance_exec(arguments[@name], arguments, &@dynamic) || @options[:default]
95
+ elsif arguments.key?(@name)
96
96
  arguments[@name]
97
- end || @options[:default]
97
+ else
98
+ @options[:default]
99
+ end
98
100
  end
99
101
 
100
102
  def hash
@@ -19,5 +19,5 @@
19
19
  # THE SOFTWARE.
20
20
 
21
21
  module Build
22
- VERSION = "2.4.4"
22
+ VERSION = "2.4.5"
23
23
  end
@@ -32,4 +32,22 @@ RSpec.describe Build::Rule do
32
32
  expect(rule.applicable?(source: 'foo', destination: 'bar')).to be_truthy
33
33
  expect(rule.applicable?(source: 'foo')).to be_falsey
34
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
35
53
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.4
4
+ version: 2.4.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - Samuel Williams
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-09-14 00:00:00.000000000 Z
11
+ date: 2019-09-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: build-graph