elementary-rpc 2.4.0.56 → 2.5.0.62

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,15 +1,15 @@
1
1
  ---
2
2
  !binary "U0hBMQ==":
3
3
  metadata.gz: !binary |-
4
- MTUyZmVkOWU4MzE3Mzk1NTY3NmE0YjIyZjJjZjg5ZTE0YmRlNWUzMg==
4
+ ZmVkY2FkOGRmOGU1MmE5N2Q4ODUyZjY1YTI2ZWUwYjI2Mjg5YjM4Nw==
5
5
  data.tar.gz: !binary |-
6
- ODU2MWY2N2M3YjAwYjFmNTI1NTBmOGI1ZTMxNTY4OWYzYmJkOTI3Mw==
6
+ YmJjODk5N2IzMWU3Mjc2NTFjNWRmNjgwYzMwMDQ1MmMwMmU1ZjU1NQ==
7
7
  SHA512:
8
8
  metadata.gz: !binary |-
9
- ZmU4MzY3YmQyYjA0NGNjZWIwY2M1OTNhZGJjODAwNmQ0OTE4NjUxYWVhNWRi
10
- YjQyODlhMjViNTcxYjg1NzY3MGY3MzkwN2U3YmE5NmQ3OTFjZDI0ZDJkNDI1
11
- YzMwY2E3ZTc0YjgzYzE3ZmZlNjA0MDQxOTljNWJlNjk4Y2YzNDI=
9
+ MGM0YTI1MGU3OTc2ODFiMWFhOGU3Mzg3MjBmZTE2OTUzNTYwYjNmZGQ3Njcy
10
+ NGMyNGNiYzM5NmE5OThmZDNmZjQxNjA1NzdiNTgzOTIxODEyZjk4NDIzYTM0
11
+ OGJhYzIwMmI3YzQ0ODllODQ1N2Q4MWJjZmViNDIxMmQyZTIzMzU=
12
12
  data.tar.gz: !binary |-
13
- YmQzNzUxYmY3MDZlYjc4ODY3Y2QyZDYyYjc3Mzg1MmM0NzIwNWI2ZTVjYzc0
14
- OThjYTc3MDdiYzlkMzg2NDdhNTcyZGZjN2ZmMDdlZDliZGYwOGZiY2M0MWE1
15
- Njk4MGQxNGU2OGRjNjZhN2NlYTdjMmNkNjIxYTcwMGM2ZTFmODA=
13
+ NzBlMDMwYmMyYzdjOGVlMWIyMTQ1ZmEzYTk2MzA0OGYwZTcwNDRhZGM0MmU1
14
+ MDAzMDI0NzI4NzlkZDQ2N2YwNDJmNWU3MDY3MjRmNjljMjlhOWVkOGZkZjNk
15
+ NjExMjYzMDRhNmMzN2ZiM2U4MmM0YmI5NTE1YjRlNmQ4OTNkMmM=
data/README.md CHANGED
@@ -37,10 +37,11 @@ require 'elementary'
37
37
  require 'echoserv/service.pb' # Include our protobuf object declarations
38
38
 
39
39
 
40
+ # You may, optionally, include a :protocol (e.g. 'https') key in a host hash
40
41
  hosts = [{:host => 'localhost', :port => '9292', :prefix => '/rpcserv'}]
41
42
 
42
43
 
43
- # Let's use the Statsd middleware to send RPC timing and count information to
44
+ # Let's use the Statsd middleware to send RPC timing and count information to
44
45
  # Graphite (this presumes we have already used `Statsd.create_instance` elsewhere
45
46
  # in our code)
46
47
  Elementary.use(Elementary::Middleware::Statsd, :client => Statsd.instance)
@@ -47,7 +47,9 @@ module Elementary
47
47
  # elasticsearch-ruby
48
48
  host = @hosts.first
49
49
  prefix = host[:prefix]
50
- return "http://#{host[:host]}:#{host[:port]}/#{prefix}"
50
+ protocol = host[:protocol] || 'http'
51
+
52
+ return "#{protocol}://#{host[:host]}:#{host[:port]}/#{prefix}"
51
53
  end
52
54
 
53
55
  def client
@@ -1,3 +1,3 @@
1
1
  module Elementary
2
- VERSION = "2.4.0"
2
+ VERSION = "2.5.0"
3
3
  end
@@ -38,6 +38,22 @@ describe Elementary::Transport::HTTP do
38
38
 
39
39
  it { should eql 'http://localhost:8080/rspec' }
40
40
  end
41
+
42
+ context 'without a protocol' do
43
+ let(:hosts) do
44
+ [ { :host => 'localhost', :port => 8080 } ]
45
+ end
46
+
47
+ it { should eql 'http://localhost:8080/' }
48
+ end
49
+
50
+ context 'with a protocol' do
51
+ let(:hosts) do
52
+ [ { :host => 'localhost', :port => 8080, :protocol => 'https' } ]
53
+ end
54
+
55
+ it { should eql 'https://localhost:8080/' }
56
+ end
41
57
  end
42
58
 
43
59
  describe '#client' do
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: elementary-rpc
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.4.0.56
4
+ version: 2.5.0.62
5
5
  platform: ruby
6
6
  authors:
7
7
  - R. Tyler Croy
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-02-04 00:00:00.000000000 Z
11
+ date: 2016-02-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler