Skip to content

Commit

Permalink
Merge pull request refinery#1463 from resolve/less_rails
Browse files Browse the repository at this point in the history
Reduced dependencies on the full rails stack.
  • Loading branch information
ugisozols committed Mar 19, 2012
2 parents 914826e + c6b769e commit ee693c8
Show file tree
Hide file tree
Showing 6 changed files with 22 additions and 3 deletions.
5 changes: 4 additions & 1 deletion Gemfile
Expand Up @@ -5,6 +5,9 @@ gemspec
# Add i18n support.
gem 'refinerycms-i18n', '~> 2.1.0.dev', :git => 'git://github.com/parndt/refinerycms-i18n.git'

# Temporarily use a custom branch for paper_trail (used by globalize3, used by refinerycms-pages)
gem 'paper_trail', :git => 'git://github.com/parndt/paper_trail.git', :branch => 'less_rails'

# Database Configuration
platforms :jruby do
gem 'activerecord-jdbcsqlite3-adapter'
Expand All @@ -21,7 +24,7 @@ end

group :development, :test do
gem 'refinerycms-testing', '~> 2.1.0.dev'
gem 'generator_spec', '>= 0.8.5'
gem 'generator_spec', '>= 0.8.5', :git => 'git://github.com/stevehodgkiss/generator_spec.git'
gem 'guard-rspec', '~> 0.6.0'
gem 'fuubar'

Expand Down
1 change: 1 addition & 0 deletions authentication/lib/refinery/authentication.rb
@@ -1,4 +1,5 @@
require 'refinerycms-core'
require 'action_mailer'
require 'devise'
require 'friendly_id'

Expand Down
2 changes: 2 additions & 0 deletions authentication/refinerycms-authentication.gemspec
Expand Up @@ -3,6 +3,7 @@ $:.push File.expand_path('../../core/lib', __FILE__)
require 'refinery/version'

version = Refinery::Version.to_s
rails_version = ['>= 3.1.3', '< 3.3']

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
Expand All @@ -21,5 +22,6 @@ Gem::Specification.new do |s|
s.test_files = `git ls-files -- spec/*`.split("\n")

s.add_dependency 'refinerycms-core', version
s.add_dependency 'actionmailer', rails_version
s.add_dependency 'devise', '~> 2.0.0'
end
8 changes: 8 additions & 0 deletions core/lib/generators/refinery/cms/cms_generator.rb
Expand Up @@ -153,6 +153,14 @@ def ensure_environments_are_sane!
%w(development test production).map{|e| "config/environments/#{e}.rb"}.each do |env|
next unless destination_path.join(env).file?

# Refinery does not necessarily expect action_mailer to be available as
# we may not always require it (currently only the authentication extension).
# Rails, however, will optimistically place config entries for action_mailer.
insert_into_file env, " if config.respond_to?(:action_mailer)\n ",
:before => %r{^[^#]+config\.action_mailer\.}, :verbose => false
insert_into_file env, "\n end",
:after => %r{^[^#]+config\.action_mailer\..*}, :verbose => false

gsub_file env, "config.assets.compile = false", "config.assets.compile = true", :verbose => false

insert_into_file env, %Q{
Expand Down
4 changes: 3 additions & 1 deletion core/lib/refinery/core.rb
@@ -1,4 +1,6 @@
require 'rails/all'
require 'rails' # from railties
require 'active_record'
require 'action_controller'
require 'rbconfig'
require 'acts_as_indexed'
require 'truncate_html'
Expand Down
5 changes: 4 additions & 1 deletion core/refinerycms-core.gemspec
Expand Up @@ -3,6 +3,7 @@ $:.push File.expand_path('../../core/lib', __FILE__)
require 'refinery/version'

version = Refinery::Version.to_s
rails_version = ['>= 3.1.3', '< 3.3']

Gem::Specification.new do |s|
s.platform = Gem::Platform::RUBY
Expand All @@ -24,7 +25,9 @@ Gem::Specification.new do |s|
s.add_dependency 'friendly_id', '~> 4.0.1'
s.add_dependency 'globalize3', '~> 0.2.0'
s.add_dependency 'awesome_nested_set', '~> 2.1.0'
s.add_dependency 'rails', ['>= 3.1.3', '< 3.3']
s.add_dependency 'railties', rails_version
s.add_dependency 'activerecord', rails_version
s.add_dependency 'actionpack', rails_version
s.add_dependency 'truncate_html', '~> 0.5'
s.add_dependency 'will_paginate', '~> 3.0.2'
s.add_dependency 'sass-rails', '~> 3.2.3'
Expand Down

0 comments on commit ee693c8

Please sign in to comment.