a9n 0.0.8 → 0.0.9

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.
Files changed (5) hide show
  1. checksums.yaml +7 -0
  2. data/README.md +2 -1
  3. data/lib/a9n.rb +9 -4
  4. data/lib/a9n/version.rb +1 -1
  5. metadata +7 -9
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: b01b4015b7d9a3157c912da8f054f929ce060aab
4
+ data.tar.gz: cbc3a39746c6ffd37bc49f730a0498ca97fcdbc3
5
+ SHA512:
6
+ metadata.gz: 750f4617aee328ec0c82c02c49f1f0d48712f348de21f1b466097d64dd0299684d35452d12f75b1f23c74ee44e8195f052b41b21551dac1b3ed221ca0eaf3f6f
7
+ data.tar.gz: e9eda5c59a356523a20a03a141bf6a20f2f1d29c4c8907d7e153f87c0f9198f0a87561d0355531f1f88c8d93fcaaa82e7e30576ef860faa2161225aa96491cf5
data/README.md CHANGED
@@ -22,9 +22,10 @@ all keys existing in example file must exist in base file - in case of missing
22
22
  keys`A9n::MissingConfigurationVariables` is thrown with information about
23
23
  missing keys.
24
24
 
25
- Load configuration by adding to your `application.rb` or `environment.rb` right
25
+ Set application root and load configuration by adding to your `application.rb` or `environment.rb` right
26
26
  after budler requires:
27
27
 
28
+ A9n.root = File.expand_path('../..', __FILE__)
28
29
  A9n.load
29
30
 
30
31
  This step is not required, but recommended, as it configuration is loaded and
data/lib/a9n.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'a9n/version'
2
2
  require 'a9n/struct'
3
3
  require 'a9n/core_ext/hash'
4
+ require 'yaml'
4
5
 
5
6
  module A9n
6
7
  class ConfigurationNotLoaded < StandardError; end
@@ -16,9 +17,13 @@ module A9n
16
17
  end
17
18
 
18
19
  def env
19
- @env ||= ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['APP_ENV']
20
+ @env ||= local_app_env || ENV['RAILS_ENV'] || ENV['RACK_ENV'] || ENV['APP_ENV']
20
21
  end
21
-
22
+
23
+ def local_app_env
24
+ local_app.env if local_app && local_app.respond_to?(:env)
25
+ end
26
+
22
27
  def local_app
23
28
  @local_app ||= get_rails
24
29
  end
@@ -28,7 +33,7 @@ module A9n
28
33
  end
29
34
 
30
35
  def root
31
- @root ||= @local_app.root
36
+ @root ||= local_app.root
32
37
  end
33
38
 
34
39
  def root=(path)
@@ -89,4 +94,4 @@ module A9n
89
94
  defined?(Rails) ? Rails : nil
90
95
  end
91
96
  end
92
- end
97
+ end
@@ -1,3 +1,3 @@
1
1
  module A9n
2
- VERSION = "0.0.8"
2
+ VERSION = "0.0.9"
3
3
  end
metadata CHANGED
@@ -1,15 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: a9n
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.8
5
- prerelease:
4
+ version: 0.0.9
6
5
  platform: ruby
7
6
  authors:
8
7
  - Krzysztof Knapik
9
8
  autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2013-02-20 00:00:00.000000000 Z
11
+ date: 2013-06-05 00:00:00.000000000 Z
13
12
  dependencies: []
14
13
  description: Simple tool for managing app configuration
15
14
  email:
@@ -35,27 +34,26 @@ files:
35
34
  - spec/struct_spec.rb
36
35
  homepage: https://github.com/knapo/a9n
37
36
  licenses: []
37
+ metadata: {}
38
38
  post_install_message:
39
39
  rdoc_options: []
40
40
  require_paths:
41
41
  - lib
42
42
  required_ruby_version: !ruby/object:Gem::Requirement
43
- none: false
44
43
  requirements:
45
- - - ! '>='
44
+ - - '>='
46
45
  - !ruby/object:Gem::Version
47
46
  version: '0'
48
47
  required_rubygems_version: !ruby/object:Gem::Requirement
49
- none: false
50
48
  requirements:
51
- - - ! '>='
49
+ - - '>='
52
50
  - !ruby/object:Gem::Version
53
51
  version: '0'
54
52
  requirements: []
55
53
  rubyforge_project:
56
- rubygems_version: 1.8.24
54
+ rubygems_version: 2.0.3
57
55
  signing_key:
58
- specification_version: 3
56
+ specification_version: 4
59
57
  summary: Simple tool for managing app configuration
60
58
  test_files:
61
59
  - spec/a9n_spec.rb