sleeping_king_studios-tools 0.1.1 → 0.1.2

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: 219097e26ec6aeccbe9e62d239cf93e987807cd5
4
- data.tar.gz: 3a216492307ed761a30bd827e6798318483fe81e
3
+ metadata.gz: d95961cf9c0f704e80358834b1f45de5e3cc2e93
4
+ data.tar.gz: 91bd9c25c66c817eb25b43c74218512848de860a
5
5
  SHA512:
6
- metadata.gz: 5c9b6cfb2b0d45f7f93b22fa47a589b2428983520a4c9f87afd2d5498b15ba629ad8c34d9eae9e2b1abb8db3eca342b9795b53fdf3dfd0655c6151220c6b7e62
7
- data.tar.gz: bd52cc9727fb36e02686f3c23428439b645a946d405962e2c7e3eae7c14c85fdfc6d4e8af5ad4a17969c895ba3c11178e1af3ec4846ee00e5f41a8117806cff2
6
+ metadata.gz: b9801022cb106352a814ac6fe87a17a498b0be4fad587c995758942d3697666daff0c5c66defe842a6f912f781bdcc5d8c3b4f4c603ca2819da3ffb1288d5748
7
+ data.tar.gz: eb48ea7b3c4a1afa3a09c4f9497e63deec32a98bcebbbbb177914f2f6ce3086dd8fd593a8fe3ae65cc77804552294cac40decedabe1ff458a45373fda54c12d5
data/CHANGELOG.md ADDED
@@ -0,0 +1,15 @@
1
+ # Changelog
2
+
3
+ ## Pre-release Versions
4
+
5
+ ### 0.1.2
6
+
7
+ Fix loading order issues when loading SemanticVersion in isolation.
8
+
9
+ ### 0.1.1
10
+
11
+ Add configuration options to EnumerableTools#humanize_list.
12
+
13
+ ### 0.1.0
14
+
15
+ Initial release.
@@ -1,36 +1,9 @@
1
1
  # lib/sleeping_king_studios/tools/semantic_version.rb
2
2
 
3
- require 'sleeping_king_studios/tools'
4
-
5
- module SleepingKingStudios::Tools
6
- # Helper for generating semantic version strings with optional prerelease and
7
- # build parameters.
8
- #
9
- # @example
10
- # module Version
11
- # extend SleepingKingStudios::Tools::SemanticVersion
12
- #
13
- # MAJOR = 3
14
- # MINOR = 1
15
- # PATCH = 4
16
- # PRERELEASE = 'beta'
17
- # BUILD = 1
18
- # end # module
19
- #
20
- # VERSION = Version.to_gem_version
21
- #
22
- # @see http://semver.org
23
- module SemanticVersion
24
- # @api private
25
- FETCH_DEFAULT = Object.new.freeze
26
-
27
- # Error class for handling missing constants in a version definition.
28
- class InvalidVersionError < StandardError; end
29
-
30
- # Concatenates the MAJOR, MINOR, and PATCH constant values with PRERELEASE
31
- # and BUILD (if available) to generate a modified semantic version string
32
- # compatible with Rubygems. The major, minor, patch, prerelease, and build
33
- # values (if available) are separated by dots (.).
3
+ module SleepingKingStudios
4
+ module Tools
5
+ # Helper for generating semantic version strings with optional prerelease and
6
+ # build parameters.
34
7
  #
35
8
  # @example
36
9
  # module Version
@@ -44,66 +17,93 @@ module SleepingKingStudios::Tools
44
17
  # end # module
45
18
  #
46
19
  # VERSION = Version.to_gem_version
47
- # #=> '3.1.4.beta.1'
48
20
  #
49
- # @return [String] The modified semantic version string.
50
- #
51
- # @raise InvalidVersionError If MAJOR, MINOR, or PATCH is undefined.
52
- def to_gem_version
53
- str = "#{const_fetch :MAJOR}.#{const_fetch :MINOR}.#{const_fetch :PATCH}"
21
+ # @see http://semver.org
22
+ module SemanticVersion
23
+ # @api private
24
+ FETCH_DEFAULT = Object.new.freeze
54
25
 
55
- prerelease = const_fetch(:PRERELEASE, nil)
56
- str << ".#{prerelease}" unless prerelease.nil? || prerelease.empty?
26
+ # Error class for handling missing constants in a version definition.
27
+ class InvalidVersionError < StandardError; end
57
28
 
58
- build = const_fetch(:BUILD, nil)
59
- str << ".#{build}" unless build.nil? || build.empty?
29
+ # Concatenates the MAJOR, MINOR, and PATCH constant values with PRERELEASE
30
+ # and BUILD (if available) to generate a modified semantic version string
31
+ # compatible with Rubygems. The major, minor, patch, prerelease, and build
32
+ # values (if available) are separated by dots (.).
33
+ #
34
+ # @example
35
+ # module Version
36
+ # extend SleepingKingStudios::Tools::SemanticVersion
37
+ #
38
+ # MAJOR = 3
39
+ # MINOR = 1
40
+ # PATCH = 4
41
+ # PRERELEASE = 'beta'
42
+ # BUILD = 1
43
+ # end # module
44
+ #
45
+ # VERSION = Version.to_gem_version
46
+ # #=> '3.1.4.beta.1'
47
+ #
48
+ # @return [String] The modified semantic version string.
49
+ #
50
+ # @raise InvalidVersionError If MAJOR, MINOR, or PATCH is undefined.
51
+ def to_gem_version
52
+ str = "#{const_fetch :MAJOR}.#{const_fetch :MINOR}.#{const_fetch :PATCH}"
60
53
 
61
- str
62
- end # method to_version
54
+ prerelease = const_fetch(:PRERELEASE, nil)
55
+ str << ".#{prerelease}" unless prerelease.nil? || prerelease.empty?
63
56
 
64
- # Concatenates the MAJOR, MINOR, and PATCH constant values with PRERELEASE
65
- # and BUILD (if available) to generate a semantic version string. The
66
- # major, minor, and patch values are separated by dots (.), then the
67
- # prerelease (if available) preceded by a hyphen (-), and the build (if
68
- # available) preceded by a plus (+).
69
- #
70
- # @example
71
- # module Version
72
- # extend SleepingKingStudios::Tools::SemanticVersion
73
- #
74
- # MAJOR = 3
75
- # MINOR = 1
76
- # PATCH = 4
77
- # PRERELEASE = 'beta'
78
- # BUILD = 1
79
- # end # module
80
- #
81
- # VERSION = Version.to_version
82
- # #=> '3.1.4-beta+1'
83
- #
84
- # @return [String] The semantic version string.
85
- #
86
- # @raise InvalidVersionError If MAJOR, MINOR, or PATCH is undefined.
87
- def to_version
88
- str = "#{const_fetch :MAJOR}.#{const_fetch :MINOR}.#{const_fetch :PATCH}"
57
+ build = const_fetch(:BUILD, nil)
58
+ str << ".#{build}" unless build.nil? || build.empty?
59
+
60
+ str
61
+ end # method to_version
62
+
63
+ # Concatenates the MAJOR, MINOR, and PATCH constant values with PRERELEASE
64
+ # and BUILD (if available) to generate a semantic version string. The
65
+ # major, minor, and patch values are separated by dots (.), then the
66
+ # prerelease (if available) preceded by a hyphen (-), and the build (if
67
+ # available) preceded by a plus (+).
68
+ #
69
+ # @example
70
+ # module Version
71
+ # extend SleepingKingStudios::Tools::SemanticVersion
72
+ #
73
+ # MAJOR = 3
74
+ # MINOR = 1
75
+ # PATCH = 4
76
+ # PRERELEASE = 'beta'
77
+ # BUILD = 1
78
+ # end # module
79
+ #
80
+ # VERSION = Version.to_version
81
+ # #=> '3.1.4-beta+1'
82
+ #
83
+ # @return [String] The semantic version string.
84
+ #
85
+ # @raise InvalidVersionError If MAJOR, MINOR, or PATCH is undefined.
86
+ def to_version
87
+ str = "#{const_fetch :MAJOR}.#{const_fetch :MINOR}.#{const_fetch :PATCH}"
89
88
 
90
- prerelease = const_fetch(:PRERELEASE, nil)
91
- str << "-#{prerelease}" unless prerelease.nil? || prerelease.empty?
89
+ prerelease = const_fetch(:PRERELEASE, nil)
90
+ str << "-#{prerelease}" unless prerelease.nil? || prerelease.empty?
92
91
 
93
- build = const_fetch(:BUILD, nil)
94
- str << "+#{build}" unless build.nil? || build.empty?
92
+ build = const_fetch(:BUILD, nil)
93
+ str << "+#{build}" unless build.nil? || build.empty?
95
94
 
96
- str
97
- end # method to_version
95
+ str
96
+ end # method to_version
98
97
 
99
- private
98
+ private
100
99
 
101
- def const_fetch name, default = FETCH_DEFAULT
102
- if self.const_defined?(name)
103
- return self.const_get(name).to_s
104
- elsif default == FETCH_DEFAULT
105
- raise InvalidVersionError.new "undefined constant for #{name.downcase} version"
106
- end # if-else
107
- end # method const_fetch
100
+ def const_fetch name, default = FETCH_DEFAULT
101
+ if self.const_defined?(name)
102
+ return self.const_get(name).to_s
103
+ elsif default == FETCH_DEFAULT
104
+ raise InvalidVersionError.new "undefined constant for #{name.downcase} version"
105
+ end # if-else
106
+ end # method const_fetch
107
+ end # module
108
108
  end # module
109
109
  end # module
@@ -12,7 +12,7 @@ module SleepingKingStudios
12
12
 
13
13
  MAJOR = 0
14
14
  MINOR = 1
15
- PATCH = 1
15
+ PATCH = 2
16
16
  end # module
17
17
 
18
18
  VERSION = Version.to_gem_version
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: sleeping_king_studios-tools
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rob "Merlin" Smith
@@ -79,6 +79,7 @@ executables: []
79
79
  extensions: []
80
80
  extra_rdoc_files: []
81
81
  files:
82
+ - CHANGELOG.md
82
83
  - LICENSE
83
84
  - README.md
84
85
  - lib/sleeping_king_studios/tools.rb