Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

updated paths and docs

  • Loading branch information...
commit d785fddf64ef7069333deccf2f68eb70909d1c91 1 parent 6b1d828
@joelvh authored
View
18 README.md
@@ -25,19 +25,29 @@ There are two configuration files you can create (optional):
* greased_settings.yml (serialized application settings)
* greased_variables.yml (serialized ENV variables)
-You can see what they look like in the "examples" folder.
+You can see what they look like in the "templates" folder.
### Application Settings - greased_settings.yml
-This is a YAML serialization of most settings that you would find in "/app/config/application.rb" and "config/environments/*.rb". What's nice is that you can easily view settings for each environment in one file and allow them to inherit from eachother.
+This is a YAML serialization of most settings that you would find in "config/application.rb" and "config/environments/*.rb". What's nice is that you can easily view settings for each environment in one file and allow them to inherit from eachother.
-You can save your "greased_settings.yaml" file in the root of your Rails application or in the "config" folder. If you don't create your own file, Greased will use the file in the "examples" folder of this gem.
+If you don't create your own file, Greased will use the file in the "templates" folder of this gem. To specify your own settings, save your file to one of the following locations:
+
+ * greased_settings.yml (in the root of your Rails application)
+ * greased/settings.yml
+ * config/greased_settings.yml
+ * config/greased/settings.yml
### Environment Variables - greased_variables.yml
This is a YAML serialization of your environment variables. You can easily share environment variables across environments.
-You can save your "greased_settings.yaml" file in the root of your Rails application or in the "config" folder. If you don't create your own file, Greased won't load any environment variables.
+If you don't create your own file, Greased won't load any environment variables. To specify your own settings, save your file to one of the following locations:
+
+ * greased_variables.yml (in the root of your Rails application)
+ * greased/variables.yml
+ * config/greased_variables.yml
+ * config/greased/variables.yml
You can use the "greased:env:dump" Rake task to create *.env files for "development", "staging", and "production". These files can be used by Foreman to load environment variables when you start your Rails server.
View
25 lib/greased/applicator.rb
@@ -5,10 +5,12 @@
module Greased
class Applicator
- APP_SETTINGS_FILENAME = "greased_settings.yml"
- ENV_VARS_FILENAME = "greased_variables.yml"
- DEFAULT_SETTINGS_FILE = Pathname.new(File.join(File.dirname(__FILE__), '../../examples', APP_SETTINGS_FILENAME)).realpath
- DEFAULT_ENV = "development"
+ APP_SETTINGS_FILENAME_BASE = "settings.yml"
+ APP_SETTINGS_FILENAME = "greased_#{APP_SETTINGS_FILENAME_BASE}"
+ ENV_VARS_FILENAME_BASE = "variables.yml"
+ ENV_VARS_FILENAME = "greased_#{ENV_VARS_FILENAME_BASE}"
+ DEFAULT_SETTINGS_FILE = Pathname.new(File.join(File.dirname(__FILE__), '..', '..', 'templates', APP_SETTINGS_FILENAME)).realpath
+ DEFAULT_ENV = "development"
def self.default_options
{
@@ -27,8 +29,19 @@ def self.rails_options
:app => ::Rails.application,
#:env => ::Rails.env || DEFAULT_ENV,
#:groups => ["application"],
- :app_filename => [File.join(::Rails.root, APP_SETTINGS_FILENAME), File.join(::Rails.root, "config", APP_SETTINGS_FILENAME), DEFAULT_SETTINGS_FILE],
- :env_filename => [File.join(::Rails.root, ENV_VARS_FILENAME), File.join(::Rails.root, "config", ENV_VARS_FILENAME)]
+ :app_filename => [
+ File.join(::Rails.root, APP_SETTINGS_FILENAME),
+ File.join(::Rails.root, "greased", APP_SETTINGS_FILENAME_BASE),
+ File.join(::Rails.root, "config", APP_SETTINGS_FILENAME),
+ File.join(::Rails.root, "config", "greased", APP_SETTINGS_FILENAME_BASE),
+ DEFAULT_SETTINGS_FILE
+ ],
+ :env_filename => [
+ File.join(::Rails.root, ENV_VARS_FILENAME),
+ File.join(::Rails.root, "greased", ENV_VARS_FILENAME_BASE),
+ File.join(::Rails.root, "config", ENV_VARS_FILENAME),
+ File.join(::Rails.root, "config", "greased", ENV_VARS_FILENAME_BASE)
+ ]
)
else
default_options
View
12 templates/greased_settings.yml
@@ -50,12 +50,12 @@ defaults: &defaults
:host: "<%= ENV['APP_HOST'] %>"
asset_host: "http://<%= ENV['ASSET_HOST'] %>"
smtp_settings:
- :address: "<%= ENV['SENDGRID_SMTP'] %>"
- :port: "<%= ENV['SENDGRID_SMTP_PORT'] %>"
+ :address: "<%= ENV['SMTP_HOST'] %>"
+ :port: "<%= ENV['SMTP_PORT'] %>"
:authentication: :plain
- :user_name: "<%= ENV['SENDGRID_USERNAME'] %>"
- :password: "<%= ENV['SENDGRID_PASSWORD'] %>"
- :domain: "<%= ENV['SENDGRID_DOMAIN'] %>"
+ :user_name: "<%= ENV['SMTP_USERNAME'] %>"
+ :password: "<%= ENV['SMTP_PASSWORD'] %>"
+ :domain: "<%= ENV['SMTP_DOMAIN'] %>"
action_controller:
# Enable serving of images, stylesheets, and JavaScripts from an asset server
asset_host: "//<%= ENV['ASSET_HOST'] %>"
@@ -71,7 +71,7 @@ defaults: &defaults
initialize_on_precompile: false
# Enable the asset pipeline
enabled: true
- js_compressor: :closure
+ #js_compressor: :closure
#css_compressor: :less
# Version of your assets, change this if you want to expire all your assets
version: '1.0'
View
10 templates/greased_variables.yml
@@ -20,11 +20,11 @@ defaults: &defaults
SHADOW_EMAIL: tech@acme.com
ENABLE_EMAILS: false
- SENDGRID_USERNAME: acme
- SENDGRID_PASSWORD: *******
- SENDGRID_DOMAIN: acme.com
- SENDGRID_SMTP: smtp.sendgrid.net
- SENDGRID_SMTP_PORT: 587
+ SMTP_USERNAME: acme
+ SMTP_PASSWORD: *******
+ SMTP_DOMAIN: acme.com
+ SMTP_HOST: smtp.sendgrid.net
+ SMTP_PORT: 587
development:
<<: *defaults
Please sign in to comment.
Something went wrong with that request. Please try again.