do not run the locomotive core initializer if engine

This commit is contained in:
did 2011-04-06 01:29:11 +02:00
parent 9ec642136f
commit 2cba14afec
5 changed files with 48 additions and 45 deletions

View File

@ -8,7 +8,7 @@ gem 'warden'
gem 'devise', '= 1.1.3'
gem 'mongoid', '2.0.0.rc.7'
gem 'bson_ext', '~> 1.2.1'
gem 'bson_ext', '~> 1.3.0'
gem 'locomotive_mongoid_acts_as_tree', '0.1.5.5', :require => 'mongoid_acts_as_tree'
gem 'will_paginate'
@ -32,6 +32,7 @@ gem 'delayed_job', '2.1.4'
gem 'delayed_job_mongoid', '1.0.2'
gem 'rubyzip'
gem 'locomotive_jammit-s3', :require => 'jammit-s3'
gem 'SystemTimer', :platforms => :ruby_18
# The rest of the dependencies are for use when in the locomotive dev environment

View File

@ -26,41 +26,42 @@ GEM
open4
Platform (0.4.0)
RedCloth (4.2.7)
SystemTimer (1.2.3)
ZenTest (4.5.0)
abstract (1.0.0)
actionmailer (3.0.5)
actionpack (= 3.0.5)
actionmailer (3.0.6)
actionpack (= 3.0.6)
mail (~> 2.2.15)
actionpack (3.0.5)
activemodel (= 3.0.5)
activesupport (= 3.0.5)
actionpack (3.0.6)
activemodel (= 3.0.6)
activesupport (= 3.0.6)
builder (~> 2.1.2)
erubis (~> 2.6.6)
i18n (~> 0.4)
i18n (~> 0.5.0)
rack (~> 1.2.1)
rack-mount (~> 0.6.13)
rack-mount (~> 0.6.14)
rack-test (~> 0.5.7)
tzinfo (~> 0.3.23)
activemodel (3.0.5)
activesupport (= 3.0.5)
activemodel (3.0.6)
activesupport (= 3.0.6)
builder (~> 2.1.2)
i18n (~> 0.4)
activerecord (3.0.5)
activemodel (= 3.0.5)
activesupport (= 3.0.5)
i18n (~> 0.5.0)
activerecord (3.0.6)
activemodel (= 3.0.6)
activesupport (= 3.0.6)
arel (~> 2.0.2)
tzinfo (~> 0.3.23)
activeresource (3.0.5)
activemodel (= 3.0.5)
activesupport (= 3.0.5)
activesupport (3.0.5)
activeresource (3.0.6)
activemodel (= 3.0.6)
activesupport (= 3.0.6)
activesupport (3.0.6)
archive-tar-minitar (0.5.2)
arel (2.0.9)
autotest (4.4.6)
ZenTest (>= 4.4.1)
bcrypt-ruby (2.1.4)
bson (1.3.0)
bson_ext (1.2.4)
bson_ext (1.3.0)
builder (2.1.2)
bushido (0.0.12)
highline (>= 1.6.1)
@ -195,17 +196,17 @@ GEM
rack (>= 1.0.0)
rack-test (0.5.7)
rack (>= 1.0)
rails (3.0.5)
actionmailer (= 3.0.5)
actionpack (= 3.0.5)
activerecord (= 3.0.5)
activeresource (= 3.0.5)
activesupport (= 3.0.5)
rails (3.0.6)
actionmailer (= 3.0.6)
actionpack (= 3.0.6)
activerecord (= 3.0.6)
activeresource (= 3.0.6)
activesupport (= 3.0.6)
bundler (~> 1.0)
railties (= 3.0.5)
railties (3.0.5)
actionpack (= 3.0.5)
activesupport (= 3.0.5)
railties (= 3.0.6)
railties (3.0.6)
actionpack (= 3.0.6)
activesupport (= 3.0.6)
rake (>= 0.8.7)
thor (~> 0.14.4)
rake (0.8.7)
@ -271,10 +272,11 @@ PLATFORMS
DEPENDENCIES
RedCloth (= 4.2.7)
SystemTimer
ZenTest
actionmailer_with_request!
autotest
bson_ext (~> 1.2.1)
bson_ext (~> 1.3.0)
bushido
capybara
cucumber (= 0.8.5)

View File

@ -7,16 +7,16 @@ Locomotive.configure do |config|
# your own domain name (ex: locomotivehosting.com).
#
# Ex:
config.multi_sites do |multi_sites|
# each new website you add will have a default entry based on a subdomain
# and the multi_site_domain value (ex: website_1.locomotivehosting.com).
multi_sites.domain = 'example.com' #'myhostingplatform.com'
# define the reserved subdomains
# Ex:
multi_sites.reserved_subdomains = %w(www admin email blog webmail mail support help site sites)
end
# config.multi_sites = false
# config.multi_sites do |multi_sites|
# # each new website you add will have a default entry based on a subdomain
# # and the multi_site_domain value (ex: website_1.locomotivehosting.com).
# multi_sites.domain = 'example.com' #'myhostingplatform.com'
#
# # define the reserved subdomains
# # Ex:
# multi_sites.reserved_subdomains = %w(www admin email blog webmail mail support help site sites)
# end
config.multi_sites = false
# configure the hosting target for the production environment. Locomotive can be installed in:
# - your own server
@ -60,4 +60,4 @@ Locomotive.configure do |config|
# config.mailer_sender = 'support'
# # => 'support@heroku.com' (Heroku), 'support@bushi.do' (Bushido), 'support@example.com' (Dev) or 'support@<your_hosting_platform>' (Multi-sites)
config.mailer_sender = 'support'
end
end unless Locomotive.engine?

View File

@ -35,6 +35,10 @@ module Locomotive
end
end
def self.engine?
self.const_defined?('Engine')
end
def self.configure
self.config ||= Configuration.new

View File

@ -35,8 +35,6 @@ module Locomotive
self.enhance_site_model_with_heroku
puts "HEROKU NAME = #{self.config.heroku[:name]} / #{ENV['APP_NAME'].inspect} / #{ENV.inspect}"
# "cache" domains for better performance
self.heroku_domains = self.heroku_connection.list_domains(self.config.heroku[:name]).collect { |h| h[:domain] }
end
@ -45,8 +43,6 @@ module Locomotive
login = self.config.heroku[:login] || ENV['HEROKU_LOGIN']
password = self.config.heroku[:password] || ENV['HEROKU_PASSWORD']
puts "LOGIN = #{login} / PASSWORD = #{password}"
self.heroku_connection = ::Heroku::Client.new(login, password)
end