mixlib-versioning 1.0.0 → 1.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (35) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +2 -0
  3. data/.rubocop.yml +22 -0
  4. data/.travis.yml +24 -0
  5. data/CHANGELOG.md +16 -1
  6. data/Gemfile +3 -4
  7. data/README.md +9 -15
  8. data/Rakefile +15 -3
  9. data/lib/mixlib/versioning.rb +32 -29
  10. data/lib/mixlib/versioning/exceptions.rb +1 -1
  11. data/lib/mixlib/versioning/format.rb +33 -31
  12. data/lib/mixlib/versioning/format/git_describe.rb +5 -7
  13. data/lib/mixlib/versioning/format/opscode_semver.rb +6 -17
  14. data/lib/mixlib/versioning/format/rubygems.rb +6 -8
  15. data/lib/mixlib/versioning/format/semver.rb +9 -11
  16. data/lib/mixlib/versioning/version.rb +2 -2
  17. data/mixlib-versioning.gemspec +20 -14
  18. data/spec/mixlib/versioning/format/git_describe_spec.rb +143 -131
  19. data/spec/mixlib/versioning/format/opscode_semver_spec.rb +106 -81
  20. data/spec/mixlib/versioning/format/rubygems_spec.rb +119 -104
  21. data/spec/mixlib/versioning/format/semver_spec.rb +98 -77
  22. data/spec/mixlib/versioning/format_spec.rb +17 -25
  23. data/spec/mixlib/versioning/versioning_spec.rb +163 -141
  24. data/spec/spec_helper.rb +2 -2
  25. data/spec/support/shared_examples/basic_semver.rb +19 -21
  26. data/spec/support/shared_examples/behaviors/comparable.rb +80 -0
  27. data/spec/support/shared_examples/behaviors/filterable.rb +19 -31
  28. data/spec/support/shared_examples/behaviors/parses_valid_version_strings.rb +4 -7
  29. data/spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb +3 -6
  30. data/spec/support/shared_examples/behaviors/serializable.rb +5 -7
  31. data/spec/support/shared_examples/behaviors/sortable.rb +7 -9
  32. data/spec/support/shared_examples/semver.rb +81 -69
  33. metadata +51 -26
  34. data/.yardopts +0 -7
  35. data/CONTRIBUTING.md +0 -188
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mixlib-versioning
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
5
- prerelease:
4
+ version: 1.1.0
6
5
  platform: ruby
7
6
  authors:
8
7
  - Seth Chisamore
@@ -10,53 +9,77 @@ authors:
10
9
  autorequire:
11
10
  bindir: bin
12
11
  cert_chain: []
13
- date: 2013-03-29 00:00:00.000000000 Z
12
+ date: 2015-06-04 00:00:00.000000000 Z
14
13
  dependencies:
14
+ - !ruby/object:Gem::Dependency
15
+ name: rubocop
16
+ requirement: !ruby/object:Gem::Requirement
17
+ requirements:
18
+ - - '='
19
+ - !ruby/object:Gem::Version
20
+ version: 0.31.0
21
+ type: :development
22
+ prerelease: false
23
+ version_requirements: !ruby/object:Gem::Requirement
24
+ requirements:
25
+ - - '='
26
+ - !ruby/object:Gem::Version
27
+ version: 0.31.0
15
28
  - !ruby/object:Gem::Dependency
16
29
  name: rspec
17
30
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
31
  requirements:
20
- - - ! '>='
32
+ - - "~>"
33
+ - !ruby/object:Gem::Version
34
+ version: '2.14'
35
+ type: :development
36
+ prerelease: false
37
+ version_requirements: !ruby/object:Gem::Requirement
38
+ requirements:
39
+ - - "~>"
40
+ - !ruby/object:Gem::Version
41
+ version: '2.14'
42
+ - !ruby/object:Gem::Dependency
43
+ name: bundler
44
+ requirement: !ruby/object:Gem::Requirement
45
+ requirements:
46
+ - - ">="
21
47
  - !ruby/object:Gem::Version
22
48
  version: '0'
23
49
  type: :development
24
50
  prerelease: false
25
51
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
52
  requirements:
28
- - - ! '>='
53
+ - - ">="
29
54
  - !ruby/object:Gem::Version
30
55
  version: '0'
31
56
  - !ruby/object:Gem::Dependency
32
- name: rspec_junit_formatter
57
+ name: rake
33
58
  requirement: !ruby/object:Gem::Requirement
34
- none: false
35
59
  requirements:
36
- - - ! '>='
60
+ - - ">="
37
61
  - !ruby/object:Gem::Version
38
62
  version: '0'
39
63
  type: :development
40
64
  prerelease: false
41
65
  version_requirements: !ruby/object:Gem::Requirement
42
- none: false
43
66
  requirements:
44
- - - ! '>='
67
+ - - ">="
45
68
  - !ruby/object:Gem::Version
46
69
  version: '0'
47
70
  description: General purpose Ruby library that allows you to parse, compare and manipulate
48
71
  version strings in multiple formats.
49
72
  email:
50
- - schisamo@opscode.com
51
- - cm@opscode.com
73
+ - schisamo@chef.io
74
+ - cm@chef.io
52
75
  executables: []
53
76
  extensions: []
54
77
  extra_rdoc_files: []
55
78
  files:
56
- - .gitignore
57
- - .yardopts
79
+ - ".gitignore"
80
+ - ".rubocop.yml"
81
+ - ".travis.yml"
58
82
  - CHANGELOG.md
59
- - CONTRIBUTING.md
60
83
  - Gemfile
61
84
  - LICENSE
62
85
  - README.md
@@ -78,35 +101,36 @@ files:
78
101
  - spec/mixlib/versioning/versioning_spec.rb
79
102
  - spec/spec_helper.rb
80
103
  - spec/support/shared_examples/basic_semver.rb
104
+ - spec/support/shared_examples/behaviors/comparable.rb
81
105
  - spec/support/shared_examples/behaviors/filterable.rb
82
106
  - spec/support/shared_examples/behaviors/parses_valid_version_strings.rb
83
107
  - spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb
84
108
  - spec/support/shared_examples/behaviors/serializable.rb
85
109
  - spec/support/shared_examples/behaviors/sortable.rb
86
110
  - spec/support/shared_examples/semver.rb
87
- homepage: https://github.com/opscode/mixlib-versioning
88
- licenses: []
111
+ homepage: https://github.com/chef/mixlib-versioning
112
+ licenses:
113
+ - Apache 2.0
114
+ metadata: {}
89
115
  post_install_message:
90
116
  rdoc_options: []
91
117
  require_paths:
92
118
  - lib
93
119
  required_ruby_version: !ruby/object:Gem::Requirement
94
- none: false
95
120
  requirements:
96
- - - ! '>='
121
+ - - ">="
97
122
  - !ruby/object:Gem::Version
98
- version: '0'
123
+ version: '1.9'
99
124
  required_rubygems_version: !ruby/object:Gem::Requirement
100
- none: false
101
125
  requirements:
102
- - - ! '>='
126
+ - - ">="
103
127
  - !ruby/object:Gem::Version
104
128
  version: '0'
105
129
  requirements: []
106
130
  rubyforge_project:
107
- rubygems_version: 1.8.25
131
+ rubygems_version: 2.2.2
108
132
  signing_key:
109
- specification_version: 3
133
+ specification_version: 4
110
134
  summary: General purpose Ruby library that allows you to parse, compare and manipulate
111
135
  version strings in multiple formats.
112
136
  test_files:
@@ -118,6 +142,7 @@ test_files:
118
142
  - spec/mixlib/versioning/versioning_spec.rb
119
143
  - spec/spec_helper.rb
120
144
  - spec/support/shared_examples/basic_semver.rb
145
+ - spec/support/shared_examples/behaviors/comparable.rb
121
146
  - spec/support/shared_examples/behaviors/filterable.rb
122
147
  - spec/support/shared_examples/behaviors/parses_valid_version_strings.rb
123
148
  - spec/support/shared_examples/behaviors/rejects_invalid_version_strings.rb
data/.yardopts DELETED
@@ -1,7 +0,0 @@
1
- --markup=markdown
2
- --markup-provider=redcarpet
3
- --readme=README.md
4
- -
5
- CHANGELOG.md
6
- CONTRIBUTING.md
7
- LICENSE
@@ -1,188 +0,0 @@
1
- [jira-project]: http://tickets.opscode.com/browse/MIXLIB
2
- [github-project]: http://www.github.com/opscode/mixlib-versioning
3
- [github-opscode]: http://www.github.com/opscode
4
- [cla]: https://secure.echosign.com/public/hostedForm?formid=PJIF5694K6L
5
- [cla-corp]: https://secure.echosign.com/public/hostedForm?formid=PIE6C7AX856
6
- [wiki-contribute]: http://wiki.opscode.com/display/chef/How+to+Contribute
7
- [wiki-git]: http://wiki.opscode.com/display/chef/Working+with+Git
8
- [wiki-code-review]: http://wiki.opscode.com/display/chef/Code+Review
9
- [list-chef-dev]: http://lists.opscode.com/sympa/info/chef-dev
10
-
11
- # Contributing to Mixlib::Versioning
12
-
13
- We are glad you want to contribute to `Mixlib::Versioning`! The first step is
14
- the desire to improve the project.
15
-
16
- You can find the answers to additional frequently asked questions
17
- [on the wiki][wiki-contribute].
18
-
19
- ## Quick-contribute
20
-
21
- * Create an account on our [bug tracker][jira-project]
22
- * Sign our contributor agreement (CLA) [online][cla] (keep reading if you're
23
- contributing on behalf of your employer)
24
- * Create a ticket for your change on the [bug tracker][jira-project]. Tickets
25
- should be filed under the **MIXLIB** project with the component set to
26
- **mixlib-versioning**.
27
- * Link to your patch as a rebased git branch or pull request from the ticket
28
- * Resolve the ticket as fixed
29
-
30
- We regularly review contributions and will get back to you if we have any
31
- suggestions or concerns.
32
-
33
- ## The Apache License and the CLA/CCLA
34
-
35
- Licensing is very important to open source projects, it helps ensure the
36
- software continues to be available under the terms that the author desired.
37
- This project uses the Apache 2.0 license to strike a balance between open
38
- contribution and allowing you to use the software however you would like to.
39
-
40
- The license tells you what rights you have that are provided by the copyright
41
- holder. It is important that the contributor fully understands what rights they
42
- are licensing and agrees to them. Sometimes the copyright holder isn't the
43
- contributor, most often when the contributor is doing work for a company.
44
-
45
- To make a good faith effort to ensure these criteria are met, Opscode requires
46
- a Contributor License Agreement (CLA) or a Corporate Contributor License
47
- Agreement (CCLA) for all contributions. This is without exception due to some
48
- matters not being related to copyright and to avoid having to continually check
49
- with our lawyers about small patches.
50
-
51
- It only takes a few minutes to complete a CLA, and you retain the copyright to
52
- your contribution.
53
-
54
- You can complete our contributor agreement (CLA) [online][cla]. If you're
55
- contributing on behalf of your employer, have your employer fill out our
56
- [Corporate CLA][cla-corp] instead.
57
-
58
- ## Ticket Tracker (JIRA)
59
-
60
- The [ticket tracker][jira-project] is the most important documentation for the
61
- code base. It provides significant historical information, such as:
62
-
63
- * Which release a bug fix is included in
64
- * Discussion regarding the design and merits of features
65
- * Error output to aid in finding similar bugs
66
-
67
- Each ticket should aim to fix one bug or add one feature.
68
-
69
- ## Using git
70
-
71
- You can get a quick copy of this project's repository by running:
72
-
73
- ```shell
74
- git clone git://github.com/opscode/mixlib-versioning.git
75
- ```
76
-
77
- For collaboration purposes, it is best if you create a Github account and fork
78
- the repository to your own account. Once you do this you will be able to push
79
- your changes to your Github repository for others to see and use.
80
-
81
- ### Branches and Commits
82
-
83
- You should submit your patch as a git branch named after the ticket, such as
84
- MIXLIB-1337. This is called a _topic branch_ and allows users to associate a
85
- branch of code with the ticket.
86
-
87
- It is a best practice to have your commit message have a _summary line_ that
88
- includes the ticket number, followed by an empty line and then a brief
89
- description of the commit. This also helps other contributors understand the
90
- purpose of changes to the code. Here is an example from the Chef project:
91
-
92
- CHEF-3435: Create deploy dirs before calling scm_provider
93
-
94
- The SCM providers have an assertation that requires the deploy directory to
95
- exist. The deploy provider will create missing directories, we don't converge
96
- the actions before we call run_action against the SCM provider, so it is not
97
- yet created. This ensures we run any converge actions waiting before we call
98
- the SCM provider.
99
-
100
- Remember that not all users use this library in the same way or on the same
101
- operating systems as you, so it is helpful to be clear about your use case and
102
- change so they can understand it even when it doesn't apply to them.
103
-
104
- ### Github and Pull Requests
105
-
106
- All of Opscode's open source projects are available on [Github][github-opscode].
107
-
108
- We don't require you to use Github, and we will even take patch diffs attached
109
- to tickets on the tracker. However Github has a lot of convenient features,
110
- such as being able to see a diff of changes between a pull request and the main
111
- repository quickly without downloading the branch.
112
-
113
- If you do choose to use a pull request, please provide a link to the pull
114
- request from the ticket __and__ a link to the ticket from the pull request.
115
- Because pull requests only have two states, open and closed, we can't easily
116
- filter pull requests that are waiting for a reply from the author for various
117
- reasons.
118
-
119
- ### More information
120
-
121
- Additional help with git is available on the [Working with Git][wiki-git] wiki
122
- page.
123
-
124
- ## Functional and Unit Tests
125
-
126
- There are rspec unit tests in the 'spec' directory. If you don't have rspec
127
- already installed, you can use the 'bundler' gem to help you get the necessary
128
- prerequisites by running `sudo gem install bundler` and then `bundle install`
129
- from the project root. You can run the project's spec tests by running
130
- `rspec spec/*` or `rake spec` from the root directory of the this repository.
131
-
132
- It is good to run the tests once on your system before you get started to
133
- ensure they all pass so you have a valid baseline. After you write your patch,
134
- run the tests again to see if they all pass.
135
-
136
- If any don't pass, investigate them before submitting your patch.
137
-
138
- These tests don't modify your system, and sometimes tests fail because a
139
- command that would be run has changed because of your patch. This should be a
140
- simple fix. Other times the failure can show you that an important feature no
141
- longer works because of your change.
142
-
143
- Any new feature should have unit tests included with the patch with good code
144
- coverage to help protect it from future changes. Similarly, patches that fix a
145
- bug or regression should have a _regression test_. Simply put, this is a test
146
- that would fail without your patch but passes with it. The goal is to ensure
147
- this bug doesn't regress in the future. Consider a regular expression that
148
- doesn't match a certain pattern that it should, so you provide a patch and a
149
- test to ensure that the part of the code that uses this regular expression
150
- works as expected. Later another contributor may modify this regular expression
151
- in a way that breaks your use cases. The test you wrote will fail, signalling
152
- to them to research your ticket and use case and accounting for it.
153
-
154
- ## Code Review
155
-
156
- Opscode regularly reviews code contributions and provides suggestions for
157
- improvement in the code itself or the implementation.
158
-
159
- We find contributions by searching the ticket tracker for _resolved_ tickets
160
- with a status of _fixed_. If we have feedback we will reopen the ticket and you
161
- should resolve it again when you've made the changes or have a response to our
162
- feedback. When we believe the patch is ready to be merged, we update the status
163
- to _Fix Reviewed_.
164
-
165
- Depending on the project, these tickets are then merged within a week or two,
166
- depending on the current release cycle. At this point the ticket status will be
167
- updated to _Fix Committed_ or _Closed_.
168
-
169
- Please see the [Code Review][wiki-code-review] page on the wiki for additional
170
- information.
171
-
172
- ## Release Cycle
173
-
174
- The versioning for the this project is X.Y.Z and follows
175
- [SemVer 2.0.0-rc.1 conventions](http://semver.org/):
176
-
177
- * X is a major release, which may not be fully compatible with prior major releases
178
- * Y is a minor release, which adds both new features and bug fixes
179
- * Z is a patch release, which adds just bug fixes
180
-
181
- There are usually beta releases and release candidates (RC) of major and minor
182
- releases announced on the [chef-dev mailing list][list-chef-dev]. Once an
183
- RC is released, we wait at least three days to allow for testing for regressions
184
- before the final release. If a blocking regression is found then another RC is
185
- made containing the fix and the timer is reset.
186
-
187
- Once the official release is made, the release notes are available on the
188
- [Opscode blog](http://www.opscode.com/blog).