elementary-rpc 2.0.0 → 2.0.1
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 +4 -4
- data/README.md +11 -11
- data/lib/elementary/transport/http.rb +4 -2
- data/lib/elementary/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 01d8929a493192dbf8c12d6d5046dbe3f774ef27
|
4
|
+
data.tar.gz: 1cb9f7bce35278ca545912ff9e6e16ea42831aef
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 8ee48e01fe3789e12c364396ffebfb6df086c498bd3f993506991e7c9dfb222c5ab117aa2752ceda7f73c5ef4c767753ae631cdfbf56d3e2d14074eccd2cbf3f
|
7
|
+
data.tar.gz: d891ab7b2dae7b0971e76521b55327620dce0db5ddf0ea8ac516c777a270d0083d45bf1c21ceb3d7085df16e79d6736337620e3eb2f04b0992e053d842429b74
|
data/README.md
CHANGED
@@ -81,10 +81,6 @@ Or install it yourself as:
|
|
81
81
|
|
82
82
|
$ gem install elementary-rpc
|
83
83
|
|
84
|
-
## Usage
|
85
|
-
|
86
|
-
TODO: Write usage instructions here
|
87
|
-
|
88
84
|
## Contributing
|
89
85
|
|
90
86
|
1. Fork it ( https://github.com/[my-github-username]/elementary-rpc/fork )
|
@@ -96,10 +92,12 @@ TODO: Write usage instructions here
|
|
96
92
|
### Testing
|
97
93
|
|
98
94
|
Install ha-proxy for your OS
|
99
|
-
For Mac OSX, good reference source is
|
100
|
-
|
95
|
+
For Mac OSX, good reference source is:
|
96
|
+
http://nepalonrails.tumblr.com/post/9674428224/setup-haproxy-for-development-environment-on-mac
|
101
97
|
|
102
|
-
|
98
|
+
Sample ha-proxy config
|
99
|
+
```ruby
|
100
|
+
>cat /etc/haproxy.conf
|
103
101
|
global
|
104
102
|
maxconn 4096
|
105
103
|
pidfile ~/tmp/haproxy-queue.pid
|
@@ -138,14 +136,16 @@ Install ha-proxy for your OS
|
|
138
136
|
listen haproxyapp_admin:9100 127.0.0.1:9100
|
139
137
|
mode http
|
140
138
|
stats uri /
|
141
|
-
|
139
|
+
```
|
142
140
|
Start ha-proxy listener
|
143
|
-
|
141
|
+
|
142
|
+
haproxy -f /etc/haproxy.conf
|
144
143
|
|
145
144
|
Start the server hosting the rpc as below:
|
146
|
-
|
145
|
+
|
146
|
+
bundle exec rpc_server start ./spec/support/simpleservice.rb -p 8000 --http
|
147
147
|
|
148
148
|
Run the tests
|
149
|
-
`bundle exec rspec spec`
|
150
149
|
|
150
|
+
bundle exec rspec spec
|
151
151
|
|
@@ -17,7 +17,7 @@ module Elementary
|
|
17
17
|
# @param [Hash] opts Options to be passed directly into Faraday.
|
18
18
|
def initialize(hosts, opts={})
|
19
19
|
@hosts = hosts
|
20
|
-
@options = opts
|
20
|
+
@options = Hashie::Mash.new({:logging => true, :logger => :logger}).merge(opts)
|
21
21
|
end
|
22
22
|
|
23
23
|
def call(service, rpc_method, *params)
|
@@ -49,9 +49,11 @@ module Elementary
|
|
49
49
|
return @client if @client
|
50
50
|
|
51
51
|
faraday_options = @options.merge({:url => host_url})
|
52
|
+
logging = faraday_options.delete(:logging)
|
53
|
+
logger = faraday_options.delete(:logger)
|
52
54
|
@client = Faraday.new(faraday_options) do |f|
|
53
55
|
f.request :raise_on_status
|
54
|
-
f.response :logger
|
56
|
+
f.response :logger if logging and logger
|
55
57
|
f.adapter :net_http_persistent
|
56
58
|
end
|
57
59
|
return @client
|
data/lib/elementary/version.rb
CHANGED
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.0.
|
4
|
+
version: 2.0.1
|
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: 2015-03
|
11
|
+
date: 2015-04-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
requirement: !ruby/object:Gem::Requirement
|