Skip to content

Commit

Permalink
Merge pull request #79 from greysteil/rails-ruby-support
Browse files Browse the repository at this point in the history
Test against latest Rails and Ruby versions
  • Loading branch information
oriolgual authored May 10, 2019
2 parents 9df6740 + 7b9f006 commit 85f4807
Show file tree
Hide file tree
Showing 4 changed files with 25 additions and 17 deletions.
16 changes: 15 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,22 @@ env:
- ACTIVE_MODEL_VERSION=3.2
- ACTIVE_MODEL_VERSION=4.0
- ACTIVE_MODEL_VERSION=4.2
- ACTIVE_MODEL_VERSION=5.0
- ACTIVE_MODEL_VERSION=5.1
rvm:
- 1.9.3
- 2.2
- 2.3.0
- 2.3
- 2.4
- jruby-19mode

matrix:
exclude:
- rvm: 1.9.3
env: "ACTIVE_MODEL_VERSION=5.0"
- rvm: 1.9.3
env: "ACTIVE_MODEL_VERSION=5.1"
- rvm: jruby-19mode
env: "ACTIVE_MODEL_VERSION=5.0"
- rvm: jruby-19mode
env: "ACTIVE_MODEL_VERSION=5.1"
13 changes: 4 additions & 9 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,11 @@ source "http://rubygems.org"

gemspec

active_model_version = ENV['ACTIVE_MODEL_VERSION'] || 'default'

active_model_opts =
case active_model_version
when 'master'
{ github: 'rails/rails' }
when 'default'
'~> 3'
else
"~> #{active_model_version}"
case ENV['ACTIVE_MODEL_VERSION']
when 'master' then { github: 'rails/rails' }
when 'default' then '~> 3'
else "~> #{ENV['ACTIVE_MODEL_VERSION']}"
end

gem 'activemodel', active_model_opts
Expand Down
11 changes: 5 additions & 6 deletions date_validator.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,20 +5,19 @@ require "date_validator/version"
Gem::Specification.new do |s|
s.name = "date_validator"
s.version = DateValidator::VERSION
s.platform = Gem::Platform::RUBY
s.authors = ["Oriol Gual", "Josep M. Bach", "Josep Jaume Rey"]
s.email = ["info@codegram.com"]
s.homepage = "http://github.com/codegram/date_validator"
s.summary = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel.}
s.description = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3, based on ActiveModel. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options.}
s.summary = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3+, based on ActiveModel.}
s.description = %q{A simple, ORM agnostic, Ruby 1.9 compatible date validator for Rails 3+, based on ActiveModel. Currently supporting :after, :before, :after_or_equal_to and :before_or_equal_to options.}

s.rubyforge_project = "date_validator"

s.add_runtime_dependency 'activemodel'
s.add_runtime_dependency 'activesupport'
s.add_runtime_dependency 'activemodel', '>= 3'
s.add_runtime_dependency 'activesupport', '>= 3'

s.add_development_dependency 'minitest'
s.add_development_dependency 'rake'
s.add_development_dependency 'rake', '12.2.1'
s.add_development_dependency 'tzinfo'

s.files = `git ls-files`.split("\n")
Expand Down
2 changes: 1 addition & 1 deletion lib/date_validator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
require 'active_support/i18n'
require 'date_validator/engine' if defined?(Rails)

# A simple date validator for Rails 3.
# A simple date validator for Rails 3+.
#
# @example
# validates :expiration_date,
Expand Down

0 comments on commit 85f4807

Please sign in to comment.