Configuration with confstruct

openid
Marcin Kulik 13 years ago
parent efff8e765d
commit eecd3b3917

1
.gitignore vendored

@ -16,3 +16,4 @@ config/*.yml
rerun.txt
pickle-email-*.html
.jhw-cache/
config/local.yml

@ -5,6 +5,7 @@ gem 'jquery-rails'
gem 'mysql2'
gem 'tzinfo'
gem 'carrierwave'
gem 'confstruct'
# Gems used only for assets and not required
# in production environments by default.

@ -49,6 +49,7 @@ GEM
coffee-script-source
execjs
coffee-script-source (1.2.0)
confstruct (0.2.1)
diff-lcs (1.1.3)
erubis (2.7.0)
execjs (1.3.0)
@ -167,6 +168,7 @@ DEPENDENCIES
capybara
carrierwave
coffee-rails
confstruct
factory_girl_rails
guard
guard-jasmine

@ -7,7 +7,7 @@ class BasicUploader < CarrierWave::Uploader::Base
# include CarrierWave::MiniMagick
# Choose what kind of storage to use for this uploader:
storage :file
storage CFG.carrierwave_storage
# storage :fog
# Override the directory where uploaded files will be stored.

@ -15,6 +15,8 @@ if defined?(Bundler)
# Bundler.require(:default, :assets, Rails.env)
end
require_relative 'confstruct'
module AsciiIo
class Application < Rails::Application
# Settings in config/environments/* take precedence over those specified here.

@ -0,0 +1,9 @@
app_cfg_file = File.expand_path(File.dirname(__FILE__) + '/app.yml')
cfg_hash = YAML.load_file(app_cfg_file)[Rails.env]
local_cfg_file = File.expand_path(File.dirname(__FILE__) + '/local.yml')
local_hash = YAML.load_file(local_cfg_file)[Rails.env] rescue {}
cfg_hash.merge!(local_hash)
CFG = Confstruct::Configuration.new(cfg_hash)
Loading…
Cancel
Save