Versions.rb

"Ruby class versioning made simple."

Gem Version Build Status Code Climate Coverage Status

Ruby 1.9, 2.0, 2.1, and JRuby supported.

Quickstart

Install it:

gem install versions.rb

Create a version (lib/v1.0/awesome_feature.rb):

module V1_0
  class AwesomeFeature
    def foo
      :bar
    end
  end
end

Use it:

require 'versions'

VersionedFeature = Versions.for(:awesome_feature).select('1.0')
feature          = VersionedFeature.new

Configuration

File locations

By default Versions.rb will try to use a lib/ directory within the project root, you can override this:

Versions.config.base_dir = 'dir_path_of_your_choosing'

Alternatively you can override the base_dir for a single call as such:

Versions.for(:awesome_feature).at('./other/location').select('1.0')

Contributing

Please make appropriate use of Issues and Pull Requests. All code should have accompanying tests.

Author/Contact

Versions.rb is written and maintained by @doomspork

License

Versions.rb is made available under the MIT license.