Module: ConfigHelpers
- Defined in:
- lib/railsbricks/config_helpers.rb
Constant Summary collapse
- CONFIG_PATH =
".rbricks"
Class Method Summary collapse
Class Method Details
.create_config(app_dir, options = {}) ⇒ Object
8 9 10 11 12 13 14 15 16 |
# File 'lib/railsbricks/config_helpers.rb', line 8 def self.create_config(app_dir, = {}) FileUtils::mkdir_p "#{app_dir}/#{CONFIG_PATH}" = .dup [:email_config][:password] = "******" = .to_json File.open("#{app_dir}/#{CONFIG_PATH}/config", "w") { |f| f.write()} end |
.load_config ⇒ Object
18 19 20 21 22 23 24 25 |
# File 'lib/railsbricks/config_helpers.rb', line 18 def self.load_config config_json = File.read("#{CONFIG_PATH}/config") JSON.parse(config_json) rescue = {} ["rake_command"] = "rake" end |