semver_stringer 0.1.0 → 0.1.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.
data/.gitignore CHANGED
@@ -2,3 +2,5 @@
2
2
  .bundle
3
3
  Gemfile.lock
4
4
  pkg/*
5
+ .yardoc/*
6
+ doc/*
data/HISTORY.md ADDED
@@ -0,0 +1,7 @@
1
+ ## 0.1.1 (2012-02-29)
2
+
3
+ * Added some Yard doc comments
4
+
5
+ ## 0.1.0 (2012-02-23)
6
+
7
+ * First release
data/README.md CHANGED
@@ -22,3 +22,4 @@ Gives you a little help with your [semver](http://semver.org/) strings.
22
22
  ## TODO
23
23
 
24
24
  * Comparison operators to implement the ordering as laid out in the semver spec.
25
+ * Constructor taking string parameter for parsing and initialization
@@ -1,12 +1,26 @@
1
1
  module SemverStringer
2
2
  class Semver
3
3
 
4
+ # Creates a new Semver instance.
5
+ #
6
+ # @param [Hash] params the options to create a message with.
7
+ # @option params [Integer] :major Major version number
8
+ # @option params [Integer] :minor Minor version number
9
+ # @option params [Integer] :patch Patch version number
10
+ # @option params [String, Integer, Array<String, Integer>] :pre Pre-release identifier(s)
11
+ # @option params [String, Integer, Array<String, Integer>] :build Build number identifier(s)
4
12
  def initialize(params={})
5
13
  @major, @minor, @patch = get_version_numbers_from params
6
14
  @build = get_build_string_from params
7
15
  @pre = get_pre_string_from params
8
16
  end
9
17
 
18
+ # Returns a string representation of the SemVer
19
+ #
20
+ # @example
21
+ # SemverStringer::Semver.new(:major=>2, :pre=>"alpha").to_s #=> "2.0.0-alpha"
22
+ #
23
+ # @return [String]
10
24
  def to_s
11
25
  version = "#{@major}.#{@minor}.#{@patch}"
12
26
  version << "-#{@pre}" unless @pre == nil
@@ -1,3 +1,3 @@
1
1
  module SemverStringer
2
- VERSION = "0.1.0"
2
+ VERSION = "0.1.1"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: semver_stringer
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-02-24 00:00:00.000000000 Z
12
+ date: 2012-02-29 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: rspec
16
- requirement: &70208392024840 !ruby/object:Gem::Requirement
16
+ requirement: &70278852677040 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,7 +21,7 @@ dependencies:
21
21
  version: '2.8'
22
22
  type: :development
23
23
  prerelease: false
24
- version_requirements: *70208392024840
24
+ version_requirements: *70278852677040
25
25
  description: See semver.org for the rules, or https://github.com/iantruslove/SemverStringer#readme
26
26
  for a little documentation.
27
27
  email:
@@ -33,6 +33,7 @@ files:
33
33
  - .gitignore
34
34
  - 00notes.md
35
35
  - Gemfile
36
+ - HISTORY.md
36
37
  - README.md
37
38
  - Rakefile
38
39
  - lib/semver_stringer.rb
@@ -66,3 +67,4 @@ specification_version: 3
66
67
  summary: Makes nice strings for your SemVer needs
67
68
  test_files:
68
69
  - spec/semver_spec.rb
70
+ has_rdoc: