crossbar-http 0.1.0 → 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9530ff099336cf9bdd53fef13a14a4bbd300d4f7
4
- data.tar.gz: 1f388882acb44ab8a45cf04d2f4a2c1ff3023545
3
+ metadata.gz: 19a2298c3a79adeae874b6b4dcff452bbdf536a0
4
+ data.tar.gz: 2dc0cf90b84e592ae2b570665c17e6dcfa96c8ee
5
5
  SHA512:
6
- metadata.gz: 549fbec78e190dee8cc82aa7817865979c609e6e759a2b12d9cf9f2fb77cb7292ce9d9fcb8e4e2772bf256aa44ea9900fcb94fdaca2f6862bc95155d704fe586
7
- data.tar.gz: b8c76b295948e7c8f814b04f94ad5c12085338cf43109f53ecd7dc98f9912188e8c602857e0130897671c7a2c8e4bef72f0217c9abd723a2718e2939603addab
6
+ metadata.gz: ba1b8ddb833e5cf23c4f5dba920848d5795a54d6568d8ca92747339369f62ac146870dc9e5a2418a652f07b5febb65e06f51326c32e39c2ba71769a706fbc389
7
+ data.tar.gz: 8a0a5e9d2bae3b7958c8479600a2a12d91eb797b88eeed8acdc9788a7614fd9f505af947c33bbd2b0315735f564d9e4bece81ccd75cc46c04a9a18d43254b3a0
data/.gitignore CHANGED
@@ -8,3 +8,4 @@
8
8
  /spec/reports/
9
9
  /tmp/
10
10
  .idea/
11
+ /dist/
data/README.md CHANGED
@@ -6,8 +6,11 @@ Module that provides methods for accessing Crossbar.io HTTP Bridge Services
6
6
 
7
7
  ## Revision History
8
8
 
9
- - v0.1:
9
+ - v0.1.0:
10
10
  - Initial version
11
+ - v0.1.1:
12
+ - Fixed typos in README
13
+ - Added support for https (I didn't know the library I was using didn't)
11
14
 
12
15
  ## Installation
13
16
 
@@ -21,8 +24,8 @@ gem 'crossbar-http'
21
24
  To call a Crossbar HTTP bridge, do the following
22
25
 
23
26
  ``` ruby
24
- client = Crossbar::HTTP::Client("http://127.0.0.1/call")
25
- result = client.call("com.example.add", 2, 3, offset=10)
27
+ client = Crossbar::HTTP::Client.new("http://127.0.0.1/call")
28
+ result = client.call("com.example.add", 2, 3, offset: 10)
26
29
  ```
27
30
 
28
31
  This will call the following method
@@ -41,8 +44,8 @@ def onJoin(self, details):
41
44
  To publish to a Crossbar HTTP bridge, do the following
42
45
 
43
46
  ``` ruby
44
- client = Crossbar::HTTP::Client("http://127.0.0.1/publish")
45
- result = client.publish("com.example.event", event="new event")
47
+ client = Crossbar::HTTP::Client.new("http://127.0.0.1/publish")
48
+ result = client.publish("com.example.event", event: "new event")
46
49
  ```
47
50
 
48
51
  The receiving subscription would look like
@@ -61,7 +64,7 @@ For bridge services that have a key and secret defined, simply include the key a
61
64
  client.
62
65
 
63
66
  ``` ruby
64
- client = Crossbar::HTTP::Client("http://127.0.0.1/publish", key: "key", secret: "secret")
67
+ client = Crossbar::HTTP::Client.new("http://127.0.0.1/publish", key: "key", secret: "secret")
65
68
  ```
66
69
 
67
70
  ## Contributing
@@ -133,11 +133,11 @@ module Crossbar
133
133
  self.sequence += 1
134
134
 
135
135
  # Create the request
136
- req = Net::HTTP::Post.new(uri)
137
- req['Content-Type'] = 'application/json'
138
- req.body = encoded_params
136
+ res = Net::HTTP.start(uri.hostname, uri.port, :use_ssl => uri.scheme == 'https') do |http|
137
+ req = Net::HTTP::Post.new(uri)
138
+ req['Content-Type'] = 'application/json'
139
+ req.body = encoded_params
139
140
 
140
- res = Net::HTTP.start(uri.hostname, uri.port) do |http|
141
141
  http.request(req)
142
142
  end
143
143
 
@@ -1,5 +1,5 @@
1
1
  module Crossbar
2
2
  module HTTP
3
- VERSION = '0.1.0'
3
+ VERSION = '0.1.1'
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: crossbar-http
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.0
4
+ version: 0.1.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Eric Chapman
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2017-01-22 00:00:00.000000000 Z
11
+ date: 2017-02-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler