Skip to content

Commit

Permalink
Merge pull request #40 from grosser/r30
Browse files Browse the repository at this point in the history
Bring back rails 3.0 support and some small cleanup
  • Loading branch information
jamesarosen committed Mar 23, 2013
2 parents e9ff0fe + 353fbd6 commit 4da9887
Show file tree
Hide file tree
Showing 8 changed files with 26 additions and 20 deletions.
12 changes: 4 additions & 8 deletions .travis.yml
@@ -1,16 +1,12 @@
rvm:
- 1.9.2
- 1.9.3
before_install:
- gem update --system
- gem --version
- gem install bundler
script: "bundle exec rake test"
- 2.0.0
gemfile:
- gemfiles/rails3_0.gemfile
- gemfiles/rails3_1.gemfile
- gemfiles/rails3_2.gemfile
- gemfiles/rails4_0.gemfile
matrix:
exclude:
- rvm: 1.9.2
gemfile: gemfiles/rails4_0.gemfile
- rvm: 2.0.0
gemfile: gemfiles/rails3_0.gemfile
4 changes: 4 additions & 0 deletions Appraisals
@@ -1,3 +1,7 @@
appraise "rails3-0" do
gem "rails", "~> 3.0.20"
end

appraise "rails3-1" do
gem "rails", "~> 3.1.11"
end
Expand Down
2 changes: 1 addition & 1 deletion app/controllers/arturo/features_controller.rb
Expand Up @@ -18,7 +18,7 @@ class FeaturesController < ApplicationController
before_filter :require_permission
before_filter :load_feature, :only => [ :show, :edit, :update, :destroy ]

if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR < 1
if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0
def arturo_engine
self
end
Expand Down
2 changes: 1 addition & 1 deletion arturo.gemspec
Expand Up @@ -13,7 +13,7 @@ Gem::Specification.new do |gem|
gem.require_paths = [".", "lib"]
gem.has_rdoc = 'false'
gem.specification_version = 2
gem.add_runtime_dependency 'rails', '> 3.1', '< 5.0'
gem.add_runtime_dependency 'rails', '> 3.0', '< 5.0'
gem.add_development_dependency 'mocha'
gem.add_development_dependency 'rake'
gem.add_development_dependency 'minitest-rg'
Expand Down
8 changes: 5 additions & 3 deletions config/routes.rb
@@ -1,7 +1,9 @@
if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR < 1
if Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0
Rails.application.routes.draw do
resources :features, :controller => 'arturo/features'
put 'features', :to => 'arturo/features#update_all', :as => 'features'
scope "/arturo" do
resources :features, :controller => "arturo/features"
put 'features', :to => 'arturo/features#update_all', :as => 'features'
end
end
else
Arturo::Engine.routes.draw do
Expand Down
7 changes: 7 additions & 0 deletions gemfiles/rails3_0.gemfile
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://bundler-api.herokuapp.com"

gem "rails", "~> 3.0.20"

gemspec :path=>"../"
4 changes: 3 additions & 1 deletion test/dummy_app/config/routes.rb
@@ -1,5 +1,7 @@
DummyApp::Application.routes.draw do
mount Arturo::Engine => "/arturo"
unless Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0
mount Arturo::Engine => "/arturo"
end

resources :books, :only => 'show' do
post :holds, :on => :member
Expand Down
7 changes: 1 addition & 6 deletions test/dummy_app/test/test_helper.rb
Expand Up @@ -5,13 +5,8 @@
require 'rails/test_help'

require 'minitest/unit'
require 'minitest/rg'

begin
require 'minitest/rg'
rescue NameError
end

require 'mocha'
require 'factory_girl'
require 'timecop'

Expand Down

0 comments on commit 4da9887

Please sign in to comment.