dryad-core 0.2.1 → 0.2.3

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
  SHA256:
3
- metadata.gz: fe374a0833bbf882f8df412c7262d69df70974c6d2ffd8106323b44c8adc53ba
4
- data.tar.gz: 1f028f675abec8bd4e320488621e0b342641e7fa419e4d54171e1c38587cbb26
3
+ metadata.gz: 956b312daaa54743c8a70ef517de278ff8c8c9b020460202a30d9cb9e4cfded3
4
+ data.tar.gz: 5455ec427785a2e133ff4a5ebc0cb09d7f44b63220845970bbf0a4c58dd8f9bc
5
5
  SHA512:
6
- metadata.gz: 52e8bd7b93906b8141176884f90c57f22d2b43e2004dd2508281decb539a26a2723858521682bc4e7865685ffca9cbb123c6d5c8de95a9d92bc5b0cb652d62fc
7
- data.tar.gz: 9dbb7e2701d4156ffda3e2a2452ad2cb4e2d53ae319d7d5740022898cd23f4f9bf79c42c88f9b99e190288795a40b99177085848da120cbb06b4fc54212f8943
6
+ metadata.gz: 5b6ed34e33886f542e77f1337fbef99a2679ec6d12fd020d5c3a58d50f2c97b61bc70a617c2d61f4380cf3d24e44128b6bb2bd208a834ebfe3b6ba4a6b1620dd
7
+ data.tar.gz: b38d8bce4e89a57ba2065b67d59f88f7057afbccc12be69adbbf4d524fe275473a628cac889d9227b96075d8219217d45baaa1e0a4d7aae312b764dc18458e7c
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- dryad-core (0.1.0.alpha)
4
+ dryad-core (0.2.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -1,46 +1 @@
1
- require "dryad/configuration"
2
1
  require "dryad/core"
3
- require "yaml"
4
- require "erb"
5
-
6
- DRYAD_COFNIG_FILE = ENV["DRYAD_CONFIG_FILE"] || "config/dryad.yml"
7
-
8
- module Dryad
9
- class Error < StandardError; end
10
-
11
- class << self
12
- attr_accessor :configuration
13
- end
14
-
15
- def self.configuration
16
- @configuration ||= Configuration.new
17
- end
18
-
19
- def self.configure
20
- yield(configuration)
21
- end
22
-
23
- def self.configure_with_file
24
- environment = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "default"
25
- opts = YAML.load(ERB.new(File.read(DRYAD_COFNIG_FILE)).result)[environment] || Configuration::DEFAULT_OPTIONS
26
-
27
- if opts.respond_to? :deep_symbolize_keys!
28
- opts.deep_symbolize_keys!
29
- else
30
- symbolize_keys_deep!(opts)
31
- end
32
-
33
- @configuration = Configuration.new(opts)
34
- end
35
-
36
- private
37
- def self.symbolize_keys_deep!(hash)
38
- hash.keys.each do |k|
39
- symkey = k.respond_to?(:to_sym) ? k.to_sym : k
40
- hash[symkey] = hash.delete k
41
- symbolize_keys_deep! hash[symkey] if hash[symkey].is_a? Hash
42
- end
43
- end
44
- end
45
-
46
- Dryad.configure_with_file if File.exist?(DRYAD_COFNIG_FILE)
@@ -1,5 +1,5 @@
1
1
  module Dryad
2
2
  module Core
3
- VERSION = '0.2.1'
3
+ VERSION = '0.2.3'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dryad-core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.1
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Pan Jie
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-05-31 00:00:00.000000000 Z
11
+ date: 2019-06-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -71,7 +71,6 @@ files:
71
71
  - bin/setup
72
72
  - dryad-core.gemspec
73
73
  - lib/dryad.rb
74
- - lib/dryad/configuration.rb
75
74
  - lib/dryad/core.rb
76
75
  - lib/dryad/core/config_desc.rb
77
76
  - lib/dryad/core/config_provider.rb
@@ -100,7 +99,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
100
99
  - !ruby/object:Gem::Version
101
100
  version: '0'
102
101
  requirements: []
103
- rubygems_version: 3.0.3
102
+ rubyforge_project:
103
+ rubygems_version: 2.7.9
104
104
  signing_key:
105
105
  specification_version: 4
106
106
  summary: Dryad core library.
@@ -1,23 +0,0 @@
1
- module Dryad
2
- class Configuration
3
- attr_accessor :consul, :namespace, :group, :registry, :provider, :service
4
-
5
- DEFAULT_OPTIONS = {
6
- consul: {
7
- host: '127.0.0.1',
8
- port: 8500
9
- },
10
- service: {}
11
- }
12
-
13
- def initialize(opts = {})
14
- opts = DEFAULT_OPTIONS.merge(opts)
15
- @consul = opts[:consul]
16
- @namespace = opts[:namespace]
17
- @group = opts[:group]
18
- @registry = opts[:registry]
19
- @provider = opts[:provider]
20
- @service = opts[:service]
21
- end
22
- end
23
- end