Permalink
Browse files

Rails 4 support

  • Loading branch information...
1 parent 3514bbf commit 19aa5ba877055b8ec4a983b4bd2046cdbcadebca @jasoncodes jasoncodes committed Oct 21, 2013
View
@@ -5,3 +5,7 @@ end
appraise 'rails3_2' do
gem 'rails', '~> 3.2.0'
end
+
+appraise 'rails4_0' do
+ gem 'rails', '~> 4.0.2'
+end
View
@@ -74,7 +74,7 @@ def date
delegate :year, :month, :day, :to => :date
def timestamp
- date.to_time_in_current_zone
+ date.respond_to?(:in_time_zone) ? date.in_time_zone : date.to_time_in_current_zone
end
alias_method :last_modified, :timestamp
@@ -0,0 +1,9 @@
+# This file was generated by Appraisal
+
+source "http://rubygems.org"
+
+gem "timecop", :require=>false
+gem "generator_spec", :require=>false
+gem "rails", "~> 4.0.2"
+
+gemspec :path=>"../"
@@ -5,7 +5,7 @@ def postmarkdown(options = {})
options.reverse_merge!({ :as => :posts, :permalink_format => :day })
get "/#{options[:as]}(/:year(/:month(/:day)))" => 'posts#index', :as => :posts, :constraints => { :year => /\d{4}/, :month => /\d{2}/, :day => /\d{2}/}
- get "/#{options[:as]}/feed" => 'posts#feed', :as => :posts_feed, :format => :xml
+ get "/#{options[:as]}/feed" => 'posts#feed', :as => :posts_feed, :defaults => {:format => :xml}
get "/#{options[:as]}/*id" => 'posts#show', :as => :post, :constraints => { :id => postmarkdown_permalink_regex(options) }
postmarkdown_feed_title(options[:as])
View
@@ -21,7 +21,7 @@ Gem::Specification.new do |s|
s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
s.require_paths = ['lib', 'public']
- s.add_dependency 'rails', '~> 3.1'
+ s.add_dependency 'rails', ['>= 3.1', '< 5.0']
s.add_dependency 'haml', ['>= 3.1', '< 5']
s.add_dependency 'gravtastic'
s.add_dependency 'nokogiri'
@@ -1,8 +1,11 @@
Rails.application.class.configure do
config.cache_classes = true
- config.whiny_nils = true
+ config.whiny_nils = true if Rails::VERSION::MAJOR < 4
+ config.secret_key_base = 'abc123' if Rails::VERSION::MAJOR >= 4
+ config.eager_load = false
config.consider_all_requests_local = true
config.action_controller.perform_caching = false
config.action_dispatch.show_exceptions = false
config.active_support.deprecation = :stderr
+ config.i18n.enforce_available_locales = true if I18n.respond_to? :enforce_available_locales
end

0 comments on commit 19aa5ba

Please sign in to comment.