semantic_puppet 0.1.2 → 0.1.3
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
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 38ebb59dfcd6e82ac6ea128d8515b2662acbd3e1
|
4
|
+
data.tar.gz: f09b3b0f9d3df0e086fcc577621352e0e876d8cf
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 270364d1106aaf1e1a23921f7e0a65e94f21d66e8f05ff1f96f10ebd68da177d3d0127f5f09a6c7adfba16969878cbdf9b72429d298ac9fa6a5ccda9d6c29605
|
7
|
+
data.tar.gz: 1b7e6f4b605d5f9ffefd312933048a9c9e0b17efea59eb09a6b215c2a117ec1ca275e18efbe640e991267d35d19b27b3c66dc4135b323dc9a8eb3c1be9b7f77b
|
data/CHANGELOG.md
CHANGED
@@ -2,6 +2,10 @@
|
|
2
2
|
All notable changes to this project will be documented in this file.
|
3
3
|
This project adheres to [Semantic Versioning](http://semver.org/).
|
4
4
|
|
5
|
+
## 0.1.3 - 2016-05-24
|
6
|
+
### Added
|
7
|
+
- Typesafe implementation of ModuleRelease#eql? (and ModuleRelease#==). (PUP-6341)
|
8
|
+
|
5
9
|
## 0.1.2 - 2016-04-29
|
6
10
|
### Added
|
7
11
|
- Typesafe implementation of Version#eql? (and Version#==). (PUP-6249)
|
data/lib/semantic_puppet.rb
CHANGED
@@ -38,6 +38,18 @@ module SemanticPuppet
|
|
38
38
|
return our_key <=> their_key
|
39
39
|
end
|
40
40
|
|
41
|
+
def eql?(other)
|
42
|
+
other.is_a?(ModuleRelease) &&
|
43
|
+
@name.eql?(other.name) &&
|
44
|
+
@version.eql?(other.version) &&
|
45
|
+
dependencies.eql?(other.dependencies)
|
46
|
+
end
|
47
|
+
alias == eql?
|
48
|
+
|
49
|
+
def hash
|
50
|
+
@name.hash ^ @version.hash
|
51
|
+
end
|
52
|
+
|
41
53
|
def to_s
|
42
54
|
"#<#{self.class} #{name}@#{version}>"
|
43
55
|
end
|
@@ -84,6 +84,29 @@ describe SemanticPuppet::Dependency::ModuleRelease do
|
|
84
84
|
|
85
85
|
end
|
86
86
|
|
87
|
+
describe '#==' do
|
88
|
+
|
89
|
+
it 'considers two equal releases to be equal' do
|
90
|
+
expect(make_release('foo', '1.0.0')).to eql(make_release('foo', '1.0.0'))
|
91
|
+
end
|
92
|
+
|
93
|
+
it 'considers two releases with different names to be different' do
|
94
|
+
expect(make_release('foo', '1.0.0')).not_to eql(make_release('bar', '1.0.0'))
|
95
|
+
end
|
96
|
+
|
97
|
+
it 'considers two releases with different versions to be different' do
|
98
|
+
expect(make_release('foo', '1.0.0')).not_to eql(make_release('foo', '1.0.1'))
|
99
|
+
end
|
100
|
+
|
101
|
+
it 'can compare a release with something that is not a release' do
|
102
|
+
expect { make_release('foo', '1.0.0') == 5 }.not_to raise_error
|
103
|
+
end
|
104
|
+
|
105
|
+
it 'considers a release different from something that is not a release' do
|
106
|
+
expect(make_release('foo', '1.0.0') == 5).to be false
|
107
|
+
end
|
108
|
+
end
|
109
|
+
|
87
110
|
describe '#satisfied?' do
|
88
111
|
|
89
112
|
it 'returns true when there are no dependencies to satisfy' do
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Puppet Labs
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-05-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rake
|