dryad 0.1.0
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 +7 -0
- data/.gitignore +11 -0
- data/.rspec +3 -0
- data/.travis.yml +19 -0
- data/DRYAD_VERSION +1 -0
- data/Gemfile +4 -0
- data/Gemfile.lock +51 -0
- data/LICENSE +19 -0
- data/README.md +35 -0
- data/Rakefile +6 -0
- data/dryad-cluster/.gitignore +11 -0
- data/dryad-cluster/.rspec +3 -0
- data/dryad-cluster/Gemfile +8 -0
- data/dryad-cluster/Gemfile.lock +48 -0
- data/dryad-cluster/LICENSE +19 -0
- data/dryad-cluster/README.md +35 -0
- data/dryad-cluster/Rakefile +6 -0
- data/dryad-cluster/bin/console +14 -0
- data/dryad-cluster/bin/setup +8 -0
- data/dryad-cluster/dryad-cluster.gemspec +29 -0
- data/dryad-cluster/lib/dryad/cluster/version.rb +10 -0
- data/dryad-cluster/lib/dryad/cluster.rb +17 -0
- data/dryad-cluster/spec/dryad/cluster_spec.rb +33 -0
- data/dryad-cluster/spec/dummy/config/dryad.yml +15 -0
- data/dryad-cluster/spec/spec_helper.rb +18 -0
- data/dryad-consul/.gitignore +11 -0
- data/dryad-consul/.rspec +3 -0
- data/dryad-consul/Gemfile +4 -0
- data/dryad-consul/Gemfile.lock +45 -0
- data/dryad-consul/LICENSE +19 -0
- data/dryad-consul/README.md +35 -0
- data/dryad-consul/Rakefile +6 -0
- data/dryad-consul/bin/console +14 -0
- data/dryad-consul/bin/setup +8 -0
- data/dryad-consul/dryad-consul.gemspec +30 -0
- data/dryad-consul/lib/dryad/consul/service.rb +33 -0
- data/dryad-consul/lib/dryad/consul/service_client.rb +15 -0
- data/dryad-consul/lib/dryad/consul/service_registry.rb +37 -0
- data/dryad-consul/lib/dryad/consul/version.rb +10 -0
- data/dryad-consul/lib/dryad/consul.rb +16 -0
- data/dryad-consul/spec/dryad/consul/service_client_spec.rb +6 -0
- data/dryad-consul/spec/dryad/consul/service_registry_spec.rb +33 -0
- data/dryad-consul/spec/dryad/consul/service_spec.rb +23 -0
- data/dryad-consul/spec/dryad/consul_spec.rb +10 -0
- data/dryad-consul/spec/spec_helper.rb +14 -0
- data/dryad-core/.gitignore +11 -0
- data/dryad-core/.rspec +3 -0
- data/dryad-core/.travis.yml +7 -0
- data/dryad-core/Gemfile +4 -0
- data/dryad-core/Gemfile.lock +35 -0
- data/dryad-core/LICENSE +19 -0
- data/dryad-core/README.md +35 -0
- data/dryad-core/Rakefile +6 -0
- data/dryad-core/bin/console +14 -0
- data/dryad-core/bin/setup +8 -0
- data/dryad-core/dryad-core.gemspec +27 -0
- data/dryad-core/lib/dryad/configuration.rb +22 -0
- data/dryad-core/lib/dryad/core/load_balancing.rb +8 -0
- data/dryad-core/lib/dryad/core/portal.rb +21 -0
- data/dryad-core/lib/dryad/core/schema.rb +9 -0
- data/dryad-core/lib/dryad/core/service.rb +39 -0
- data/dryad-core/lib/dryad/core/service_instance.rb +14 -0
- data/dryad-core/lib/dryad/core/version.rb +10 -0
- data/dryad-core/lib/dryad/core.rb +12 -0
- data/dryad-core/lib/dryad.rb +46 -0
- data/dryad-core/spec/dryad/core/load_balancing_spec.rb +6 -0
- data/dryad-core/spec/dryad/core/portal_spec.rb +13 -0
- data/dryad-core/spec/dryad/core/schema_spec.rb +7 -0
- data/dryad-core/spec/dryad/core/service_instance_spec.rb +7 -0
- data/dryad-core/spec/dryad/core/service_spec.rb +14 -0
- data/dryad-core/spec/dryad/core_spec.rb +6 -0
- data/dryad-core/spec/dryad_spec.rb +22 -0
- data/dryad-core/spec/dummy/config/dryad.yml +15 -0
- data/dryad-core/spec/spec_helper.rb +19 -0
- data/dryad.gemspec +28 -0
- metadata +202 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: 82af7189f930847af3a2908429e7558eb32c7e73fa69a3e73789e369b1a607b1
|
4
|
+
data.tar.gz: de046cc3a8f9a68c5d8b355a8b38ca5d1da7da99590be43c63d13494f356a5c5
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: d60c291c2f8e1d931677b1a4246cf8e8de562ac32c8856dec0a76c0987357bb28156d61e8adb84028dd57c4e5952f47c73194a1f3ce45f7bb1cb160dd304e1dd
|
7
|
+
data.tar.gz: 49b5d44240c4d489313948ac413143a335352a79b6719be3d9ee846c32bd1a5beb416a89984d45c6f93accd4de0a103b5886d6d7236089ca1d1e73170eb75c88
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.travis.yml
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
---
|
2
|
+
sudo: false
|
3
|
+
language: ruby
|
4
|
+
cache: bundler
|
5
|
+
rvm:
|
6
|
+
- 2.6.3
|
7
|
+
env:
|
8
|
+
- CONSUL_VERSION=1.4.4
|
9
|
+
before_install:
|
10
|
+
- gem install bundler -v 2.0.1
|
11
|
+
- curl -sLo consul.zip https://releases.hashicorp.com/consul/${CONSUL_VERSION}/consul_${CONSUL_VERSION}_linux_amd64.zip
|
12
|
+
- unzip consul.zip
|
13
|
+
- mkdir -p ~/bin
|
14
|
+
- mv consul ~/bin
|
15
|
+
- export PATH="~/bin:$PATH"
|
16
|
+
- consul version
|
17
|
+
- consul agent -dev >/dev/null 2>&1 &
|
18
|
+
script:
|
19
|
+
- bundle exec rake spec
|
data/DRYAD_VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.1.0
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,51 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dryad (0.1.0)
|
5
|
+
dryad-cluster (= 0.1.0)
|
6
|
+
dryad-consul (= 0.1.0)
|
7
|
+
dryad-core (= 0.1.0)
|
8
|
+
dryad-cluster (0.1.0)
|
9
|
+
dryad-core (= 0.1.0)
|
10
|
+
dryad-consul (0.1.0)
|
11
|
+
diplomat
|
12
|
+
dryad-core (= 0.1.0)
|
13
|
+
dryad-core (0.1.0)
|
14
|
+
|
15
|
+
GEM
|
16
|
+
remote: https://rubygems.org/
|
17
|
+
specs:
|
18
|
+
deep_merge (1.2.1)
|
19
|
+
diff-lcs (1.3)
|
20
|
+
diplomat (2.2.4)
|
21
|
+
deep_merge (~> 1.0, >= 1.0.1)
|
22
|
+
faraday (~> 0.9)
|
23
|
+
faraday (0.15.4)
|
24
|
+
multipart-post (>= 1.2, < 3)
|
25
|
+
multipart-post (2.1.0)
|
26
|
+
rake (10.5.0)
|
27
|
+
rspec (3.8.0)
|
28
|
+
rspec-core (~> 3.8.0)
|
29
|
+
rspec-expectations (~> 3.8.0)
|
30
|
+
rspec-mocks (~> 3.8.0)
|
31
|
+
rspec-core (3.8.0)
|
32
|
+
rspec-support (~> 3.8.0)
|
33
|
+
rspec-expectations (3.8.3)
|
34
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
35
|
+
rspec-support (~> 3.8.0)
|
36
|
+
rspec-mocks (3.8.0)
|
37
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
38
|
+
rspec-support (~> 3.8.0)
|
39
|
+
rspec-support (3.8.0)
|
40
|
+
|
41
|
+
PLATFORMS
|
42
|
+
ruby
|
43
|
+
|
44
|
+
DEPENDENCIES
|
45
|
+
bundler (~> 2.0)
|
46
|
+
dryad!
|
47
|
+
rake (~> 10.0)
|
48
|
+
rspec (~> 3.0)
|
49
|
+
|
50
|
+
BUNDLED WITH
|
51
|
+
2.0.1
|
data/LICENSE
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,35 @@
|
|
1
|
+
# Dryad
|
2
|
+
|
3
|
+
[](https://travis-ci.org/jack0pan/dryad.rb)
|
4
|
+
|
5
|
+
It provides functions such as hot loading of configuration files.
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'dryad'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install dryad
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at [dryad.rb](https://github.com/jack0pan/dryad.rb).
|
data/Rakefile
ADDED
@@ -0,0 +1,48 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dryad-cluster (0.1.0.alpha)
|
5
|
+
dryad-core (= 0.1.0.alpha)
|
6
|
+
|
7
|
+
GEM
|
8
|
+
remote: https://rubygems.org/
|
9
|
+
specs:
|
10
|
+
deep_merge (1.2.1)
|
11
|
+
diff-lcs (1.3)
|
12
|
+
diplomat (2.2.4)
|
13
|
+
deep_merge (~> 1.0, >= 1.0.1)
|
14
|
+
faraday (~> 0.9)
|
15
|
+
dryad-consul (0.1.0.alpha)
|
16
|
+
diplomat
|
17
|
+
dryad-core (= 0.1.0.alpha)
|
18
|
+
dryad-core (0.1.0.alpha)
|
19
|
+
faraday (0.15.4)
|
20
|
+
multipart-post (>= 1.2, < 3)
|
21
|
+
multipart-post (2.1.0)
|
22
|
+
rake (10.5.0)
|
23
|
+
rspec (3.8.0)
|
24
|
+
rspec-core (~> 3.8.0)
|
25
|
+
rspec-expectations (~> 3.8.0)
|
26
|
+
rspec-mocks (~> 3.8.0)
|
27
|
+
rspec-core (3.8.0)
|
28
|
+
rspec-support (~> 3.8.0)
|
29
|
+
rspec-expectations (3.8.3)
|
30
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
31
|
+
rspec-support (~> 3.8.0)
|
32
|
+
rspec-mocks (3.8.0)
|
33
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
34
|
+
rspec-support (~> 3.8.0)
|
35
|
+
rspec-support (3.8.0)
|
36
|
+
|
37
|
+
PLATFORMS
|
38
|
+
ruby
|
39
|
+
|
40
|
+
DEPENDENCIES
|
41
|
+
bundler (~> 2.0)
|
42
|
+
dryad-cluster!
|
43
|
+
dryad-consul
|
44
|
+
rake (~> 10.0)
|
45
|
+
rspec (~> 3.0)
|
46
|
+
|
47
|
+
BUNDLED WITH
|
48
|
+
2.0.1
|
@@ -0,0 +1,19 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Dryad::Cluster
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dryad/cluster`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'dryad-cluster'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install dryad-cluster
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dryad-cluster.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "dryad/cluster"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
@@ -0,0 +1,29 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "dryad/cluster/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "dryad-cluster"
|
8
|
+
spec.version = Dryad::Cluster::VERSION
|
9
|
+
spec.authors = ["Pan Jie"]
|
10
|
+
spec.email = ["panjie@growingio.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Dryad cluster library.}
|
13
|
+
spec.description = %q{Use cluster for service discovery. Use round robin to process scheduling.}
|
14
|
+
spec.homepage = "https://github.com/jack0pan/dryad.rb"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "dryad-core", Dryad::Cluster::VERSION
|
25
|
+
|
26
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
27
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
28
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
29
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require "dryad"
|
2
|
+
require "dryad/cluster/version"
|
3
|
+
|
4
|
+
module Dryad
|
5
|
+
module Cluster
|
6
|
+
class Error < StandardError; end
|
7
|
+
|
8
|
+
class << self
|
9
|
+
REGISTRY = Object.const_get(Dryad.configuration.registry)
|
10
|
+
|
11
|
+
def round_robin(schema, service_name)
|
12
|
+
groups = ['_global_', Dryad.configuration.group]
|
13
|
+
REGISTRY.service_instances(service_name, schema, groups).first
|
14
|
+
end
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,33 @@
|
|
1
|
+
RSpec.describe Dryad::Cluster do
|
2
|
+
before do
|
3
|
+
@portal = Dryad::Core::Portal.new(
|
4
|
+
schema: Dryad::Core::Schema::HTTP,
|
5
|
+
port: 3000,
|
6
|
+
pattern: '/*',
|
7
|
+
non_certifications: ['/*']
|
8
|
+
)
|
9
|
+
@service = Dryad::Consul::Service.new(
|
10
|
+
name: 'rails',
|
11
|
+
address: '127.0.0.1',
|
12
|
+
group: 'staging',
|
13
|
+
portals: [@portal],
|
14
|
+
priority: 10,
|
15
|
+
load_balancing: [Dryad::Core::LoadBalancing::URL_HASH]
|
16
|
+
)
|
17
|
+
end
|
18
|
+
|
19
|
+
it "has a version number" do
|
20
|
+
expect(Dryad::Cluster::VERSION).not_to be nil
|
21
|
+
end
|
22
|
+
|
23
|
+
it "rounds robin" do
|
24
|
+
Dryad::Consul::ServiceRegistry.register(@service)
|
25
|
+
service_instance = Dryad::Cluster.round_robin(
|
26
|
+
Dryad::Core::Schema::HTTP,
|
27
|
+
@service.name
|
28
|
+
)
|
29
|
+
expect(service_instance.name).to eq(@service.name)
|
30
|
+
expect(service_instance.address).to eq(@service.address)
|
31
|
+
Dryad::Consul::ServiceRegistry.deregister(@service)
|
32
|
+
end
|
33
|
+
end
|
@@ -0,0 +1,18 @@
|
|
1
|
+
ENV['DRYAD_CONFIG_FILE'] = File.expand_path("dummy/config/dryad.yml", __dir__)
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "dryad"
|
5
|
+
require "dryad/consul"
|
6
|
+
require "dryad/cluster"
|
7
|
+
|
8
|
+
RSpec.configure do |config|
|
9
|
+
# Enable flags like --only-failures and --next-failure
|
10
|
+
config.example_status_persistence_file_path = ".rspec_status"
|
11
|
+
|
12
|
+
# Disable RSpec exposing methods globally on `Module` and `main`
|
13
|
+
config.disable_monkey_patching!
|
14
|
+
|
15
|
+
config.expect_with :rspec do |c|
|
16
|
+
c.syntax = :expect
|
17
|
+
end
|
18
|
+
end
|
data/dryad-consul/.rspec
ADDED
@@ -0,0 +1,45 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
dryad-consul (0.1.0.alpha)
|
5
|
+
diplomat
|
6
|
+
dryad-core (= 0.1.0.alpha)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
deep_merge (1.2.1)
|
12
|
+
diff-lcs (1.3)
|
13
|
+
diplomat (2.2.4)
|
14
|
+
deep_merge (~> 1.0, >= 1.0.1)
|
15
|
+
faraday (~> 0.9)
|
16
|
+
dryad-core (0.1.0.alpha)
|
17
|
+
faraday (0.15.4)
|
18
|
+
multipart-post (>= 1.2, < 3)
|
19
|
+
multipart-post (2.1.0)
|
20
|
+
rake (10.5.0)
|
21
|
+
rspec (3.8.0)
|
22
|
+
rspec-core (~> 3.8.0)
|
23
|
+
rspec-expectations (~> 3.8.0)
|
24
|
+
rspec-mocks (~> 3.8.0)
|
25
|
+
rspec-core (3.8.0)
|
26
|
+
rspec-support (~> 3.8.0)
|
27
|
+
rspec-expectations (3.8.3)
|
28
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
29
|
+
rspec-support (~> 3.8.0)
|
30
|
+
rspec-mocks (3.8.0)
|
31
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
32
|
+
rspec-support (~> 3.8.0)
|
33
|
+
rspec-support (3.8.0)
|
34
|
+
|
35
|
+
PLATFORMS
|
36
|
+
ruby
|
37
|
+
|
38
|
+
DEPENDENCIES
|
39
|
+
bundler (~> 2.0)
|
40
|
+
dryad-consul!
|
41
|
+
rake (~> 10.0)
|
42
|
+
rspec (~> 3.0)
|
43
|
+
|
44
|
+
BUNDLED WITH
|
45
|
+
2.0.1
|
@@ -0,0 +1,19 @@
|
|
1
|
+
The MIT License (MIT)
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
4
|
+
of this software and associated documentation files (the "Software"), to deal
|
5
|
+
in the Software without restriction, including without limitation the rights
|
6
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
7
|
+
copies of the Software, and to permit persons to whom the Software is
|
8
|
+
furnished to do so, subject to the following conditions:
|
9
|
+
|
10
|
+
The above copyright notice and this permission notice shall be included in
|
11
|
+
all copies or substantial portions of the Software.
|
12
|
+
|
13
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
14
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
15
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
16
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
17
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
18
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
19
|
+
THE SOFTWARE.
|
@@ -0,0 +1,35 @@
|
|
1
|
+
# Dryad::Consul
|
2
|
+
|
3
|
+
Welcome to your new gem! In this directory, you'll find the files you need to be able to package up your Ruby library into a gem. Put your Ruby code in the file `lib/dryad/consul`. To experiment with that code, run `bin/console` for an interactive prompt.
|
4
|
+
|
5
|
+
TODO: Delete this and the text above, and describe your gem
|
6
|
+
|
7
|
+
## Installation
|
8
|
+
|
9
|
+
Add this line to your application's Gemfile:
|
10
|
+
|
11
|
+
```ruby
|
12
|
+
gem 'dryad-consul'
|
13
|
+
```
|
14
|
+
|
15
|
+
And then execute:
|
16
|
+
|
17
|
+
$ bundle
|
18
|
+
|
19
|
+
Or install it yourself as:
|
20
|
+
|
21
|
+
$ gem install dryad-consul
|
22
|
+
|
23
|
+
## Usage
|
24
|
+
|
25
|
+
TODO: Write usage instructions here
|
26
|
+
|
27
|
+
## Development
|
28
|
+
|
29
|
+
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
|
30
|
+
|
31
|
+
To install this gem onto your local machine, run `bundle exec rake install`. To release a new version, update the version number in `version.rb`, and then run `bundle exec rake release`, which will create a git tag for the version, push git commits and tags, and push the `.gem` file to [rubygems.org](https://rubygems.org).
|
32
|
+
|
33
|
+
## Contributing
|
34
|
+
|
35
|
+
Bug reports and pull requests are welcome on GitHub at https://github.com/[USERNAME]/dryad-consul.
|
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "dryad/consul"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start(__FILE__)
|
@@ -0,0 +1,30 @@
|
|
1
|
+
|
2
|
+
lib = File.expand_path("../lib", __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require "dryad/consul/version"
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "dryad-consul"
|
8
|
+
spec.version = Dryad::Consul::VERSION
|
9
|
+
spec.authors = ["Pan Jie"]
|
10
|
+
spec.email = ["panjie@growingio.com"]
|
11
|
+
|
12
|
+
spec.summary = %q{Dryad consul library.}
|
13
|
+
spec.description = %q{Dryad consul is the adapter for consul.}
|
14
|
+
spec.homepage = "https://github.com/jack0pan/dryad.rb"
|
15
|
+
spec.license = "MIT"
|
16
|
+
|
17
|
+
spec.files = Dir.chdir(File.expand_path('..', __FILE__)) do
|
18
|
+
`git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
19
|
+
end
|
20
|
+
spec.bindir = "exe"
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ["lib"]
|
23
|
+
|
24
|
+
spec.add_dependency "dryad-core", Dryad::Consul::VERSION
|
25
|
+
spec.add_dependency "diplomat"
|
26
|
+
|
27
|
+
spec.add_development_dependency "bundler", "~> 2.0"
|
28
|
+
spec.add_development_dependency "rake", "~> 10.0"
|
29
|
+
spec.add_development_dependency "rspec", "~> 3.0"
|
30
|
+
end
|