semantic 1.4.0 → 1.4.1

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: 8c17513515b4ea394b9402cb707245c00a07590a
4
- data.tar.gz: 884b649d9f02d0fc203081dcf863cddd61037ed7
3
+ metadata.gz: 3d064086ebe8f746d56e7f03e1897210d3ffbebd
4
+ data.tar.gz: d3ca4b76c52dc700d6ffeec7a0fe2feda43d4e73
5
5
  SHA512:
6
- metadata.gz: b81b25d151711e3465f512c241279e1dbebf9442c1b37601a04f5f97d91602168460b47fdbc1fd523c0f4a28d4ed0c1100fb98d66545188a3bc4e61fcdc3e811
7
- data.tar.gz: b51033a0d6a106fdc7f42bfb3bf0e82a539043467124d209024f0b4a260eb16b96e940dd57084ebd253fc3fdc74fc10d63956e9de6f658bc204bcbcc4963437e
6
+ metadata.gz: be0225ee57be527639197377e7f97872166f5fb34d931d2fd56044fbb390c180e26116f266f94f61603e89bb76d94380242bb2998125ab80b913036a92e1f4d9
7
+ data.tar.gz: 53a92041fd0d46b7820c86156524d09693fa992c55826d040b1876b132851c1f47e4e639f87f13f4a580b74a89fceeb64ab701a542437fbd817e004217e68d3d
data/README.md CHANGED
@@ -1,5 +1,6 @@
1
1
  Semantic
2
2
  ========
3
+ [![BuildStatus](https://travis-ci.org/jlindsey/semantic.svg?branch=master)](https://travis-ci.org/jlindsey/semantic)
3
4
 
4
5
  A small Ruby utility class to aid in the storage, parsing, and comparison of SemVer-style Version strings.
5
6
 
@@ -1,5 +1,5 @@
1
1
  module Semantic
2
- GEM_VERSION = '1.4.0'
2
+ GEM_VERSION = '1.4.1'
3
3
  autoload :Version, 'semantic/version'
4
4
  end
5
5
 
@@ -20,6 +20,10 @@ module Semantic
20
20
  @major, @minor, @patch = version.split('.').map(&:to_i)
21
21
  end
22
22
 
23
+ def build=(b)
24
+ @build = (!b.nil? && b.empty?) ? nil : b
25
+ end
26
+
23
27
  def to_a
24
28
  [@major, @minor, @patch, @pre, @build]
25
29
  end
@@ -64,6 +64,18 @@ describe Semantic::Version do
64
64
  v4.pre.should be_nil
65
65
  v4.build.should == 'hello'
66
66
  end
67
+
68
+ it "provides round-trip fidelity for an empty build parameter" do
69
+ v = Semantic::Version.new("1.2.3")
70
+ v.build = ""
71
+ expect(Semantic::Version.new(v.to_s).build).to eq(v.build)
72
+ end
73
+
74
+ it "provides round-trip fidelity for a nil build parameter" do
75
+ v = Semantic::Version.new("1.2.3+build")
76
+ v.build = nil
77
+ expect(Semantic::Version.new(v.to_s).build).to eq(v.build)
78
+ end
67
79
  end
68
80
 
69
81
  context "comparisons" do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semantic
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.0
4
+ version: 1.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Josh Lindsey
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-01-27 00:00:00.000000000 Z
11
+ date: 2015-04-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.2.2
77
+ rubygems_version: 2.4.6
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Semantic Version utility class