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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9bcc7e0abcf56202698d9b852c208a0fe8e5bf24
4
- data.tar.gz: a7c0bcba0eee1e4a21bde6c30a9fa05fb6b68200
3
+ metadata.gz: 01d8929a493192dbf8c12d6d5046dbe3f774ef27
4
+ data.tar.gz: 1cb9f7bce35278ca545912ff9e6e16ea42831aef
5
5
  SHA512:
6
- metadata.gz: 16397a5bece8062d1de4189cdb8355e8379aca6bdf6d2b4c6fbf799700cb5758fb452b3b241cbbe59256b60f3c4202115cb696f4555bc2d26cec49705db07cdb
7
- data.tar.gz: 976eccc0b54ad4f07f6a607b05ef173f0fdb53bda76427c61e31d21dc835cea5da2ddd842358d47e206554267ad763f2f6c5542207d52c4be2c0af7475b7d493
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 http://nepalonrails.tumblr.com/post/9674428224/setup-haproxy-for-development-environment-on-mac
100
- Sample ha-proxy config
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
- cat /etc/haproxy.conf
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
- haproxy -f /etc/haproxy.conf
141
+
142
+ haproxy -f /etc/haproxy.conf
144
143
 
145
144
  Start the server hosting the rpc as below:
146
- `bundle exec rpc_server start ./spec/support/simpleservice.rb -p 8000 --http`
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
@@ -1,4 +1,4 @@
1
1
 
2
2
  module Elementary
3
- VERSION = "2.0.0"
3
+ VERSION = "2.0.1"
4
4
  end
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.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-30 00:00:00.000000000 Z
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