greased-rails 0.0.11 → 0.0.12

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.
@@ -14,7 +14,6 @@ Gem::Specification.new do |gem|
14
14
 
15
15
  gem.add_dependency "activesupport", ">= 3.2.0"
16
16
  gem.add_dependency "railties", ">= 3.2.0"
17
- gem.add_dependency "minigit", ">= 0.0.3"
18
17
  #figaro
19
18
 
20
19
  gem.files = `git ls-files`.split($/)
@@ -8,7 +8,7 @@ module Greased
8
8
  attr_accessor :app, :env, :groups
9
9
 
10
10
  def initialize(application, options = {})
11
- @options = Options.default_options.merge(options)
11
+ @options = Options.defaults.merge(options)
12
12
  @app = application#@options[:app]
13
13
  @env = @options[:env]
14
14
  @groups = @options[:groups]
@@ -18,38 +18,26 @@ module Greased
18
18
  ENV_VARS_FILENAME_BASE = "variables.yml"
19
19
  ENV_VARS_FILENAME = "greased_#{ENV_VARS_FILENAME_BASE}"
20
20
  # options to load from YAML
21
- CONFIG_FILENAME = "greased.yml"
22
- DEFAULT_CONFIG_FILENAME = Greased.file_path(File.dirname(__FILE__), '..', '..', 'templates', CONFIG_FILENAME)
21
+ OPTIONS_FILENAME = "greased.yml"
22
+ DEFAULT_OPTIONS_FILE = Greased.file_path(File.dirname(__FILE__), '..', '..', 'templates', OPTIONS_FILENAME)
23
23
  # default Greased template with application settings
24
24
  DEFAULT_SETTINGS_FILE = Greased.file_path(File.dirname(__FILE__), '..', '..', 'templates', APP_SETTINGS_FILENAME)
25
25
  DEFAULT_ENV = "development"
26
26
 
27
27
  class << self
28
28
 
29
- def default_config
30
- load_options(DEFAULT_CONFIG_FILENAME)
29
+ def defaults
30
+ load_options(DEFAULT_OPTIONS_FILE).deep_merge!(:app_filename => DEFAULT_SETTINGS_FILE)
31
31
  end
32
32
 
33
- def default_options
34
- default_config[:options].deep_merge!(:app_filename => DEFAULT_SETTINGS_FILE)
35
- end
36
-
37
- def find(path, options = {})
33
+ def find(path)
38
34
  #Greased.logger.debug "Find application options in: #{path}"
39
35
 
40
- merged_options = default_options
36
+ options = defaults
41
37
 
42
38
  if Dir.exists? path
43
- # load custom config
44
- config = load_options([
45
- Greased.file_path(path, CONFIG_FILENAME),
46
- Greased.file_path(path, "greased", CONFIG_FILENAME),
47
- Greased.file_path(path, "config", CONFIG_FILENAME),
48
- Greased.file_path(path, "config", "greased", CONFIG_FILENAME)
49
- ])
50
-
51
39
  # load rails defaults
52
- default_paths = {
40
+ options = merge_options options, {
53
41
  #:env => ::Rails.env || DEFAULT_ENV,
54
42
  #:groups => ["application"],
55
43
  :app_filename => [
@@ -71,14 +59,17 @@ module Greased
71
59
  Greased.file_path(path, "config", ENV_VARS_FILENAME),
72
60
  Greased.file_path(path, "config", "greased", ENV_VARS_FILENAME_BASE)
73
61
  ]
74
- }
75
-
76
- # use custom options
77
- merged_options = merge_options(merged_options, default_paths, config[:options])
78
-
62
+ },
63
+ # load custom options
64
+ load_options([
65
+ Greased.file_path(path, OPTIONS_FILENAME),
66
+ Greased.file_path(path, "greased", OPTIONS_FILENAME),
67
+ Greased.file_path(path, "config", OPTIONS_FILENAME),
68
+ Greased.file_path(path, "config", "greased", OPTIONS_FILENAME)
69
+ ])
79
70
  end
80
71
 
81
- merged_options.merge(options)
72
+ options
82
73
  end
83
74
 
84
75
  protected
@@ -1,5 +1,5 @@
1
1
  module Greased
2
2
  module Rails
3
- VERSION = "0.0.11"
3
+ VERSION = "0.0.12"
4
4
  end
5
5
  end
@@ -1,19 +1,19 @@
1
- options:
2
- # Where to look for the environment settings file(s).
3
- # By default, Greased will try several file path permuations to find the file dynamically.
4
- # app_filename: <%= File.join(Rails.root, 'greased_settings.yml') %>
5
-
6
- # Where to look for the environment settings override file(s).
7
- # By default, Greased will try several file path permuations to find the file dynamically.
8
- # partial_filename: <%= File.join(Rails.root, 'greased_partial.yml') %>
9
-
10
- # Where to look for the environment variable file(s).
11
- # By default, Greased will try several file path permuations to find the file dynamically.
12
- # env_filename: <%= File.join(Rails.root, 'greased_variables.yml') %>
13
-
14
- # Envirionment (e.g. development, staging, production)
15
- env: <%= ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development" %>
16
-
17
- # Groups within the environment variables to load up.
18
- groups: ["application"]
19
-
1
+
2
+ # Where to look for the environment settings file(s).
3
+ # By default, Greased will try several file path permuations to find the file dynamically.
4
+ # app_filename: <%= File.join(Rails.root, 'greased_settings.yml') %>
5
+
6
+ # Where to look for the environment settings override file(s).
7
+ # By default, Greased will try several file path permuations to find the file dynamically.
8
+ # partial_filename: <%= File.join(Rails.root, 'greased_partial.yml') %>
9
+
10
+ # Where to look for the environment variable file(s).
11
+ # By default, Greased will try several file path permuations to find the file dynamically.
12
+ # env_filename: <%= File.join(Rails.root, 'greased_variables.yml') %>
13
+
14
+ # Envirionment (e.g. development, staging, production)
15
+ env: <%= ENV['RAILS_ENV'] || ENV['RACK_ENV'] || "development" %>
16
+
17
+ # Groups within the environment variables to load up.
18
+ groups: ["application"]
19
+
@@ -18,6 +18,9 @@ defaults: &defaults
18
18
  # suppose you want to use all defaults in greased_settings.yml
19
19
  # and only change the SSL settings for all environments
20
20
  force_ssl: true
21
+ # eager load lib directory in threadsafe mode
22
+ # eager_load_paths +=:
23
+ # - "<%= Rails.root %>/lib"
21
24
 
22
25
  development:
23
26
  <<: *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.11
4
+ version: 0.0.12
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-04-15 00:00:00.000000000 Z
12
+ date: 2013-04-16 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: activesupport
@@ -43,22 +43,6 @@ dependencies:
43
43
  - - ! '>='
44
44
  - !ruby/object:Gem::Version
45
45
  version: 3.2.0
46
- - !ruby/object:Gem::Dependency
47
- name: minigit
48
- requirement: !ruby/object:Gem::Requirement
49
- none: false
50
- requirements:
51
- - - ! '>='
52
- - !ruby/object:Gem::Version
53
- version: 0.0.3
54
- type: :runtime
55
- prerelease: false
56
- version_requirements: !ruby/object:Gem::Requirement
57
- none: false
58
- requirements:
59
- - - ! '>='
60
- - !ruby/object:Gem::Version
61
- version: 0.0.3
62
46
  description: Reusable default application settings, environment variables, and deployment
63
47
  tasks.
64
48
  email: