Skip to content

Commit

Permalink
play nice with Rails 3 and 4
Browse files Browse the repository at this point in the history
  • Loading branch information
vast committed Oct 11, 2013
1 parent 4551e57 commit 7fa8702
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,6 @@ language: ruby
rvm:
- 1.9.3
- 2.0.0
gemfile:
- gemfiles/Gemfile.rails-3.2.x
- Gemfile
2 changes: 1 addition & 1 deletion api_taster.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Gem::Specification.new do |s|
s.files = `git ls-files`.split($\)
s.test_files = Dir["spec/**/*"]

s.add_dependency 'rails', '>= 4.0'
s.add_dependency 'rails', '>= 3.2'
s.add_dependency 'jquery-rails'
s.add_dependency 'sass-rails'
s.add_dependency 'bootstrap-sass', '~> 2.1'
Expand Down
5 changes: 5 additions & 0 deletions gemfiles/Gemfile.rails-3.2.x
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
source "https://rubygems.org"

gemspec :path => '..'

gem "rails", "~> 3.2.6"
6 changes: 5 additions & 1 deletion spec/mapper_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,11 @@ module ApiTaster
before(:all) do
Rails.application.routes.draw do
resources :dummy_users do
member { map_method :patch, [:update] }
if Rails.version.starts_with? '4'
member { map_method :patch, [:update] }
else
member { map_method :patch, :update }
end
end
end

Expand Down

0 comments on commit 7fa8702

Please sign in to comment.