No commit activity in last 3 years
No release in over 3 years
Only start Rails if MySQL is a specific version
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.12
~> 10.0
~> 3.0
 Project Readme

Enforce MySQL Version

Build Status

This gem will allow you to prevent your rails app from starting unless the version of MySQL it's running against is a specific major/minor version.

Installation

Add this line to your application's Gemfile:

gem "enforce_mysql_version", require: "5.6"

And then execute:

$ bundle

Usage

Adding the gem to your Gemfile as shown in the installation instructions is all you need to do. MySQL versions that can be required are 5.5, 5.6 and 5.7. If you don't provide a required version in your Gemfile, this gem will have no effect.

Compatibility

The gem is tested against Ruby versions 2.0, 2.1, 2.2 and 2.3 as well as Rails versions 4.0, 4.1 and 4.2.

Development

After checking out the repo, run bundle to install ruby dependecies. Run docker-compose up to install and start versions 5.5, 5.6 and 5.7 of MySQL. Then, run bundle exec rspec to run the tests.

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 tags, and push the .gem file to rubygems.org.

Contributing

Please note that this project is released with a Contributor Code of Conduct. By participating in this project you agree to abide by its terms.

Bug reports and pull requests are welcome on GitHub at https://github.com/pipt/enforce_mysql_version.

License

The gem is available as open source under the terms of the MIT License.