semantic_puppet 0.1.1 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +4 -0
- data/CHANGELOG.md +8 -0
- data/Gemfile +1 -18
- data/Rakefile +3 -14
- data/lib/semantic_puppet.rb +1 -1
- data/lib/semantic_puppet/version.rb +10 -0
- data/semantic_puppet.gemspec +1 -1
- data/spec/unit/semantic_puppet/version_spec.rb +41 -0
- metadata +22 -37
- data/Gemfile.lock +0 -38
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 54704ed0a044a253b6e9e09a0e229a508fd492f4
|
4
|
+
data.tar.gz: 043434851d0ff97c2fab49920b1b0dad5cfc569c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 984614759797d08caa5b0ad3495cf85e901ee2b8db19f9acd4de83f98cfc15bea89f1754bab3b67c8c0d0e83c2d31ae5c5803f6adf978de9eb6c8f06f0492706
|
7
|
+
data.tar.gz: a7a1f127e765f7f8f66cb0e174a2aaab314673bd8b8af3b0e1f632be6aaa15582f7d20537c06734968dc699a07862038d8ec8ed14172acba2784fd35d8dbe32b
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -2,9 +2,17 @@
|
|
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.2 - 2016-04-29
|
6
|
+
### Added
|
7
|
+
- Typesafe implementation of Version#eql? (and Version#==). (PUP-6249)
|
8
|
+
|
9
|
+
### Fixed
|
10
|
+
- Homepage URL in gemspec was incorrect. (fiddyspence)
|
11
|
+
|
5
12
|
## 0.1.1 - 2015-04-01
|
6
13
|
### Added
|
7
14
|
- license information
|
15
|
+
|
8
16
|
### Removed
|
9
17
|
- template entry from CHANGELOG.md
|
10
18
|
|
data/Gemfile
CHANGED
@@ -1,20 +1,3 @@
|
|
1
1
|
source "https://rubygems.org"
|
2
2
|
|
3
|
-
|
4
|
-
gem 'rake'
|
5
|
-
gem 'rubygems-tasks'
|
6
|
-
end
|
7
|
-
|
8
|
-
group :test do
|
9
|
-
gem 'rspec'
|
10
|
-
end
|
11
|
-
|
12
|
-
group :metrics do
|
13
|
-
gem 'cane', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
14
|
-
gem 'simplecov', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
15
|
-
end
|
16
|
-
|
17
|
-
group :doc do
|
18
|
-
gem 'yard', '~> 0.8', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
19
|
-
gem 'redcarpet', :platform => [ :mri_19, :mri_20, :mri_21 ]
|
20
|
-
end
|
3
|
+
gemspec
|
data/Rakefile
CHANGED
@@ -50,20 +50,9 @@ rescue LoadError
|
|
50
50
|
warn "[Warning]: Could not load `cane`."
|
51
51
|
end
|
52
52
|
|
53
|
-
#
|
53
|
+
# Bundler tasks
|
54
54
|
begin
|
55
|
-
require
|
56
|
-
|
57
|
-
task :gem => 'gem:build'
|
58
|
-
task :validate => [ 'cane', 'doc', 'gem:validate' ]
|
59
|
-
|
60
|
-
namespace :gem do
|
61
|
-
Gem::Tasks.new(
|
62
|
-
:tag => { :format => 'v%s' },
|
63
|
-
:sign => { :checksum => true, :pgp => true },
|
64
|
-
:build => { :tar => true }
|
65
|
-
)
|
66
|
-
end
|
55
|
+
require "bundler/gem_tasks"
|
67
56
|
rescue LoadError
|
68
|
-
warn "[Warning]: Could not load `
|
57
|
+
warn "[Warning]: Could not load `bundler/gem_tasks`."
|
69
58
|
end
|
data/lib/semantic_puppet.rb
CHANGED
@@ -115,6 +115,16 @@ module SemanticPuppet
|
|
115
115
|
return compare_prerelease(other)
|
116
116
|
end
|
117
117
|
|
118
|
+
def eql?(other)
|
119
|
+
other.is_a?(Version) &&
|
120
|
+
@major.eql?(other.major) &&
|
121
|
+
@minor.eql?(other.minor) &&
|
122
|
+
@patch.eql?(other.patch) &&
|
123
|
+
@prerelease.eql?(other.instance_variable_get(:@prerelease)) &&
|
124
|
+
@build.eql?(other.instance_variable_get(:@build))
|
125
|
+
end
|
126
|
+
alias == eql?
|
127
|
+
|
118
128
|
def to_s
|
119
129
|
"#{major}.#{minor}.#{patch}" +
|
120
130
|
(@prerelease.nil? || prerelease.empty? ? '' : "-" + prerelease) +
|
data/semantic_puppet.gemspec
CHANGED
@@ -8,7 +8,7 @@ spec = Gem::Specification.new do |s|
|
|
8
8
|
s.version = SemanticPuppet::VERSION
|
9
9
|
s.authors = ["Puppet Labs"]
|
10
10
|
s.email = ["info@puppetlabs.com"]
|
11
|
-
s.homepage = "https://github.com/puppetlabs/semantic_puppet
|
11
|
+
s.homepage = "https://github.com/puppetlabs/semantic_puppet"
|
12
12
|
s.summary = "Useful tools for working with Semantic Versions."
|
13
13
|
s.description = %q{Tools used by Puppet to parse, validate, and compare Semantic Versions and Version Ranges and to query and resolve module dependencies.}
|
14
14
|
s.licenses = ['Apache-2.0']
|
@@ -411,6 +411,47 @@ describe SemanticPuppet::Version do
|
|
411
411
|
end
|
412
412
|
end
|
413
413
|
|
414
|
+
describe '#==' do
|
415
|
+
def parse(vstring)
|
416
|
+
SemanticPuppet::Version.parse(vstring)
|
417
|
+
end
|
418
|
+
|
419
|
+
it 'should yield true when comparing two equal instances' do
|
420
|
+
x = parse('1.2.3-alpha')
|
421
|
+
y = parse('1.2.3-alpha')
|
422
|
+
expect(x == y).to eql(true)
|
423
|
+
end
|
424
|
+
|
425
|
+
it 'should yield false when the major differs' do
|
426
|
+
x = parse('1.2.3-alpha')
|
427
|
+
y = parse('2.2.3-alpha')
|
428
|
+
expect(x == y).to eql(false)
|
429
|
+
end
|
430
|
+
|
431
|
+
it 'should yield false when the minor differs' do
|
432
|
+
x = parse('1.2.3-alpha')
|
433
|
+
y = parse('1.3.3-alpha')
|
434
|
+
expect(x == y).to eql(false)
|
435
|
+
end
|
436
|
+
|
437
|
+
it 'should yield false when the patch differs' do
|
438
|
+
x = parse('1.2.3-alpha')
|
439
|
+
y = parse('1.2.4-alpha')
|
440
|
+
expect(x == y).to eql(false)
|
441
|
+
end
|
442
|
+
|
443
|
+
it 'should yield false when the prerelease differs' do
|
444
|
+
x = parse('1.2.3-alpha')
|
445
|
+
y = parse('1.2.3-beta')
|
446
|
+
expect(x == y).to eql(false)
|
447
|
+
end
|
448
|
+
|
449
|
+
it 'should yield false when compared to something that is not a Version' do
|
450
|
+
x = parse('1.2.3-alpha')
|
451
|
+
expect(x == :undef).to eql(false)
|
452
|
+
end
|
453
|
+
end
|
454
|
+
|
414
455
|
describe '#<=>' do
|
415
456
|
def parse(vstring)
|
416
457
|
SemanticPuppet::Version.parse(vstring)
|
metadata
CHANGED
@@ -1,110 +1,97 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: semantic_puppet
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
5
|
-
prerelease:
|
4
|
+
version: 0.1.2
|
6
5
|
platform: ruby
|
7
6
|
authors:
|
8
7
|
- Puppet Labs
|
9
8
|
autorequire:
|
10
9
|
bindir: bin
|
11
10
|
cert_chain: []
|
12
|
-
date:
|
11
|
+
date: 2016-04-29 00:00:00.000000000 Z
|
13
12
|
dependencies:
|
14
13
|
- !ruby/object:Gem::Dependency
|
15
14
|
name: rake
|
16
15
|
requirement: !ruby/object:Gem::Requirement
|
17
|
-
none: false
|
18
16
|
requirements:
|
19
|
-
- -
|
17
|
+
- - ">="
|
20
18
|
- !ruby/object:Gem::Version
|
21
19
|
version: '0'
|
22
20
|
type: :development
|
23
21
|
prerelease: false
|
24
22
|
version_requirements: !ruby/object:Gem::Requirement
|
25
|
-
none: false
|
26
23
|
requirements:
|
27
|
-
- -
|
24
|
+
- - ">="
|
28
25
|
- !ruby/object:Gem::Version
|
29
26
|
version: '0'
|
30
27
|
- !ruby/object:Gem::Dependency
|
31
28
|
name: rspec
|
32
29
|
requirement: !ruby/object:Gem::Requirement
|
33
|
-
none: false
|
34
30
|
requirements:
|
35
|
-
- -
|
31
|
+
- - ">="
|
36
32
|
- !ruby/object:Gem::Version
|
37
33
|
version: '0'
|
38
34
|
type: :development
|
39
35
|
prerelease: false
|
40
36
|
version_requirements: !ruby/object:Gem::Requirement
|
41
|
-
none: false
|
42
37
|
requirements:
|
43
|
-
- -
|
38
|
+
- - ">="
|
44
39
|
- !ruby/object:Gem::Version
|
45
40
|
version: '0'
|
46
41
|
- !ruby/object:Gem::Dependency
|
47
42
|
name: simplecov
|
48
43
|
requirement: !ruby/object:Gem::Requirement
|
49
|
-
none: false
|
50
44
|
requirements:
|
51
|
-
- -
|
45
|
+
- - ">="
|
52
46
|
- !ruby/object:Gem::Version
|
53
47
|
version: '0'
|
54
48
|
type: :development
|
55
49
|
prerelease: false
|
56
50
|
version_requirements: !ruby/object:Gem::Requirement
|
57
|
-
none: false
|
58
51
|
requirements:
|
59
|
-
- -
|
52
|
+
- - ">="
|
60
53
|
- !ruby/object:Gem::Version
|
61
54
|
version: '0'
|
62
55
|
- !ruby/object:Gem::Dependency
|
63
56
|
name: cane
|
64
57
|
requirement: !ruby/object:Gem::Requirement
|
65
|
-
none: false
|
66
58
|
requirements:
|
67
|
-
- -
|
59
|
+
- - ">="
|
68
60
|
- !ruby/object:Gem::Version
|
69
61
|
version: '0'
|
70
62
|
type: :development
|
71
63
|
prerelease: false
|
72
64
|
version_requirements: !ruby/object:Gem::Requirement
|
73
|
-
none: false
|
74
65
|
requirements:
|
75
|
-
- -
|
66
|
+
- - ">="
|
76
67
|
- !ruby/object:Gem::Version
|
77
68
|
version: '0'
|
78
69
|
- !ruby/object:Gem::Dependency
|
79
70
|
name: yard
|
80
71
|
requirement: !ruby/object:Gem::Requirement
|
81
|
-
none: false
|
82
72
|
requirements:
|
83
|
-
- -
|
73
|
+
- - ">="
|
84
74
|
- !ruby/object:Gem::Version
|
85
75
|
version: '0'
|
86
76
|
type: :development
|
87
77
|
prerelease: false
|
88
78
|
version_requirements: !ruby/object:Gem::Requirement
|
89
|
-
none: false
|
90
79
|
requirements:
|
91
|
-
- -
|
80
|
+
- - ">="
|
92
81
|
- !ruby/object:Gem::Version
|
93
82
|
version: '0'
|
94
83
|
- !ruby/object:Gem::Dependency
|
95
84
|
name: redcarpet
|
96
85
|
requirement: !ruby/object:Gem::Requirement
|
97
|
-
none: false
|
98
86
|
requirements:
|
99
|
-
- -
|
87
|
+
- - ">="
|
100
88
|
- !ruby/object:Gem::Version
|
101
89
|
version: '0'
|
102
90
|
type: :development
|
103
91
|
prerelease: false
|
104
92
|
version_requirements: !ruby/object:Gem::Requirement
|
105
|
-
none: false
|
106
93
|
requirements:
|
107
|
-
- -
|
94
|
+
- - ">="
|
108
95
|
- !ruby/object:Gem::Version
|
109
96
|
version: '0'
|
110
97
|
description: Tools used by Puppet to parse, validate, and compare Semantic Versions
|
@@ -115,11 +102,10 @@ executables: []
|
|
115
102
|
extensions: []
|
116
103
|
extra_rdoc_files: []
|
117
104
|
files:
|
118
|
-
- .gitignore
|
119
|
-
- .yardopts
|
105
|
+
- ".gitignore"
|
106
|
+
- ".yardopts"
|
120
107
|
- CHANGELOG.md
|
121
108
|
- Gemfile
|
122
|
-
- Gemfile.lock
|
123
109
|
- LICENSE
|
124
110
|
- README.md
|
125
111
|
- Rakefile
|
@@ -142,30 +128,29 @@ files:
|
|
142
128
|
- spec/unit/semantic_puppet/dependency_spec.rb
|
143
129
|
- spec/unit/semantic_puppet/version_range_spec.rb
|
144
130
|
- spec/unit/semantic_puppet/version_spec.rb
|
145
|
-
homepage: https://github.com/puppetlabs/semantic_puppet
|
131
|
+
homepage: https://github.com/puppetlabs/semantic_puppet
|
146
132
|
licenses:
|
147
133
|
- Apache-2.0
|
134
|
+
metadata: {}
|
148
135
|
post_install_message:
|
149
136
|
rdoc_options: []
|
150
137
|
require_paths:
|
151
138
|
- lib
|
152
139
|
required_ruby_version: !ruby/object:Gem::Requirement
|
153
|
-
none: false
|
154
140
|
requirements:
|
155
|
-
- -
|
141
|
+
- - ">="
|
156
142
|
- !ruby/object:Gem::Version
|
157
143
|
version: 1.8.7
|
158
144
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
159
|
-
none: false
|
160
145
|
requirements:
|
161
|
-
- -
|
146
|
+
- - ">="
|
162
147
|
- !ruby/object:Gem::Version
|
163
148
|
version: '0'
|
164
149
|
requirements: []
|
165
150
|
rubyforge_project:
|
166
|
-
rubygems_version:
|
151
|
+
rubygems_version: 2.4.5.1
|
167
152
|
signing_key:
|
168
|
-
specification_version:
|
153
|
+
specification_version: 4
|
169
154
|
summary: Useful tools for working with Semantic Versions.
|
170
155
|
test_files: []
|
171
156
|
has_rdoc:
|
data/Gemfile.lock
DELETED
@@ -1,38 +0,0 @@
|
|
1
|
-
GEM
|
2
|
-
remote: https://rubygems.org/
|
3
|
-
specs:
|
4
|
-
cane (2.6.1)
|
5
|
-
parallel
|
6
|
-
diff-lcs (1.2.5)
|
7
|
-
docile (1.1.1)
|
8
|
-
multi_json (1.8.2)
|
9
|
-
parallel (0.9.1)
|
10
|
-
rake (10.1.0)
|
11
|
-
redcarpet (3.0.0)
|
12
|
-
rspec (2.14.1)
|
13
|
-
rspec-core (~> 2.14.0)
|
14
|
-
rspec-expectations (~> 2.14.0)
|
15
|
-
rspec-mocks (~> 2.14.0)
|
16
|
-
rspec-core (2.14.7)
|
17
|
-
rspec-expectations (2.14.4)
|
18
|
-
diff-lcs (>= 1.1.3, < 2.0)
|
19
|
-
rspec-mocks (2.14.4)
|
20
|
-
rubygems-tasks (0.2.4)
|
21
|
-
simplecov (0.8.2)
|
22
|
-
docile (~> 1.1.0)
|
23
|
-
multi_json
|
24
|
-
simplecov-html (~> 0.8.0)
|
25
|
-
simplecov-html (0.8.0)
|
26
|
-
yard (0.8.7.3)
|
27
|
-
|
28
|
-
PLATFORMS
|
29
|
-
ruby
|
30
|
-
|
31
|
-
DEPENDENCIES
|
32
|
-
cane
|
33
|
-
rake
|
34
|
-
redcarpet
|
35
|
-
rspec
|
36
|
-
rubygems-tasks
|
37
|
-
simplecov
|
38
|
-
yard (~> 0.8)
|