Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feature/inherit from controller base #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -20,4 +20,5 @@ test/dummy/db/*.sqlite3
test/dummy/db/*.sqlite3-journal
test/dummy/log/*.log
test/dummy/tmp/
test/dummy/.sass-cache
test/dummy/.sass-cache
*.lock
14 changes: 14 additions & 0 deletions Appraisals
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
appraise "rails_4_0" do
version = "~> 4.0.13"
gem "rails", version
end

appraise "rails_4_1" do
version = "~> 4.1.10"
gem "rails", version
end

appraise "rails_4_2" do
version = "~> 4.2.1"
gem "rails", version
end
9 changes: 8 additions & 1 deletion Rakefile
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
require "bundler/gem_tasks"
require "rake/testtask"
require "appraisal"

Rake::TestTask.new(:test) do |t|
t.libs << 'lib'
Expand All @@ -8,4 +9,10 @@ Rake::TestTask.new(:test) do |t|
t.verbose = false
end

task default: :test
if !ENV["APPRAISAL_INITIALIZED"] && !ENV["TRAVIS"]
task :default do
sh "appraisal install && rake appraisal test"
end
else
task :default => :test
end
7 changes: 7 additions & 0 deletions gemfiles/rails_4_0.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 4.0.13"

gemspec :path => "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_4_1.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 4.1.10"

gemspec :path => "../"
7 changes: 7 additions & 0 deletions gemfiles/rails_4_2.gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This file was generated by Appraisal

source "https://rubygems.org"

gem "rails", "~> 4.2.1"

gemspec :path => "../"
3 changes: 2 additions & 1 deletion human_power.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@ Gem::Specification.new do |s|

s.add_development_dependency "bundler", "~> 1.3"
s.add_development_dependency "rake"
s.add_development_dependency "rails", "~> 4.0.1"
s.add_development_dependency "rails", "~> 4.0"
s.add_development_dependency "sqlite3"
s.add_development_dependency "appraisal", "~> 1.0"
end
4 changes: 3 additions & 1 deletion lib/human_power/rails/controller.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
require "action_controller"

module HumanPower
module Rails
class RobotsController < ::ApplicationController
class RobotsController < ActionController::Base
def robots
generator = HumanPower::Generator.new(self) do
file = ::Rails.root.join("config", "robots.rb").to_s
Expand Down