popper 0.2.5 → 0.2.7
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -0
- data/lib/popper/config.rb +6 -2
- data/lib/popper/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: f64201dd6c0c81cd7d7b23f2c87af9718ab3d2f5
|
4
|
+
data.tar.gz: 3c5af5b41d7deb61259915fbf9927209bd2fc71e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c7e30f24d3988c9198d4df617524dbda7ed85ea03dc3451db2874e7968f907512505f822c07366dac8b4119373e1043699fcfb8b3d5252d3c9454e67c15d743e
|
7
|
+
data.tar.gz: 479d39bb69090f99444153fa55c96c0c5d44a0e4434841a7f95f32f232777f95b165e42af45e3522bee94b277a0cd3088ce5bab4cc93e7499b7de1a5517c1ba1
|
data/README.md
CHANGED
data/lib/popper/config.rb
CHANGED
@@ -6,8 +6,12 @@ module Popper
|
|
6
6
|
attr_reader :global, :default, :accounts
|
7
7
|
def initialize(config_path)
|
8
8
|
raise "configure not fond #{config_path}" unless File.exist?(config_path)
|
9
|
-
|
10
9
|
config = TOML.load_file(config_path)
|
10
|
+
if config.key?("include")
|
11
|
+
content = config["include"].map {|p| Dir.glob(p).map {|f|File.read(f)}}.join("\n")
|
12
|
+
config.deep_merge!(TOML::Parser.new(content).parsed)
|
13
|
+
end
|
14
|
+
|
11
15
|
@global = AccountAttributes.new(config["global"]) if config["global"]
|
12
16
|
@default = AccountAttributes.new(config["default"]) if config["default"]
|
13
17
|
@accounts = []
|
@@ -15,7 +19,7 @@ module Popper
|
|
15
19
|
config.select {|k,v| !%w(default global).include?(k) }.each do |account|
|
16
20
|
_account = AccountAttributes.new(account[1])
|
17
21
|
_account.name = account[0]
|
18
|
-
|
22
|
+
self.accounts << _account
|
19
23
|
end
|
20
24
|
end
|
21
25
|
|
data/lib/popper/version.rb
CHANGED