build-environment 1.11.0 → 1.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/lib/build/environment/base.rb +17 -6
- data/lib/build/environment/version.rb +1 -1
- data/spec/build/environment/environment_spec.rb +4 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 492f25a57714d2d9919a2f2a104b087f4544fd4b4cfbb6add3ab752197214970
|
4
|
+
data.tar.gz: c0080ffc1303d650ae5fdb6a45fb7e2fd315590c6a341da5e6a006b10ddab71f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6d269df24c6a24c8497ec2639c5f0a66382920cf70b69ff20623d484e6cf9e32b6860a416998a699fb717b1b4a0cf93f667ab9e34701cab22b480a6199c77f2
|
7
|
+
data.tar.gz: 5c18852270059bf9b6341e84861940ee4fa4161dd25538e122a7eeb209c0e0e697d50b9c5277c84af456fc55b34973b5df0d88fb871817d5b53b849729bd9ad9
|
@@ -21,8 +21,6 @@
|
|
21
21
|
module Build
|
22
22
|
# This is the basic environment data structure which is essentially a linked list of hashes. It is primarily used for organising build configurations across a wide range of different sub-systems, e.g. platform configuration, target configuration, local project configuration, etc.
|
23
23
|
class Environment
|
24
|
-
include Comparable
|
25
|
-
|
26
24
|
def initialize(parent = nil, values = nil, name: nil, &block)
|
27
25
|
@parent = parent
|
28
26
|
@values = (values || {}).to_h
|
@@ -31,6 +29,23 @@ module Build
|
|
31
29
|
@name = name
|
32
30
|
end
|
33
31
|
|
32
|
+
def == other
|
33
|
+
self.equal?(other) or
|
34
|
+
self.class == other.class and
|
35
|
+
@parent == other.parent and
|
36
|
+
@values == other.values and
|
37
|
+
@update == other.update and
|
38
|
+
@name == other.name
|
39
|
+
end
|
40
|
+
|
41
|
+
def eql?(other)
|
42
|
+
self == other
|
43
|
+
end
|
44
|
+
|
45
|
+
def hash
|
46
|
+
@parent.hash ^ @values.hash ^ @update.hash ^ @name.hash
|
47
|
+
end
|
48
|
+
|
34
49
|
attr :parent
|
35
50
|
attr :values
|
36
51
|
attr :update
|
@@ -40,10 +55,6 @@ module Build
|
|
40
55
|
self.class.new(parent, values.dup, name: name, &update)
|
41
56
|
end
|
42
57
|
|
43
|
-
def <=> other
|
44
|
-
self.to_h <=> other.to_h
|
45
|
-
end
|
46
|
-
|
47
58
|
def freeze
|
48
59
|
return self if frozen?
|
49
60
|
|
@@ -59,7 +59,7 @@ RSpec.describe Build::Environment do
|
|
59
59
|
b[:cflags] = ["-stdlib=libc++"]
|
60
60
|
b[:rcflags] = lambda {cflags.reverse}
|
61
61
|
|
62
|
-
expect(b.evaluate).to be == {
|
62
|
+
expect(b.evaluate.to_h).to be == {
|
63
63
|
:cflags => ["-std=c++11", "-stdlib=libc++"],
|
64
64
|
:rcflags => ["-stdlib=libc++", "-std=c++11"]
|
65
65
|
}
|
@@ -110,7 +110,7 @@ RSpec.describe Build::Environment do
|
|
110
110
|
architectures ["-march", "i386"]
|
111
111
|
end
|
112
112
|
|
113
|
-
expect(platform).to be == {
|
113
|
+
expect(platform.to_h).to be == {
|
114
114
|
os: "linux",
|
115
115
|
compiler: "cc",
|
116
116
|
architectures: ["-march", "i386"]
|
@@ -121,7 +121,7 @@ RSpec.describe Build::Environment do
|
|
121
121
|
default architectures ["-march", "i686"]
|
122
122
|
end
|
123
123
|
|
124
|
-
expect(local).to be == {
|
124
|
+
expect(local.to_h).to be == {
|
125
125
|
compiler: "clang",
|
126
126
|
architectures: ["-march", "i686"]
|
127
127
|
}
|
@@ -131,7 +131,7 @@ RSpec.describe Build::Environment do
|
|
131
131
|
local
|
132
132
|
).flatten
|
133
133
|
|
134
|
-
expect(combined).to be == {
|
134
|
+
expect(combined.to_h).to be == {
|
135
135
|
os: "linux",
|
136
136
|
compiler: "clang",
|
137
137
|
architectures: ["-march", "i386"]
|
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.
|
4
|
+
version: 1.12.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-
|
11
|
+
date: 2019-09-30 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: covered
|