modify the way locomotive setups a mongo connection
This commit is contained in:
parent
9f20f56b1d
commit
3d22ef4d1c
2
.gitignore
vendored
2
.gitignore
vendored
@ -8,6 +8,8 @@ uploads
|
|||||||
spec/tmp
|
spec/tmp
|
||||||
public/sites
|
public/sites
|
||||||
public/uploads
|
public/uploads
|
||||||
|
public/stylesheets/all.css
|
||||||
|
public/javascripts/all.js
|
||||||
pkg
|
pkg
|
||||||
*.gemspec
|
*.gemspec
|
||||||
rails_3_gems
|
rails_3_gems
|
||||||
|
1
Gemfile
1
Gemfile
@ -13,6 +13,7 @@ gem "warden"
|
|||||||
gem "devise", ">= 1.1.rc0"
|
gem "devise", ">= 1.1.rc0"
|
||||||
gem "haml", '>= 3.0.1'
|
gem "haml", '>= 3.0.1'
|
||||||
gem "rmagick"
|
gem "rmagick"
|
||||||
|
gem "aws"
|
||||||
gem "jeweler"
|
gem "jeweler"
|
||||||
gem "mimetype-fu", :require => "mimetype_fu"
|
gem "mimetype-fu", :require => "mimetype_fu"
|
||||||
gem "formtastic-rails3", :require => "formtastic"
|
gem "formtastic-rails3", :require => "formtastic"
|
||||||
|
7
Rakefile
7
Rakefile
@ -14,16 +14,16 @@ begin
|
|||||||
Jeweler::Tasks.new do |gem|
|
Jeweler::Tasks.new do |gem|
|
||||||
gem.name = "locomotive_cms"
|
gem.name = "locomotive_cms"
|
||||||
gem.summary = "Locomotive cms engine"
|
gem.summary = "Locomotive cms engine"
|
||||||
gem.author = ['Didier Lafforgue']
|
gem.authors = ['Didier Lafforgue']
|
||||||
gem.email = ["didier@nocoffee.fr"]
|
gem.email = ['didier@nocoffee.fr']
|
||||||
gem.date = Date.today
|
gem.date = Date.today
|
||||||
gem.description = "a brand new CMS system with super sexy UI and cool features"
|
gem.description = "a brand new CMS system with super sexy UI and cool features"
|
||||||
gem.homepage = %q{http://github.com/did/locomotive}
|
gem.homepage = %q{http://github.com/did/locomotive}
|
||||||
gem.files = Dir[
|
gem.files = Dir[
|
||||||
"Gemfile",
|
"Gemfile",
|
||||||
"{lib}/**/*",
|
|
||||||
"{app}/**/*",
|
"{app}/**/*",
|
||||||
"{config}/**/*",
|
"{config}/**/*",
|
||||||
|
"{lib}/**/*",
|
||||||
"{public}/stylesheets/**/*", "{public}/javascripts/**/*", "{public}/images/**/*",
|
"{public}/stylesheets/**/*", "{public}/javascripts/**/*", "{public}/images/**/*",
|
||||||
"{vendor}/**/*"]
|
"{vendor}/**/*"]
|
||||||
# other fields that would normally go in your gemspec
|
# other fields that would normally go in your gemspec
|
||||||
@ -35,6 +35,7 @@ begin
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
Jeweler::GemcutterTasks.new
|
||||||
rescue
|
rescue
|
||||||
puts "Jeweler or one of its dependencies is not installed."
|
puts "Jeweler or one of its dependencies is not installed."
|
||||||
end
|
end
|
||||||
|
@ -4,19 +4,9 @@ File.open(File.join(Rails.root, 'config/database.yml'), 'r') do |f|
|
|||||||
@settings = YAML.load(f)[Rails.env]
|
@settings = YAML.load(f)[Rails.env]
|
||||||
end
|
end
|
||||||
|
|
||||||
Mongoid.configure do |config|
|
Mongoid::Config.instance.from_hash(@settings)
|
||||||
name = @settings["database"]
|
|
||||||
host = @settings["host"]
|
|
||||||
config.master = Mongo::Connection.new.db(name)
|
|
||||||
# config.slaves = [
|
|
||||||
# Mongo::Connection.new(host, @settings["slave_one"]["port"], :slave_ok => true).db(name),
|
|
||||||
# Mongo::Connection.new(host, @settings["slave_two"]["port"], :slave_ok => true).db(name)
|
|
||||||
# ]
|
|
||||||
end
|
|
||||||
|
|
||||||
## various patches
|
## various patches
|
||||||
|
|
||||||
|
|
||||||
module Mongoid #:nodoc:
|
module Mongoid #:nodoc:
|
||||||
|
|
||||||
# Enabling scope in validates_uniqueness_of validation
|
# Enabling scope in validates_uniqueness_of validation
|
||||||
|
@ -17,21 +17,5 @@ module Locomotive
|
|||||||
ActionController::Base.helpers_path = path
|
ActionController::Base.helpers_path = path
|
||||||
end
|
end
|
||||||
|
|
||||||
# initializer "locomotive.require_dependencies", :after => :initialize_dependency_mechanism do
|
|
||||||
# require 'bundler'
|
|
||||||
# gemfile = Bundler::Definition.from_gemfile(root.join('Gemfile'))
|
|
||||||
#
|
|
||||||
# specs = gemfile.dependencies.select do |d|
|
|
||||||
# !%w{jeweler rails}.include?(d.name) and (d.groups & [:default, :production]).any?
|
|
||||||
# end
|
|
||||||
# specs.collect { |s| s.autorequire || [s.name] }.flatten.each do |r|
|
|
||||||
# puts "requiring #{r}"
|
|
||||||
# require r
|
|
||||||
# end
|
|
||||||
#
|
|
||||||
# # gemify it soon
|
|
||||||
# require File.dirname(__FILE__) + '/../../vendor/plugins/custom_fields/init.rb'
|
|
||||||
# end
|
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
end
|
Loading…
Reference in New Issue
Block a user