Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into release-4.0
Browse files Browse the repository at this point in the history
  • Loading branch information
Intrepidd committed Mar 3, 2014
2 parents e16074f + f273b84 commit b020e8f
Show file tree
Hide file tree
Showing 11 changed files with 103 additions and 101 deletions.
15 changes: 9 additions & 6 deletions .travis.yml
@@ -1,9 +1,12 @@
script: "bundle exec rake spec"
rvm:
- 1.8.7
- 1.9.2
- 1.9.3
- ree
notifications:
recipients:
- romanvbabenko@gmail.com
- 2.0.0
- 2.1.1
gemfile:
- gemfiles/Gemfile.rails-3.2.x
- gemfiles/Gemfile.rails-4.0.x
- gemfiles/Gemfile.rails-edge
matrix:
allow_failures:
- gemfile: gemfiles/Gemfile.rails-edge
130 changes: 61 additions & 69 deletions Gemfile.lock
Expand Up @@ -7,98 +7,90 @@ PATH
GEM
remote: http://rubygems.org/
specs:
actionmailer (3.1.1)
actionpack (= 3.1.1)
mail (~> 2.3.0)
actionpack (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
actionmailer (4.0.3)
actionpack (= 4.0.3)
mail (~> 2.5.4)
actionpack (4.0.3)
activesupport (= 4.0.3)
builder (~> 3.1.0)
erubis (~> 2.7.0)
i18n (~> 0.6)
rack (~> 1.3.2)
rack-cache (~> 1.1)
rack-mount (~> 0.8.2)
rack-test (~> 0.6.1)
sprockets (~> 2.0.2)
activemodel (3.1.1)
activesupport (= 3.1.1)
builder (~> 3.0.0)
i18n (~> 0.6)
activerecord (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
arel (~> 2.2.1)
tzinfo (~> 0.3.29)
activeresource (3.1.1)
activemodel (= 3.1.1)
activesupport (= 3.1.1)
activesupport (3.1.1)
multi_json (~> 1.0)
arel (2.2.1)
builder (3.0.0)
rack (~> 1.5.2)
rack-test (~> 0.6.2)
activemodel (4.0.3)
activesupport (= 4.0.3)
builder (~> 3.1.0)
activerecord (4.0.3)
activemodel (= 4.0.3)
activerecord-deprecated_finders (~> 1.0.2)
activesupport (= 4.0.3)
arel (~> 4.0.0)
activerecord-deprecated_finders (1.0.3)
activesupport (4.0.3)
i18n (~> 0.6, >= 0.6.4)
minitest (~> 4.2)
multi_json (~> 1.3)
thread_safe (~> 0.1)
tzinfo (~> 0.3.37)
arel (4.0.2)
atomic (1.1.15)
builder (3.1.4)
diff-lcs (1.1.3)
erubis (2.7.0)
hike (1.2.1)
i18n (0.6.0)
json (1.6.1)
mail (2.3.0)
i18n (>= 0.4.0)
hike (1.2.3)
i18n (0.6.9)
mail (2.5.4)
mime-types (~> 1.16)
treetop (~> 1.4.8)
mime-types (1.17.2)
multi_json (1.0.3)
polyglot (0.3.3)
rack (1.3.5)
rack-cache (1.1)
rack (>= 0.4)
rack-mount (0.8.3)
rack (>= 1.0.0)
rack-ssl (1.3.2)
rack
rack-test (0.6.1)
mime-types (1.25.1)
minitest (4.7.5)
multi_json (1.8.4)
polyglot (0.3.4)
rack (1.5.2)
rack-test (0.6.2)
rack (>= 1.0)
rails (3.1.1)
actionmailer (= 3.1.1)
actionpack (= 3.1.1)
activerecord (= 3.1.1)
activeresource (= 3.1.1)
activesupport (= 3.1.1)
bundler (~> 1.0)
railties (= 3.1.1)
railties (3.1.1)
actionpack (= 3.1.1)
activesupport (= 3.1.1)
rack-ssl (~> 1.3.2)
rails (4.0.3)
actionmailer (= 4.0.3)
actionpack (= 4.0.3)
activerecord (= 4.0.3)
activesupport (= 4.0.3)
bundler (>= 1.3.0, < 2.0)
railties (= 4.0.3)
sprockets-rails (~> 2.0.0)
railties (4.0.3)
actionpack (= 4.0.3)
activesupport (= 4.0.3)
rake (>= 0.8.7)
rdoc (~> 3.4)
thor (~> 0.14.6)
rake (0.9.2.2)
rdoc (3.11)
json (~> 1.4)
thor (>= 0.18.1, < 2.0)
rake (10.1.1)
rspec (2.9.0)
rspec-core (~> 2.9.0)
rspec-expectations (~> 2.9.0)
rspec-mocks (~> 2.9.0)
rspec-core (2.9.0)
rspec-expectations (2.9.0)
rspec-expectations (2.9.1)
diff-lcs (~> 1.1.3)
rspec-mocks (2.9.0)
sprockets (2.0.3)
sprockets (2.11.0)
hike (~> 1.2)
multi_json (~> 1.0)
rack (~> 1.0)
tilt (~> 1.1, != 1.3.0)
thor (0.14.6)
tilt (1.3.3)
treetop (1.4.10)
sprockets-rails (2.0.1)
actionpack (>= 3.0)
activesupport (>= 3.0)
sprockets (~> 2.8)
thor (0.18.1)
thread_safe (0.2.0)
atomic (>= 1.1.7, < 2)
tilt (1.4.1)
treetop (1.4.15)
polyglot
polyglot (>= 0.3.1)
tzinfo (0.3.30)
tzinfo (0.3.38)

PLATFORMS
ruby

DEPENDENCIES
rails (>= 3.0.0)
rails-footnotes!
rspec (~> 2.9.0)
6 changes: 4 additions & 2 deletions README.rdoc
Expand Up @@ -17,15 +17,17 @@ NOTE: Since this branch aims Rails 3 support, if you want to use it with Rails 2

Install Rails Footnotes is very easy.

=== Rails 3.x
=== Rails 3.x / 4.x

gem 'rails-footnotes', '>= 3.7.9', :group => :development

After you install RailsFootnotes and add it to your Gemfile, you need to run the generator:

rails generate rails_footnotes:install

=== Rails 2.x
=== Rails 2.x (Not maintained, please update to Rails 4)

You can still use an older version of the gem :

In RAILS_ROOT/config/environments/development.rb (yes, you want it only in development):

Expand Down
4 changes: 2 additions & 2 deletions Rakefile
@@ -1,7 +1,7 @@
require 'bundler'
Bundler::GemHelper.install_tasks
require "rspec/core/rake_task"
require 'rake/rdoctask'
require 'rdoc/task'

desc 'Default: run tests'
task :default => :spec
Expand All @@ -13,7 +13,7 @@ RSpec::Core::RakeTask.new(:spec) do |t|
end

desc 'Generate documentation for Footnotes.'
Rake::RDocTask.new(:rdoc) do |rdoc|
RDoc::Task.new(:rdoc) do |rdoc|
rdoc.rdoc_dir = 'rdoc'
rdoc.title = 'Footnotes'
rdoc.options << '--line-numbers' << '--inline-source'
Expand Down
5 changes: 5 additions & 0 deletions gemfiles/Gemfile.rails-3.2.x
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gemspec :path => '..'

gem 'rails', '~> 3.2.0'
6 changes: 6 additions & 0 deletions gemfiles/Gemfile.rails-4.0.x
@@ -0,0 +1,6 @@
source 'https://rubygems.org'

gemspec :path => '..'

gem 'rails', '~> 4.0.0'

5 changes: 5 additions & 0 deletions gemfiles/Gemfile.rails-edge
@@ -0,0 +1,5 @@
source 'https://rubygems.org'

gemspec :path => '..'

gem 'rails', :github => 'rails/rails'
2 changes: 2 additions & 0 deletions lib/rails-footnotes.rb
@@ -1,3 +1,5 @@
require 'active_support/core_ext/module/attribute_accessors'

module Footnotes
mattr_accessor :before_hooks
@@before_hooks = []
Expand Down
17 changes: 2 additions & 15 deletions lib/rails-footnotes/filter.rb
Expand Up @@ -102,24 +102,11 @@ def revert_pos(file)
end

def performed_render?
@controller.instance_variable_get(:@performed_render) || # rails 2.x
(@controller.respond_to?(:performed?) && @controller.performed?) # rails3, will break on redirect??
@controller.respond_to?(:performed?) && @controller.performed?
end

def valid_format?
if @template # Rails 2.x
[:html,:rhtml,:xhtml,:rxhtml].include?(@template.send(template_format_method.to_sym).to_sym)
else # Rails 3
@controller.response.content_type == 'text/html'
end
end

def template_format_method
if @template.respond_to?(:template_format)
return 'template_format'
else
return 'format'
end
[:html,:rhtml,:xhtml,:rxhtml].include?(@template.send(:format).to_sym)
end

def valid_content_type?
Expand Down
1 change: 0 additions & 1 deletion rails-footnotes.gemspec
Expand Up @@ -16,7 +16,6 @@ Gem::Specification.new do |s|

s.add_dependency "rails", ">= 3.0.0"

s.add_development_dependency "rails", ">= 3.0.0"
s.add_development_dependency "rspec", "~> 2.9.0"

s.files = `git ls-files`.split("\n")
Expand Down
13 changes: 7 additions & 6 deletions spec/spec_helper.rb
Expand Up @@ -5,20 +5,21 @@
end

require 'rubygems'

require 'rails/all'
ENV['RAILS_ENV'] = 'test'
Rails.logger = Logger.new(STDOUT)

require 'active_support'
require 'active_support/all' unless Class.respond_to?(:cattr_accessor)
require 'rails-footnotes/footnotes'
require 'rails-footnotes/abstract_note'
require "rails-footnotes"

class Rails
def self.logger; end

def self.version; '3.0.12'; end
RSpec.configure do |config|
end

RSpec.configure do |config|
module FooBar
class Application < Rails::Application
config.secret_key_base = 'foobar'
end
end

0 comments on commit b020e8f

Please sign in to comment.