semver2 3.3.3 → 3.4.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (6) hide show
  1. checksums.yaml +7 -0
  2. data/.semver +2 -2
  3. data/README.md +7 -2
  4. data/lib/xsemver.rb +21 -0
  5. data/semver2.gemspec +2 -1
  6. metadata +21 -11
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: c28524c4819de26e6ef57047028c223bfea23c6d
4
+ data.tar.gz: bfe233cbd6a4c2668c293640a42aebd050195d8f
5
+ SHA512:
6
+ metadata.gz: 6178a04c20663f0fe8ad349cc6e3cb23b383626326d9f8aa6418bfe91948a0fc28c05f53d918d46b20500ed48f4e25a64a19d83838c825c9e952a65399bf39ba
7
+ data.tar.gz: 290c1bfefbb25d594d804f1a2c919cea1b0b4a687fcf603334525d34d4bec58688a65911bbe659b60ae26e063a3e1696a7e2efbcf65b984d826bad4c603de8c2
data/.semver CHANGED
@@ -1,6 +1,6 @@
1
1
  ---
2
2
  :major: 3
3
- :minor: 3
4
- :patch: 3
3
+ :minor: 4
4
+ :patch: 0
5
5
  :special: ''
6
6
  :metadata: ''
data/README.md CHANGED
@@ -1,11 +1,11 @@
1
- SemVer2 3.3.x gem, following semver.org 2.0.0-rc.2
1
+ SemVer2 3.4.x gem, following semver.org 2.0.0
2
2
  ======
3
3
 
4
4
  quickstart on the command line
5
5
  ------------------------------
6
6
  install it
7
7
 
8
- % gem install semver
8
+ % gem install semver2
9
9
 
10
10
  use it
11
11
 
@@ -39,6 +39,11 @@ quickstart for ruby
39
39
  v.to_s # => "v1.1.0-alpha.46+md5.abc123"
40
40
  v.save
41
41
 
42
+ parsing in ruby
43
+ ---------------
44
+
45
+ require 'semver'
46
+ v = SemVer.parse 'v1.2.3-rc56
42
47
 
43
48
  git integration
44
49
  ---------------
@@ -143,6 +143,27 @@ module XSemVer
143
143
  SemVer.new major, minor, patch, special, metadata
144
144
  end
145
145
  end
146
+
147
+ # Parses a rubygems string, such as 'v2.0.5.rc.3' or '2.0.5.rc.3' to 'v2.0.5-rc.3'
148
+ def self.parse_rubygems version_string
149
+ if /v?(?<major>\d+)
150
+ (\.(?<minor>\d+)
151
+ (\.(?<patch>\d+)
152
+ (\.(?<pre>[A-Za-z]+\.[0-9A-Za-z]+)
153
+ )?)?)?
154
+ /x =~ version_string
155
+
156
+ major = major.to_i
157
+ minor = minor.to_i if minor
158
+ minor ||= 0
159
+ patch = patch.to_i if patch
160
+ patch ||= 0
161
+ pre ||= ''
162
+ SemVer.new major, minor, patch, pre, ''
163
+ else
164
+ SemVer.new
165
+ end
166
+ end
146
167
 
147
168
  # SemVer specification 2.0.0-rc2 states that anything after the '-' character is prerelease data.
148
169
  # To be consistent with the specification verbage, #prerelease returns the same value as #special.
@@ -12,5 +12,6 @@ Gem::Specification.new do |spec|
12
12
  spec.executables << 'semver'
13
13
  spec.files = [".semver", "semver2.gemspec", "README.md"] + Dir["lib/**/*.rb"] + Dir['bin/*']
14
14
  spec.has_rdoc = true
15
- spec.add_development_dependency 'rspec', '~>2.12.0'
15
+ spec.add_development_dependency 'rake', '~> 10'
16
+ spec.add_development_dependency 'rspec', '~> 2.12.0'
16
17
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semver2
3
3
  version: !ruby/object:Gem::Version
4
- version: 3.3.3
5
- prerelease:
4
+ version: 3.4.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Francesco Lazzarino
@@ -11,12 +10,25 @@ authors:
11
10
  autorequire:
12
11
  bindir: bin
13
12
  cert_chain: []
14
- date: 2013-12-17 00:00:00.000000000 Z
13
+ date: 2014-07-31 00:00:00.000000000 Z
15
14
  dependencies:
15
+ - !ruby/object:Gem::Dependency
16
+ name: rake
17
+ requirement: !ruby/object:Gem::Requirement
18
+ requirements:
19
+ - - ~>
20
+ - !ruby/object:Gem::Version
21
+ version: '10'
22
+ type: :development
23
+ prerelease: false
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ~>
27
+ - !ruby/object:Gem::Version
28
+ version: '10'
16
29
  - !ruby/object:Gem::Dependency
17
30
  name: rspec
18
31
  requirement: !ruby/object:Gem::Requirement
19
- none: false
20
32
  requirements:
21
33
  - - ~>
22
34
  - !ruby/object:Gem::Version
@@ -24,7 +36,6 @@ dependencies:
24
36
  type: :development
25
37
  prerelease: false
26
38
  version_requirements: !ruby/object:Gem::Requirement
27
- none: false
28
39
  requirements:
29
40
  - - ~>
30
41
  - !ruby/object:Gem::Version
@@ -48,26 +59,25 @@ files:
48
59
  - bin/semver
49
60
  homepage: https://github.com/haf/semver
50
61
  licenses: []
62
+ metadata: {}
51
63
  post_install_message:
52
64
  rdoc_options: []
53
65
  require_paths:
54
66
  - lib
55
67
  required_ruby_version: !ruby/object:Gem::Requirement
56
- none: false
57
68
  requirements:
58
- - - ! '>='
69
+ - - '>='
59
70
  - !ruby/object:Gem::Version
60
71
  version: '0'
61
72
  required_rubygems_version: !ruby/object:Gem::Requirement
62
- none: false
63
73
  requirements:
64
- - - ! '>='
74
+ - - '>='
65
75
  - !ruby/object:Gem::Version
66
76
  version: '0'
67
77
  requirements: []
68
78
  rubyforge_project:
69
- rubygems_version: 1.8.23
79
+ rubygems_version: 2.0.14
70
80
  signing_key:
71
- specification_version: 3
81
+ specification_version: 4
72
82
  summary: Semantic Versioning
73
83
  test_files: []