greased-rails 0.0.4 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
data/README.md
CHANGED
@@ -25,19 +25,29 @@ There are two configuration files you can create (optional):
|
|
25
25
|
* greased_settings.yml (serialized application settings)
|
26
26
|
* greased_variables.yml (serialized ENV variables)
|
27
27
|
|
28
|
-
You can see what they look like in the "
|
28
|
+
You can see what they look like in the "templates" folder.
|
29
29
|
|
30
30
|
### Application Settings - greased_settings.yml
|
31
31
|
|
32
|
-
This is a YAML serialization of most settings that you would find in "
|
32
|
+
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.
|
33
33
|
|
34
|
-
|
34
|
+
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:
|
35
|
+
|
36
|
+
* greased_settings.yml (in the root of your Rails application)
|
37
|
+
* greased/settings.yml
|
38
|
+
* config/greased_settings.yml
|
39
|
+
* config/greased/settings.yml
|
35
40
|
|
36
41
|
### Environment Variables - greased_variables.yml
|
37
42
|
|
38
43
|
This is a YAML serialization of your environment variables. You can easily share environment variables across environments.
|
39
44
|
|
40
|
-
|
45
|
+
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:
|
46
|
+
|
47
|
+
* greased_variables.yml (in the root of your Rails application)
|
48
|
+
* greased/variables.yml
|
49
|
+
* config/greased_variables.yml
|
50
|
+
* config/greased/variables.yml
|
41
51
|
|
42
52
|
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.
|
43
53
|
|
data/lib/greased/applicator.rb
CHANGED
@@ -5,10 +5,12 @@ require 'active_support/core_ext/hash/deep_merge'
|
|
5
5
|
module Greased
|
6
6
|
class Applicator
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
8
|
+
APP_SETTINGS_FILENAME_BASE = "settings.yml"
|
9
|
+
APP_SETTINGS_FILENAME = "greased_#{APP_SETTINGS_FILENAME_BASE}"
|
10
|
+
ENV_VARS_FILENAME_BASE = "variables.yml"
|
11
|
+
ENV_VARS_FILENAME = "greased_#{ENV_VARS_FILENAME_BASE}"
|
12
|
+
DEFAULT_SETTINGS_FILE = Pathname.new(File.join(File.dirname(__FILE__), '..', '..', 'templates', APP_SETTINGS_FILENAME)).realpath
|
13
|
+
DEFAULT_ENV = "development"
|
12
14
|
|
13
15
|
def self.default_options
|
14
16
|
{
|
@@ -27,8 +29,19 @@ module Greased
|
|
27
29
|
:app => ::Rails.application,
|
28
30
|
#:env => ::Rails.env || DEFAULT_ENV,
|
29
31
|
#:groups => ["application"],
|
30
|
-
:app_filename => [
|
31
|
-
|
32
|
+
:app_filename => [
|
33
|
+
File.join(::Rails.root, APP_SETTINGS_FILENAME),
|
34
|
+
File.join(::Rails.root, "greased", APP_SETTINGS_FILENAME_BASE),
|
35
|
+
File.join(::Rails.root, "config", APP_SETTINGS_FILENAME),
|
36
|
+
File.join(::Rails.root, "config", "greased", APP_SETTINGS_FILENAME_BASE),
|
37
|
+
DEFAULT_SETTINGS_FILE
|
38
|
+
],
|
39
|
+
:env_filename => [
|
40
|
+
File.join(::Rails.root, ENV_VARS_FILENAME),
|
41
|
+
File.join(::Rails.root, "greased", ENV_VARS_FILENAME_BASE),
|
42
|
+
File.join(::Rails.root, "config", ENV_VARS_FILENAME),
|
43
|
+
File.join(::Rails.root, "config", "greased", ENV_VARS_FILENAME_BASE)
|
44
|
+
]
|
32
45
|
)
|
33
46
|
else
|
34
47
|
default_options
|
@@ -50,12 +50,12 @@ defaults: &defaults
|
|
50
50
|
:host: "<%= ENV['APP_HOST'] %>"
|
51
51
|
asset_host: "http://<%= ENV['ASSET_HOST'] %>"
|
52
52
|
smtp_settings:
|
53
|
-
:address: "<%= ENV['
|
54
|
-
:port: "<%= ENV['
|
53
|
+
:address: "<%= ENV['SMTP_HOST'] %>"
|
54
|
+
:port: "<%= ENV['SMTP_PORT'] %>"
|
55
55
|
:authentication: :plain
|
56
|
-
:user_name: "<%= ENV['
|
57
|
-
:password: "<%= ENV['
|
58
|
-
:domain: "<%= ENV['
|
56
|
+
:user_name: "<%= ENV['SMTP_USERNAME'] %>"
|
57
|
+
:password: "<%= ENV['SMTP_PASSWORD'] %>"
|
58
|
+
:domain: "<%= ENV['SMTP_DOMAIN'] %>"
|
59
59
|
action_controller:
|
60
60
|
# Enable serving of images, stylesheets, and JavaScripts from an asset server
|
61
61
|
asset_host: "//<%= ENV['ASSET_HOST'] %>"
|
@@ -71,7 +71,7 @@ defaults: &defaults
|
|
71
71
|
initialize_on_precompile: false
|
72
72
|
# Enable the asset pipeline
|
73
73
|
enabled: true
|
74
|
-
js_compressor: :closure
|
74
|
+
#js_compressor: :closure
|
75
75
|
#css_compressor: :less
|
76
76
|
# Version of your assets, change this if you want to expire all your assets
|
77
77
|
version: '1.0'
|
@@ -20,11 +20,11 @@ defaults: &defaults
|
|
20
20
|
SHADOW_EMAIL: tech@acme.com
|
21
21
|
ENABLE_EMAILS: false
|
22
22
|
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
23
|
+
SMTP_USERNAME: acme
|
24
|
+
SMTP_PASSWORD: *******
|
25
|
+
SMTP_DOMAIN: acme.com
|
26
|
+
SMTP_HOST: smtp.sendgrid.net
|
27
|
+
SMTP_PORT: 587
|
28
28
|
|
29
29
|
development:
|
30
30
|
<<: *defaults
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: greased-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2013-03-
|
12
|
+
date: 2013-03-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activesupport
|
@@ -56,8 +56,6 @@ files:
|
|
56
56
|
- LICENSE.txt
|
57
57
|
- README.md
|
58
58
|
- Rakefile
|
59
|
-
- examples/greased_settings.yml
|
60
|
-
- examples/greased_variables.yml
|
61
59
|
- greased-rails.gemspec
|
62
60
|
- lib/greased-rails.rb
|
63
61
|
- lib/greased/applicator.rb
|
@@ -67,6 +65,8 @@ files:
|
|
67
65
|
- lib/greased/setting.rb
|
68
66
|
- lib/greased/settings.rb
|
69
67
|
- tasks/greased.rake
|
68
|
+
- templates/greased_settings.yml
|
69
|
+
- templates/greased_variables.yml
|
70
70
|
homepage: http://github.com/joelvh/greased-rails
|
71
71
|
licenses: []
|
72
72
|
post_install_message:
|