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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 0f20e0d466cc74671971daf58b04fba2745c0902c2defa35674f34a7c162110e
4
- data.tar.gz: 6c42c806db26e5fbcd53a1963039226307fbd6ffde19e9542459aec90dc957ab
3
+ metadata.gz: 492f25a57714d2d9919a2f2a104b087f4544fd4b4cfbb6add3ab752197214970
4
+ data.tar.gz: c0080ffc1303d650ae5fdb6a45fb7e2fd315590c6a341da5e6a006b10ddab71f
5
5
  SHA512:
6
- metadata.gz: c67764751cbe331d6b8e550a1eb0244d774466aa950d5c40dcdf3d4bc1bdbcf02ea5a1a0629349294ec7f284efcc85ec8b3a513735e0afda6b48900b454ad66e
7
- data.tar.gz: 2630b3c80822d7b5789c086704c155f4c8e9e45ebfef7dc0265b4b932598666684b562d8a6466b42704ccdf3736651daf7a58e9f1b79ed207fb5cac4121206e6
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
 
@@ -1,5 +1,5 @@
1
1
  module Build
2
2
  class Environment
3
- VERSION = "1.11.0"
3
+ VERSION = "1.12.0"
4
4
  end
5
5
  end
@@ -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.11.0
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-06-09 00:00:00.000000000 Z
11
+ date: 2019-09-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: covered