eureka_ruby 0.0.5 → 0.0.6

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: c231db815b0ed282be2c0c09d4e6884f3af8c86f26bad2914dc6b824e66340d1
4
- data.tar.gz: 58e143edfe4d917627359ff2f5fc2f1f91def2e2eae14608bb771c8048ec80d2
3
+ metadata.gz: f5a3affd81e8b8ad6adc8b5c37317153a8e6bb5b37430f54f408b8d343b8690d
4
+ data.tar.gz: ec9904d73a249ae3a1e3a9489644c884ec30af06e5e94812fa1852eae16c1448
5
5
  SHA512:
6
- metadata.gz: b975c783dab0ca17cd34263eee9a21e6b4e104c15429ac1cd7a4ae42f2ecb6592d20a956a02cceb5a95c93187ccc4a50bcc3654ecaf55c35f39035425cde2f02
7
- data.tar.gz: 7b361bd5529480821b072b4b246ca12d7a7815aa108acf179fe3f6e093b3faa4f4e966e9229c946434102107c13dc87a908168fe3f05958b60d55f4a8c7b4768
6
+ metadata.gz: ec7aff78cac558748d2da4d6d93ec74099c4c6d40f2a7de6913198f80cea8335a2c4b635248a18e40260f6108ed533d9752e752ea18682cb2d082f836da89f97
7
+ data.tar.gz: 784b50b37010ef55f43e808e481b7578078905a7f38c9cbbdcead9c3b5dcea6d47d7761ebeacb5671a32da320f50a34c28413b0a2b69e0675751e4ebf444979b
data/Gemfile.lock ADDED
@@ -0,0 +1,38 @@
1
+ PATH
2
+ remote: .
3
+ specs:
4
+ eureka_ruby (0.0.5)
5
+ http (~> 4.0, >= 4.0.5)
6
+
7
+ GEM
8
+ remote: https://rubygems.org/
9
+ specs:
10
+ addressable (2.6.0)
11
+ public_suffix (>= 2.0.2, < 4.0)
12
+ domain_name (0.5.20180417)
13
+ unf (>= 0.0.5, < 1.0.0)
14
+ http (4.1.1)
15
+ addressable (~> 2.3)
16
+ http-cookie (~> 1.0)
17
+ http-form_data (~> 2.0)
18
+ http_parser.rb (~> 0.6.0)
19
+ http-cookie (1.0.3)
20
+ domain_name (~> 0.5)
21
+ http-form_data (2.1.1)
22
+ http_parser.rb (0.6.0)
23
+ public_suffix (3.0.3)
24
+ rake (10.5.0)
25
+ unf (0.1.4)
26
+ unf_ext
27
+ unf_ext (0.0.7.5)
28
+
29
+ PLATFORMS
30
+ ruby
31
+
32
+ DEPENDENCIES
33
+ bundler (~> 1.16)
34
+ eureka_ruby!
35
+ rake (~> 10.0)
36
+
37
+ BUNDLED WITH
38
+ 1.17.2
data/eureka_ruby.gemspec CHANGED
@@ -26,8 +26,8 @@ Gem::Specification.new do |spec|
26
26
  spec.files = `git ls-files -z`.split("\x0").reject do |f|
27
27
  f.match(%r{^(test|spec|features)/})
28
28
  end
29
- spec.bindir = "exe"
30
- spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
29
+ spec.bindir = "bin"
30
+ spec.executables = spec.files.grep(%r{^bin/}) { |f| File.basename(f) }
31
31
  spec.require_paths = ["lib"]
32
32
 
33
33
  spec.add_development_dependency "bundler", "~> 1.16"
@@ -5,5 +5,9 @@
5
5
  module EurekaRuby
6
6
  class Railtie < Rails::Railtie
7
7
  config.app_middleware.insert 0, EurekaRuby::Middleware
8
+
9
+ rake_tasks do
10
+ load 'tasks/eureka.rake'
11
+ end
8
12
  end
9
13
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module EurekaRuby
4
- VERSION = '0.0.5'
4
+ VERSION = '0.0.6'
5
5
  end
data/lib/eureka_ruby.rb CHANGED
@@ -5,6 +5,7 @@ require 'eureka_ruby/middleware'
5
5
  require 'eureka_ruby/configuration'
6
6
  require 'eureka_ruby/executor'
7
7
  require 'eureka_ruby/version'
8
+ require 'eureka_ruby/railtie' if defined? Rails
8
9
 
9
10
  module EurekaRuby
10
11
  class << self
@@ -1,24 +1,23 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- if ENV['EUREKA']
4
- require 'eureka_ruby/railtie'
5
- EurekaRuby.configure do |config|
6
- # Required
7
- config.eureka_url = ENV['EUREKA_URL']
8
- config.app_id = ENV['EUREKA_MS_APP_ID']
9
- config.host_name = ENV.fetch('EUREKA_MS_HOST_NAME', ENV['HOSTNAME'])
10
- config.ip_addr = ENV.fetch('EUREKA_MS_IP_ADDR', ENV['HOSTNAME'])
11
- config.info_response = { "author" => "Tumayun", "language" => "Ruby" }
3
+ EurekaRuby.configure do |config|
4
+ # Required
5
+ config.eureka_url = ENV['EUREKA_URL']
6
+ config.app_id = ENV['EUREKA_MS_APP_ID']
7
+ config.host_name = ENV.fetch('EUREKA_MS_HOST_NAME', ENV['HOSTNAME'])
8
+ config.ip_addr = ENV.fetch('EUREKA_MS_IP_ADDR', ENV['HOSTNAME'])
9
+ config.info_response = { "author" => "Tumayun", "language" => "Ruby" }
12
10
 
13
- # Optional
14
- config.port = ENV.fetch('EUREKA_MS_PORT', ENV['PORT']).to_i # default 3000
15
- config.scheme = ENV.fetch('EUREKA_MS_SCHEMA', 'http') # default http
16
- config.health_path = ENV.fetch('EUREKA_MS_HEALTH_PATH', '/health') # default /health
17
- config.health_response = 'OK' # default OK
18
- config.health_headers = { "Content-Type" => "text/plain" } # default
19
- config.info_path = ENV.fetch('EUREKA_MS_INFO_PATH', '/info') # default /info
20
- end
11
+ # Optional
12
+ config.port = ENV.fetch('EUREKA_MS_PORT', ENV['PORT']).to_i # default 3000
13
+ config.scheme = ENV.fetch('EUREKA_MS_SCHEMA', 'http') # default http
14
+ config.health_path = ENV.fetch('EUREKA_MS_HEALTH_PATH', '/health') # default /health
15
+ config.health_response = 'OK' # default OK
16
+ config.health_headers = { "Content-Type" => "text/plain" } # default
17
+ config.info_path = ENV.fetch('EUREKA_MS_INFO_PATH', '/info') # default /info
18
+ end
21
19
 
20
+ if ENV['EUREKA']
22
21
  # Register Instance
23
22
  EurekaRuby.executor.run(:register)
24
23
 
@@ -0,0 +1,7 @@
1
+ namespace :eureka do
2
+ desc "Eureka Deregister"
3
+ task deregister: :environment do
4
+ puts '-' * 50 + 'Eureka Deregister' + '-' * 50
5
+ EurekaRuby.executor.run(:deregister)
6
+ end
7
+ end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: eureka_ruby
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.5
4
+ version: 0.0.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - 乌托邦科技
8
8
  autorequire:
9
- bindir: exe
9
+ bindir: bin
10
10
  cert_chain: []
11
- date: 2019-03-11 00:00:00.000000000 Z
11
+ date: 2019-03-20 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -62,13 +62,16 @@ description: Eureka Ruby SDK
62
62
  email:
63
63
  - tumayun@uvw.org
64
64
  - wangjiaopeng@uvw.com
65
- executables: []
65
+ executables:
66
+ - console
67
+ - setup
66
68
  extensions: []
67
69
  extra_rdoc_files: []
68
70
  files:
69
71
  - ".gitignore"
70
72
  - CODE_OF_CONDUCT.md
71
73
  - Gemfile
74
+ - Gemfile.lock
72
75
  - LICENSE.txt
73
76
  - README.md
74
77
  - Rakefile
@@ -84,6 +87,7 @@ files:
84
87
  - lib/eureka_ruby/version.rb
85
88
  - lib/generators/eureka_ruby/install_generator.rb
86
89
  - lib/generators/eureka_ruby/templates/eureka_ruby.rb
90
+ - lib/tasks/eureka.rake
87
91
  homepage: https://quanziapp.com
88
92
  licenses:
89
93
  - MIT