dryad 0.1.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (76) hide show
  1. checksums.yaml +7 -0
  2. data/.gitignore +11 -0
  3. data/.rspec +3 -0
  4. data/.travis.yml +19 -0
  5. data/DRYAD_VERSION +1 -0
  6. data/Gemfile +4 -0
  7. data/Gemfile.lock +51 -0
  8. data/LICENSE +19 -0
  9. data/README.md +35 -0
  10. data/Rakefile +6 -0
  11. data/dryad-cluster/.gitignore +11 -0
  12. data/dryad-cluster/.rspec +3 -0
  13. data/dryad-cluster/Gemfile +8 -0
  14. data/dryad-cluster/Gemfile.lock +48 -0
  15. data/dryad-cluster/LICENSE +19 -0
  16. data/dryad-cluster/README.md +35 -0
  17. data/dryad-cluster/Rakefile +6 -0
  18. data/dryad-cluster/bin/console +14 -0
  19. data/dryad-cluster/bin/setup +8 -0
  20. data/dryad-cluster/dryad-cluster.gemspec +29 -0
  21. data/dryad-cluster/lib/dryad/cluster/version.rb +10 -0
  22. data/dryad-cluster/lib/dryad/cluster.rb +17 -0
  23. data/dryad-cluster/spec/dryad/cluster_spec.rb +33 -0
  24. data/dryad-cluster/spec/dummy/config/dryad.yml +15 -0
  25. data/dryad-cluster/spec/spec_helper.rb +18 -0
  26. data/dryad-consul/.gitignore +11 -0
  27. data/dryad-consul/.rspec +3 -0
  28. data/dryad-consul/Gemfile +4 -0
  29. data/dryad-consul/Gemfile.lock +45 -0
  30. data/dryad-consul/LICENSE +19 -0
  31. data/dryad-consul/README.md +35 -0
  32. data/dryad-consul/Rakefile +6 -0
  33. data/dryad-consul/bin/console +14 -0
  34. data/dryad-consul/bin/setup +8 -0
  35. data/dryad-consul/dryad-consul.gemspec +30 -0
  36. data/dryad-consul/lib/dryad/consul/service.rb +33 -0
  37. data/dryad-consul/lib/dryad/consul/service_client.rb +15 -0
  38. data/dryad-consul/lib/dryad/consul/service_registry.rb +37 -0
  39. data/dryad-consul/lib/dryad/consul/version.rb +10 -0
  40. data/dryad-consul/lib/dryad/consul.rb +16 -0
  41. data/dryad-consul/spec/dryad/consul/service_client_spec.rb +6 -0
  42. data/dryad-consul/spec/dryad/consul/service_registry_spec.rb +33 -0
  43. data/dryad-consul/spec/dryad/consul/service_spec.rb +23 -0
  44. data/dryad-consul/spec/dryad/consul_spec.rb +10 -0
  45. data/dryad-consul/spec/spec_helper.rb +14 -0
  46. data/dryad-core/.gitignore +11 -0
  47. data/dryad-core/.rspec +3 -0
  48. data/dryad-core/.travis.yml +7 -0
  49. data/dryad-core/Gemfile +4 -0
  50. data/dryad-core/Gemfile.lock +35 -0
  51. data/dryad-core/LICENSE +19 -0
  52. data/dryad-core/README.md +35 -0
  53. data/dryad-core/Rakefile +6 -0
  54. data/dryad-core/bin/console +14 -0
  55. data/dryad-core/bin/setup +8 -0
  56. data/dryad-core/dryad-core.gemspec +27 -0
  57. data/dryad-core/lib/dryad/configuration.rb +22 -0
  58. data/dryad-core/lib/dryad/core/load_balancing.rb +8 -0
  59. data/dryad-core/lib/dryad/core/portal.rb +21 -0
  60. data/dryad-core/lib/dryad/core/schema.rb +9 -0
  61. data/dryad-core/lib/dryad/core/service.rb +39 -0
  62. data/dryad-core/lib/dryad/core/service_instance.rb +14 -0
  63. data/dryad-core/lib/dryad/core/version.rb +10 -0
  64. data/dryad-core/lib/dryad/core.rb +12 -0
  65. data/dryad-core/lib/dryad.rb +46 -0
  66. data/dryad-core/spec/dryad/core/load_balancing_spec.rb +6 -0
  67. data/dryad-core/spec/dryad/core/portal_spec.rb +13 -0
  68. data/dryad-core/spec/dryad/core/schema_spec.rb +7 -0
  69. data/dryad-core/spec/dryad/core/service_instance_spec.rb +7 -0
  70. data/dryad-core/spec/dryad/core/service_spec.rb +14 -0
  71. data/dryad-core/spec/dryad/core_spec.rb +6 -0
  72. data/dryad-core/spec/dryad_spec.rb +22 -0
  73. data/dryad-core/spec/dummy/config/dryad.yml +15 -0
  74. data/dryad-core/spec/spec_helper.rb +19 -0
  75. data/dryad.gemspec +28 -0
  76. metadata +202 -0
@@ -0,0 +1,22 @@
1
+ RSpec.describe Dryad do
2
+ it "has a valid version number" do
3
+ version = File.read(File.expand_path("../../DRYAD_VERSION", __dir__)).strip
4
+ expect(Dryad::Core::VERSION).to eq(version)
5
+ end
6
+
7
+ it "can be configured with config file" do
8
+ environment = ENV["RAILS_ENV"] || ENV["RACK_ENV"] || "default"
9
+ default_consul_config = YAML.load(ERB.new(File.read(ENV['DRYAD_CONFIG_FILE'])).result)[environment]["consul"]
10
+ expect(Dryad.configuration.consul[:host]).to eq(default_consul_config["host"])
11
+ expect(Dryad.configuration.consul[:port]).to eq(default_consul_config["port"])
12
+ end
13
+
14
+ it "can be configured with block" do
15
+ consul_config = { host: "block.consul.example", port: 8500 }
16
+ Dryad.configure do |config|
17
+ config.consul = consul_config
18
+ end
19
+
20
+ expect(Dryad.configuration.consul).to eq(consul_config)
21
+ end
22
+ end
@@ -0,0 +1,15 @@
1
+ default: &default
2
+ consul:
3
+ host: localhost
4
+ port: 8500
5
+ group: staging
6
+ registry: Dryad::Consul::ServiceRegistry
7
+
8
+ development:
9
+ <<: *default
10
+
11
+ test:
12
+ <<: *default
13
+
14
+ production:
15
+ <<: *default
@@ -0,0 +1,19 @@
1
+ ENV['DRYAD_CONFIG_FILE'] = File.expand_path("dummy/config/dryad.yml", __dir__)
2
+
3
+ require "bundler/setup"
4
+ require "yaml"
5
+ require "erb"
6
+ require "dryad"
7
+ require "dryad/core"
8
+
9
+ RSpec.configure do |config|
10
+ # Enable flags like --only-failures and --next-failure
11
+ config.example_status_persistence_file_path = ".rspec_status"
12
+
13
+ # Disable RSpec exposing methods globally on `Module` and `main`
14
+ config.disable_monkey_patching!
15
+
16
+ config.expect_with :rspec do |c|
17
+ c.syntax = :expect
18
+ end
19
+ end
data/dryad.gemspec ADDED
@@ -0,0 +1,28 @@
1
+
2
+ version = File.read(File.expand_path("DRYAD_VERSION", __dir__)).strip
3
+
4
+ Gem::Specification.new do |spec|
5
+ spec.name = "dryad"
6
+ spec.version = version
7
+ spec.authors = ["Pan Jie"]
8
+ spec.email = ["panjie@growingio.com"]
9
+
10
+ spec.summary = %q{Config Management & Service Registration and Discovery}
11
+ spec.description = %q{Dryad is a configration management client. It provides functions such as hot loading of configuration files.}
12
+ spec.homepage = "https://github.com/jack0pan/dryad.rb"
13
+ spec.license = "MIT"
14
+
15
+ spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
16
+ `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
17
+ end
18
+ spec.bindir = "exe"
19
+ spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
20
+
21
+ spec.add_dependency "dryad-core", version
22
+ spec.add_dependency "dryad-consul", version
23
+ spec.add_dependency "dryad-cluster", version
24
+
25
+ spec.add_development_dependency "bundler", "~> 2.0"
26
+ spec.add_development_dependency "rake", "~> 10.0"
27
+ spec.add_development_dependency "rspec", "~> 3.0"
28
+ end
metadata ADDED
@@ -0,0 +1,202 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dryad
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Pan Jie
8
+ autorequire:
9
+ bindir: exe
10
+ cert_chain: []
11
+ date: 2019-05-13 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: dryad-core
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - '='
18
+ - !ruby/object:Gem::Version
19
+ version: 0.1.0
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - '='
25
+ - !ruby/object:Gem::Version
26
+ version: 0.1.0
27
+ - !ruby/object:Gem::Dependency
28
+ name: dryad-consul
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - '='
32
+ - !ruby/object:Gem::Version
33
+ version: 0.1.0
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - '='
39
+ - !ruby/object:Gem::Version
40
+ version: 0.1.0
41
+ - !ruby/object:Gem::Dependency
42
+ name: dryad-cluster
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - '='
46
+ - !ruby/object:Gem::Version
47
+ version: 0.1.0
48
+ type: :runtime
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - '='
53
+ - !ruby/object:Gem::Version
54
+ version: 0.1.0
55
+ - !ruby/object:Gem::Dependency
56
+ name: bundler
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '2.0'
62
+ type: :development
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '2.0'
69
+ - !ruby/object:Gem::Dependency
70
+ name: rake
71
+ requirement: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - "~>"
74
+ - !ruby/object:Gem::Version
75
+ version: '10.0'
76
+ type: :development
77
+ prerelease: false
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '10.0'
83
+ - !ruby/object:Gem::Dependency
84
+ name: rspec
85
+ requirement: !ruby/object:Gem::Requirement
86
+ requirements:
87
+ - - "~>"
88
+ - !ruby/object:Gem::Version
89
+ version: '3.0'
90
+ type: :development
91
+ prerelease: false
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '3.0'
97
+ description: Dryad is a configration management client. It provides functions such
98
+ as hot loading of configuration files.
99
+ email:
100
+ - panjie@growingio.com
101
+ executables: []
102
+ extensions: []
103
+ extra_rdoc_files: []
104
+ files:
105
+ - ".gitignore"
106
+ - ".rspec"
107
+ - ".travis.yml"
108
+ - DRYAD_VERSION
109
+ - Gemfile
110
+ - Gemfile.lock
111
+ - LICENSE
112
+ - README.md
113
+ - Rakefile
114
+ - dryad-cluster/.gitignore
115
+ - dryad-cluster/.rspec
116
+ - dryad-cluster/Gemfile
117
+ - dryad-cluster/Gemfile.lock
118
+ - dryad-cluster/LICENSE
119
+ - dryad-cluster/README.md
120
+ - dryad-cluster/Rakefile
121
+ - dryad-cluster/bin/console
122
+ - dryad-cluster/bin/setup
123
+ - dryad-cluster/dryad-cluster.gemspec
124
+ - dryad-cluster/lib/dryad/cluster.rb
125
+ - dryad-cluster/lib/dryad/cluster/version.rb
126
+ - dryad-cluster/spec/dryad/cluster_spec.rb
127
+ - dryad-cluster/spec/dummy/config/dryad.yml
128
+ - dryad-cluster/spec/spec_helper.rb
129
+ - dryad-consul/.gitignore
130
+ - dryad-consul/.rspec
131
+ - dryad-consul/Gemfile
132
+ - dryad-consul/Gemfile.lock
133
+ - dryad-consul/LICENSE
134
+ - dryad-consul/README.md
135
+ - dryad-consul/Rakefile
136
+ - dryad-consul/bin/console
137
+ - dryad-consul/bin/setup
138
+ - dryad-consul/dryad-consul.gemspec
139
+ - dryad-consul/lib/dryad/consul.rb
140
+ - dryad-consul/lib/dryad/consul/service.rb
141
+ - dryad-consul/lib/dryad/consul/service_client.rb
142
+ - dryad-consul/lib/dryad/consul/service_registry.rb
143
+ - dryad-consul/lib/dryad/consul/version.rb
144
+ - dryad-consul/spec/dryad/consul/service_client_spec.rb
145
+ - dryad-consul/spec/dryad/consul/service_registry_spec.rb
146
+ - dryad-consul/spec/dryad/consul/service_spec.rb
147
+ - dryad-consul/spec/dryad/consul_spec.rb
148
+ - dryad-consul/spec/spec_helper.rb
149
+ - dryad-core/.gitignore
150
+ - dryad-core/.rspec
151
+ - dryad-core/.travis.yml
152
+ - dryad-core/Gemfile
153
+ - dryad-core/Gemfile.lock
154
+ - dryad-core/LICENSE
155
+ - dryad-core/README.md
156
+ - dryad-core/Rakefile
157
+ - dryad-core/bin/console
158
+ - dryad-core/bin/setup
159
+ - dryad-core/dryad-core.gemspec
160
+ - dryad-core/lib/dryad.rb
161
+ - dryad-core/lib/dryad/configuration.rb
162
+ - dryad-core/lib/dryad/core.rb
163
+ - dryad-core/lib/dryad/core/load_balancing.rb
164
+ - dryad-core/lib/dryad/core/portal.rb
165
+ - dryad-core/lib/dryad/core/schema.rb
166
+ - dryad-core/lib/dryad/core/service.rb
167
+ - dryad-core/lib/dryad/core/service_instance.rb
168
+ - dryad-core/lib/dryad/core/version.rb
169
+ - dryad-core/spec/dryad/core/load_balancing_spec.rb
170
+ - dryad-core/spec/dryad/core/portal_spec.rb
171
+ - dryad-core/spec/dryad/core/schema_spec.rb
172
+ - dryad-core/spec/dryad/core/service_instance_spec.rb
173
+ - dryad-core/spec/dryad/core/service_spec.rb
174
+ - dryad-core/spec/dryad/core_spec.rb
175
+ - dryad-core/spec/dryad_spec.rb
176
+ - dryad-core/spec/dummy/config/dryad.yml
177
+ - dryad-core/spec/spec_helper.rb
178
+ - dryad.gemspec
179
+ homepage: https://github.com/jack0pan/dryad.rb
180
+ licenses:
181
+ - MIT
182
+ metadata: {}
183
+ post_install_message:
184
+ rdoc_options: []
185
+ require_paths:
186
+ - lib
187
+ required_ruby_version: !ruby/object:Gem::Requirement
188
+ requirements:
189
+ - - ">="
190
+ - !ruby/object:Gem::Version
191
+ version: '0'
192
+ required_rubygems_version: !ruby/object:Gem::Requirement
193
+ requirements:
194
+ - - ">="
195
+ - !ruby/object:Gem::Version
196
+ version: '0'
197
+ requirements: []
198
+ rubygems_version: 3.0.3
199
+ signing_key:
200
+ specification_version: 4
201
+ summary: Config Management & Service Registration and Discovery
202
+ test_files: []