popper 0.2.5 → 0.2.7

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f00b7008ef966d2df6766ef842a17a560cf26b83
4
- data.tar.gz: 0ddadcef3b9fa3513866832e99e74686f567e970
3
+ metadata.gz: f64201dd6c0c81cd7d7b23f2c87af9718ab3d2f5
4
+ data.tar.gz: 3c5af5b41d7deb61259915fbf9927209bd2fc71e
5
5
  SHA512:
6
- metadata.gz: cf618186323477f48b7ecf604cb819b7b30f136ab0bd3bef1ddb929a49a1d437c7263e56a1f48f93d2e2f6fc314766cab30d089820ffcef13b0835b09cacf944
7
- data.tar.gz: 06fac7bd05a05bd63d843e8f4faf5b4d1812aacfc9b445fc0f0cd262618623a92101c14948670e57969bb44ccdad1bb27047f5316b864e4a2abbec6ddfb95d82
6
+ metadata.gz: c7e30f24d3988c9198d4df617524dbda7ed85ea03dc3451db2874e7968f907512505f822c07366dac8b4119373e1043699fcfb8b3d5252d3c9454e67c15d743e
7
+ data.tar.gz: 479d39bb69090f99444153fa55c96c0c5d44a0e4434841a7f95f32f232777f95b165e42af45e3522bee94b277a0cd3088ce5bab4cc93e7499b7de1a5517c1ba1
data/README.md CHANGED
@@ -29,6 +29,7 @@ systmd service config: https://github.com/pyama86/popper/tree/master/init_script
29
29
  # configure(toml)
30
30
  ## ~/popper/popper.conf
31
31
  ```
32
+ include = ["/etc/popper/*.conf"]
32
33
  [global]
33
34
  interval = 60 # fetch interbal default:60
34
35
 
@@ -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
- @accounts << _account
22
+ self.accounts << _account
19
23
  end
20
24
  end
21
25
 
@@ -1,3 +1,3 @@
1
1
  module Popper
2
- VERSION = "0.2.5"
2
+ VERSION = "0.2.7"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: popper
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.5
4
+ version: 0.2.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - pyama86