bragi-app 0.2.5 → 0.2.6
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/app.rb +5 -3
- metadata +21 -8
data/lib/app.rb
CHANGED
@@ -2,10 +2,10 @@
|
|
2
2
|
#
|
3
3
|
# What would your app be without it? Still an app, but without App.
|
4
4
|
module App
|
5
|
-
VERSION = "0.2.
|
5
|
+
VERSION = "0.2.6"
|
6
6
|
HASH_KLASS = Object.const_defined?("HashWithIndifferentAccess") ? HashWithIndifferentAccess : Hash
|
7
7
|
|
8
|
-
@@config =
|
8
|
+
@@config = nil # Initialize.
|
9
9
|
class << self
|
10
10
|
# Returns the application configuration hash, as defined in
|
11
11
|
# "config/app.yml".
|
@@ -22,7 +22,7 @@ module App
|
|
22
22
|
#
|
23
23
|
# App.apis("flickr")
|
24
24
|
def config(*args)
|
25
|
-
read_config
|
25
|
+
read_config
|
26
26
|
@@config if args.empty?
|
27
27
|
args.inject(@@config) { |config, arg| config && config[arg] }
|
28
28
|
end
|
@@ -39,6 +39,8 @@ module App
|
|
39
39
|
end
|
40
40
|
|
41
41
|
def read_config
|
42
|
+
return if @@config
|
43
|
+
@@config = HASH_KLASS.new
|
42
44
|
begin
|
43
45
|
raw = File.read Rails.root.join("config", "#{name.underscore}.yml")
|
44
46
|
all = HASH_KLASS.new.merge(YAML.load ERB.new(raw).result)
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bragi-app
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 0
|
7
|
+
- 2
|
8
|
+
- 6
|
9
|
+
version: 0.2.6
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Stephen Celis
|
@@ -15,14 +20,18 @@ default_executable:
|
|
15
20
|
dependencies:
|
16
21
|
- !ruby/object:Gem::Dependency
|
17
22
|
name: hoe
|
18
|
-
|
19
|
-
|
20
|
-
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
prerelease: false
|
24
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
21
25
|
requirements:
|
22
26
|
- - ">="
|
23
27
|
- !ruby/object:Gem::Version
|
28
|
+
segments:
|
29
|
+
- 1
|
30
|
+
- 12
|
31
|
+
- 0
|
24
32
|
version: 1.12.0
|
25
|
-
|
33
|
+
type: :development
|
34
|
+
version_requirements: *id001
|
26
35
|
description: Move the config out of your app, and into App. Sure, it's been done before, and others will do it again, but this is my way, and I like it.
|
27
36
|
email:
|
28
37
|
- stephen@stephencelis.com
|
@@ -50,6 +59,8 @@ files:
|
|
50
59
|
- test/fixtures/app.yml
|
51
60
|
has_rdoc: true
|
52
61
|
homepage: http://github.com/stephencelis/app
|
62
|
+
licenses: []
|
63
|
+
|
53
64
|
post_install_message:
|
54
65
|
rdoc_options:
|
55
66
|
- --main
|
@@ -60,18 +71,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
60
71
|
requirements:
|
61
72
|
- - ">="
|
62
73
|
- !ruby/object:Gem::Version
|
74
|
+
segments:
|
75
|
+
- 0
|
63
76
|
version: "0"
|
64
|
-
version:
|
65
77
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
78
|
requirements:
|
67
79
|
- - ">="
|
68
80
|
- !ruby/object:Gem::Version
|
81
|
+
segments:
|
82
|
+
- 0
|
69
83
|
version: "0"
|
70
|
-
version:
|
71
84
|
requirements: []
|
72
85
|
|
73
86
|
rubyforge_project: app
|
74
|
-
rubygems_version: 1.3.
|
87
|
+
rubygems_version: 1.3.6
|
75
88
|
signing_key:
|
76
89
|
specification_version: 3
|
77
90
|
summary: Move the config out of your app, and into App
|