Closed jameschildress closed 11 years ago
Hello,
I've started reading the code and it's much more ideomatic ruby than a case statement, so I like it. Catching NoMethodError is a nice way to test for command validity in a dynamic OOP/message language.
In fact, consistently giving awesome pull requests gives me a reason to give you commit access.
In terms of this pull request, I was thinking you might want to do a feature-branch that is mergeable to master (for documentation purposes/history). Also, the TODO you mention would be a good addition to the mix; are you considering StringIO in the tests (http://stackoverflow.com/questions/1484129/ruby-send-logger-messages-to-a-string-variable)?
I'm honored! I've just pushed one additional commit which adds the SemVer.file_name
method which returns the value of FILE_NAME
, and updated the specs accordingly. Now, all the specs can be run with rspec spec/
without any tests failing.
I'll get to merging, then. And yes, StringIO is exactly how I plan to improve the XSemVer::Runner
tests.
Refactoring
Hello again! I wanted to update the
bin/semver
console tool to use the features introduced in my previous pull request. Unfortunately, that file was basically one long, untested case statement. To simplify this and future contributions, I refactored most of thebin/semver
code into theXSemVer::Runner
class, which uses methods and aliases instead of a case statement to handle branching code.Testing
I've added a comprehensive set of specs to
spec/runner_spec.rb
which tests every command that can be run from the console.New Commands
After the existing commands were tested, I added two new commands to the console tool:
semver meta[data] [STRING]
updates the metadata for the.semver
file.semver pre[release] [STRING]
just aliases tosemver special
, but was added to be consistent with the SemVer 2.0.0-rc2 specification languageUpdated README and Version Number
The
README.md
file andsemver help
command have been updated to reference the new commands. The version of this gem has been incremented to 3.3.0.To-Do
I stubbed the
SemVer::FILE_NAME
constant inspec/runner_spec.rb
. This will cause thespec/semver_spec.rb
specs to fail if both files are run together using therspec spec/
command. For the tests to pass, both files must be run separately.To fix this, I intend to move
SemVer::FILE_NAME
from a constant into a class method, so that it can be stubbed on a per-test basis without breaking other tests.