build-environment 1.10.1 → 1.11.0

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: 7eb5fe0826888d3bde938b5969034d7d12fa1b5e1e53ee87466e3167b6a88ad2
4
- data.tar.gz: 32c5197bb33d2e71eb1271a0075d225315806af583df1f547080dfd203270316
3
+ metadata.gz: 0f20e0d466cc74671971daf58b04fba2745c0902c2defa35674f34a7c162110e
4
+ data.tar.gz: 6c42c806db26e5fbcd53a1963039226307fbd6ffde19e9542459aec90dc957ab
5
5
  SHA512:
6
- metadata.gz: 67f7def55c08b0226fa81bf88cdbce525017049fec676501ebe02985019d4db9fcaf9d81448a680e189880036e86aba2be0a4e09fc57d9a8f7b367848b257752
7
- data.tar.gz: 4cc30800b6413c54e45f83f30dda0725e7b440fb089902314e3f02fcbeb47752cf7511dada3b2cb9807738ea52e482697be5ea6244c92407ded90040bd16d8d9
6
+ metadata.gz: c67764751cbe331d6b8e550a1eb0244d774466aa950d5c40dcdf3d4bc1bdbcf02ea5a1a0629349294ec7f284efcc85ec8b3a513735e0afda6b48900b454ad66e
7
+ data.tar.gz: 2630b3c80822d7b5789c086704c155f4c8e9e45ebfef7dc0265b4b932598666684b562d8a6466b42704ccdf3736651daf7a58e9f1b79ed207fb5cac4121206e6
@@ -48,6 +48,8 @@ module Build
48
48
 
49
49
  flatten_to_hash(hash)
50
50
 
51
+ options[:name] ||= self.name
52
+
51
53
  return self.class.new(nil, hash, **options)
52
54
  end
53
55
 
@@ -1,5 +1,5 @@
1
1
  module Build
2
2
  class Environment
3
- VERSION = "1.10.1"
3
+ VERSION = "1.11.0"
4
4
  end
5
5
  end
@@ -0,0 +1,42 @@
1
+ # Copyright, 2019, 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/environment/flatten'
23
+
24
+ require_relative 'rule'
25
+
26
+ RSpec.describe Build::Environment do
27
+ it "preserves name of top level environment" do
28
+ a = described_class.new(name: "a")
29
+ b = described_class.new(a, name: "b")
30
+ c = b.flatten
31
+
32
+ expect(c.name).to be == "b"
33
+ end
34
+
35
+ it "uses name if specified" do
36
+ a = described_class.new(name: "a")
37
+ b = described_class.new(a, name: "b")
38
+ c = b.flatten(name: "c")
39
+
40
+ expect(c.name).to be == "c"
41
+ end
42
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: build-environment
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.10.1
4
+ version: 1.11.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: 2019-04-28 00:00:00.000000000 Z
11
+ date: 2019-06-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: covered
@@ -92,6 +92,7 @@ files:
92
92
  - spec/build/environment/constructor_spec.rb
93
93
  - spec/build/environment/environment_spec.rb
94
94
  - spec/build/environment/evaluator_spec.rb
95
+ - spec/build/environment/flatten_spec.rb
95
96
  - spec/build/environment/freeze_spec.rb
96
97
  - spec/build/environment/rule.rb
97
98
  - spec/build/environment/system_spec.rb
@@ -126,6 +127,7 @@ test_files:
126
127
  - spec/build/environment/constructor_spec.rb
127
128
  - spec/build/environment/environment_spec.rb
128
129
  - spec/build/environment/evaluator_spec.rb
130
+ - spec/build/environment/flatten_spec.rb
129
131
  - spec/build/environment/freeze_spec.rb
130
132
  - spec/build/environment/rule.rb
131
133
  - spec/build/environment/system_spec.rb