Sha256: 77c577118ba9ac9277b485f70f4258708fd4a1bc6486e17f06bf580d2d190807

Contents?: true

Size: 1.86 KB

Versions: 1

Compression:

Stored size: 1.86 KB

Contents

# RubyMinimumVersion

RubyMinimumVersion finds a minimum required version of `ruby` for Ruby code.

RubyMinimumVersion takes Ruby source code and calculates the minimum version of `ruby` required to be able to run it.
Because it is based on the `parser` gem, it can do this without having to actually load the code.
This gem is inspired by the `Perl::MinimumVersion`.
This gem provides `rubyver` executable for the counterpart of `perlver`.

## Installation

Install the gem and add to the application's Gemfile by executing:

    $ bundle add ruby_minimum_version

If bundler is not being used to manage dependencies, install the gem by executing:

    $ gem install ruby_minimum_version

## Usage

```sh
./exe/rubyver test/sample.rb
# Searching for Ruby files... found 1 file(s)
# Scanning test/sample.rb... done
# 21
```

Or more verbosely:

```sh
./exe/rubyver --verbose test/sample.rb
# Searching for Ruby files... found 1 file(s)
# Scanning test/sample.rb...
# Parsing with version 18...
# error: unexpected token tCOLON
# def a(b:); end
#        ^
# Parsing with version 19...
# error: unexpected token tLABEL
# def a(b:); end
#       ^^
# Parsing with version 20...
# error: unexpected token tRPAREN
# def a(b:); end
#         ^
# Scanning done
# 21
```

See also `--help` output.

## Development

After checking out the repo, run `bin/setup` to install dependencies.
Then, run `rake test` to run the tests.
You can also run `bin/console` for an interactive prompt that will allow you to experiment.

To install this gem onto your local machine, run `bundle exec rake install`.
To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and the created tag, and push the `.gem` file to [rubygems.org](https://rubygems.org).

## Contributing

Bug reports and pull requests are welcome.

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
ruby_minimum_version-0.1.0 README.md