Class: Desert::VersionChecker
Class Method Summary collapse
- .current_rails_version_matches?(version_requirement) ⇒ Boolean
- .rails_version_is_1991? ⇒ Boolean
- .rails_version_is_below_1990? ⇒ Boolean
- .rails_version_is_below_220? ⇒ Boolean
- .rails_version_is_below_230? ⇒ Boolean
- .rails_version_is_below_rc2? ⇒ Boolean
- .version_matches?(version, version_requirement) ⇒ Boolean
Class Method Details
.current_rails_version_matches?(version_requirement) ⇒ Boolean
4 5 6 |
# File 'lib/desert/version_checker.rb', line 4 def current_rails_version_matches?(version_requirement) version_matches?(::Rails::VERSION::STRING, version_requirement) end |
.rails_version_is_1991? ⇒ Boolean
21 22 23 |
# File 'lib/desert/version_checker.rb', line 21 def rails_version_is_1991? current_rails_version_matches?('=1.99.1') end |
.rails_version_is_below_1990? ⇒ Boolean
12 13 14 15 |
# File 'lib/desert/version_checker.rb', line 12 def rails_version_is_below_1990? result = current_rails_version_matches?('<1.99.0') result end |
.rails_version_is_below_220? ⇒ Boolean
25 26 27 |
# File 'lib/desert/version_checker.rb', line 25 def rails_version_is_below_220? current_rails_version_matches?('<2.2.0') end |
.rails_version_is_below_230? ⇒ Boolean
29 30 31 |
# File 'lib/desert/version_checker.rb', line 29 def rails_version_is_below_230? current_rails_version_matches?('<2.3.0') end |
.rails_version_is_below_rc2? ⇒ Boolean
17 18 19 |
# File 'lib/desert/version_checker.rb', line 17 def rails_version_is_below_rc2? current_rails_version_matches?('<1.99.1') end |
.version_matches?(version, version_requirement) ⇒ Boolean
8 9 10 |
# File 'lib/desert/version_checker.rb', line 8 def version_matches?(version, version_requirement) Gem::Version::Requirement.new([version_requirement]).satisfied_by?(Gem::Version.new(version)) end |