Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/doomspork/versions.rb
Ruby class versioning made simple.
https://github.com/doomspork/versions.rb
Last synced: 6 days ago
JSON representation
Ruby class versioning made simple.
- Host: GitHub
- URL: https://github.com/doomspork/versions.rb
- Owner: doomspork
- License: mit
- Created: 2014-02-03T01:29:59.000Z (almost 11 years ago)
- Default Branch: master
- Last Pushed: 2015-04-22T04:52:49.000Z (over 9 years ago)
- Last Synced: 2024-12-05T16:48:18.287Z (23 days ago)
- Language: Ruby
- Homepage: http://rubygems.org/gems/versions.rb
- Size: 324 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# Versions.rb
_"Ruby class versioning made simple."_
[![Gem Version](https://badge.fury.io/rb/versions.rb.png)](https://rubygems.org/gems/versions.rb) [![Build Status](https://travis-ci.org/doomspork/versions.rb.png?branch=master)](https://travis-ci.org/doomspork/versions.rb) [![Code Climate](https://codeclimate.com/github/doomspork/versions.rb.png)](https://codeclimate.com/github/doomspork/versions.rb) [![Coverage Status](https://coveralls.io/repos/doomspork/versions.rb/badge.png?branch=master)](https://coveralls.io/r/doomspork/versions.rb)
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`):
```ruby
module V1_0
class AwesomeFeature
def foo
:bar
end
end
end
```Use it:
```ruby
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:```ruby
Versions.config.base_dir = 'dir_path_of_your_choosing'
```Alternatively you can override the `base_dir` for a single call as such:
```ruby
Versions.for(:awesome_feature).at('./other/location').select('1.0')
```## Contributing
Please make appropriate use of [Issues][issues] and [Pull Requests][pr]. All code should have accompanying tests.
## Author/Contact
Versions.rb is written and maintained by [@doomspork](https://github.com/doomspork)
## License
Versions.rb is made available under the [MIT][mit] license.
[issues]: https://github.com/doomspork/versions.rb/issues
[pr]: https://github.com/doomspork/versions.rb/pulls
[mit]: LICENSE