versionomy 0.2.0 → 0.2.1
Sign up to get free protection for your applications and to get access to all the features.
- data/History.rdoc +6 -0
- data/README.rdoc +3 -1
- data/Rakefile +1 -1
- data/lib/versionomy/interface.rb +24 -0
- data/lib/versionomy/version.rb +1 -5
- data/lib/versionomy.rb +1 -6
- data/tests/tc_custom_format.rb +1 -0
- data/tests/tc_readme_examples.rb +1 -0
- data/tests/tc_rubygems_basic.rb +1 -0
- data/tests/tc_rubygems_conversions.rb +1 -0
- data/tests/tc_standard_basic.rb +1 -0
- data/tests/tc_standard_bump.rb +1 -0
- data/tests/tc_standard_change.rb +1 -0
- data/tests/tc_standard_comparison.rb +1 -0
- data/tests/tc_standard_misc.rb +1 -0
- data/tests/tc_standard_parse.rb +1 -0
- metadata +3 -3
data/History.rdoc
CHANGED
@@ -1,3 +1,9 @@
|
|
1
|
+
=== 0.2.1 / 2009-11-08
|
2
|
+
|
3
|
+
* Added Versionomy#version_of.
|
4
|
+
* Now lets Blockenspiel set its own VERSION instead of reaching into
|
5
|
+
Blockenspiel's namespace.
|
6
|
+
|
1
7
|
=== 0.2.0 / 2009-11-05
|
2
8
|
|
3
9
|
* API CHANGE: Slight change to value comparison semantics. Value#eql? returns true only if the schemas are the same, whereas Value#== and the greater than and less than comparisons attempt to compare the semantic value, and thus may perform automatic schema conversion on the RHS.
|
data/README.rdoc
CHANGED
@@ -138,7 +138,7 @@ provides a schema and formatter/parser matching Gem::Version.
|
|
138
138
|
|
139
139
|
* Ruby 1.8.6 or later (1.8.7 recommended), Ruby 1.9.1 or later, or JRuby
|
140
140
|
1.4 or later.
|
141
|
-
* blockenspiel 0.3 or later.
|
141
|
+
* blockenspiel 0.3.1 or later.
|
142
142
|
|
143
143
|
=== Installation
|
144
144
|
|
@@ -149,6 +149,8 @@ provides a schema and formatter/parser matching Gem::Version.
|
|
149
149
|
* Test coverage is still a little skimpy. It is focused on the "standard"
|
150
150
|
version number format and schema, but doesn't fully exercise all the
|
151
151
|
capabilities of custom formats.
|
152
|
+
* The standard format parser requires that "prerelease" versions have a
|
153
|
+
prerelease number. e.g. it accepts "1.9.2dev1" but not "1.9.2dev".
|
152
154
|
|
153
155
|
=== Development and support
|
154
156
|
|
data/Rakefile
CHANGED
@@ -89,7 +89,7 @@ gemspec_ = Gem::Specification.new do |s_|
|
|
89
89
|
s_.has_rdoc = true
|
90
90
|
s_.test_files = FileList['tests/tc_*.rb']
|
91
91
|
s_.platform = Gem::Platform::RUBY
|
92
|
-
s_.add_dependency('blockenspiel', '>= 0.3.
|
92
|
+
s_.add_dependency('blockenspiel', '>= 0.3.1')
|
93
93
|
end
|
94
94
|
Rake::GemPackageTask.new(gemspec_) do |task_|
|
95
95
|
task_.need_zip = false
|
data/lib/versionomy/interface.rb
CHANGED
@@ -130,6 +130,30 @@ module Versionomy
|
|
130
130
|
format_.parse(str_, parse_params_)
|
131
131
|
end
|
132
132
|
|
133
|
+
|
134
|
+
# Get the version of the given module as a Versionomy::Value.
|
135
|
+
# Attempts to find the version by querying the constants VERSION and
|
136
|
+
# VERSION_STRING. If a string is found, an attempt is made to parse it.
|
137
|
+
# Returns the version number, or nil if it wasn't found or wasn't
|
138
|
+
# parseable.
|
139
|
+
|
140
|
+
def version_of(mod_)
|
141
|
+
if mod_.const_defined?(:VERSION)
|
142
|
+
version_ = mod_.const_get(:VERSION)
|
143
|
+
elsif mod_.const_defined?(:VERSION_STRING)
|
144
|
+
version_ = mod_.const_get(:VERSION_STRING)
|
145
|
+
else
|
146
|
+
version_ = nil
|
147
|
+
end
|
148
|
+
if version_.kind_of?(::String)
|
149
|
+
version_ = parse(version_, :standard) rescue nil
|
150
|
+
elsif !version_.kind_of?(Value)
|
151
|
+
version_ = nil
|
152
|
+
end
|
153
|
+
version_
|
154
|
+
end
|
155
|
+
|
156
|
+
|
133
157
|
end
|
134
158
|
|
135
159
|
end
|
data/lib/versionomy/version.rb
CHANGED
@@ -37,13 +37,9 @@
|
|
37
37
|
module Versionomy
|
38
38
|
|
39
39
|
# Current gem version, as a frozen string.
|
40
|
-
VERSION_STRING = '0.2.
|
40
|
+
VERSION_STRING = '0.2.1'.freeze
|
41
41
|
|
42
42
|
# Current gem version, as a Versionomy::Value.
|
43
43
|
VERSION = ::Versionomy.parse(VERSION_STRING, :standard)
|
44
44
|
|
45
45
|
end
|
46
|
-
|
47
|
-
|
48
|
-
::Blockenspiel.const_set(:VERSION,
|
49
|
-
::Versionomy.parse(::Blockenspiel::VERSION_STRING, :standard))
|
data/lib/versionomy.rb
CHANGED
data/tests/tc_custom_format.rb
CHANGED
data/tests/tc_readme_examples.rb
CHANGED
data/tests/tc_rubygems_basic.rb
CHANGED
data/tests/tc_standard_basic.rb
CHANGED
data/tests/tc_standard_bump.rb
CHANGED
data/tests/tc_standard_change.rb
CHANGED
data/tests/tc_standard_misc.rb
CHANGED
data/tests/tc_standard_parse.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: versionomy
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Daniel Azuma
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-11-
|
12
|
+
date: 2009-11-08 00:00:00 -08:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
@@ -20,7 +20,7 @@ dependencies:
|
|
20
20
|
requirements:
|
21
21
|
- - ">="
|
22
22
|
- !ruby/object:Gem::Version
|
23
|
-
version: 0.3.
|
23
|
+
version: 0.3.1
|
24
24
|
version:
|
25
25
|
description: Versionomy is a generalized version number library. It provides tools to represent, manipulate, parse, and compare version numbers in the wide variety of versioning schemes in use.
|
26
26
|
email: dazuma@gmail.com
|