mosca 0.0.3 → 0.0.4
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.rspec +2 -0
- data/.travis.yml +11 -0
- data/Gemfile +5 -0
- data/Gemfile.lock +53 -0
- data/README.md +76 -0
- data/Rakefile +6 -0
- data/lib/mosca.rb +3 -103
- data/lib/mosca/client.rb +89 -0
- data/lib/mosca/exceptions.rb +10 -0
- data/lib/mosca/version.rb +1 -1
- data/mosca.gemspec +6 -1
- data/spec/client_double.rb +8 -5
- data/spec/mosca_spec.rb +106 -29
- data/spec/spec_helper.rb +3 -2
- metadata +75 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 62212685e26483f954066a4aed24f593b1c76126
|
4
|
+
data.tar.gz: cab4daa5e94d3ddfdaa47bb825e91047466fb837
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c837f4511e7e5365698eaf38f3ebfafe9736e1b72149dc68d8b34b1ef1eef55951bd2cf242b52ffc93c080a2fd3331418d6e061aae35fcc551fcc9a20994a316
|
7
|
+
data.tar.gz: f99ac1972ad922a60f9f62b68edd90b838dde7831e13cb8eafbf05e935b8ba94c29c795f057bdc6a6a8058a9b8061ef272c61cbdb957179516252fbc689bf363
|
data/.rspec
ADDED
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,53 @@
|
|
1
|
+
PATH
|
2
|
+
remote: .
|
3
|
+
specs:
|
4
|
+
mosca (0.0.4)
|
5
|
+
json (~> 1.8.1)
|
6
|
+
mqtt (~> 0.3.0)
|
7
|
+
|
8
|
+
GEM
|
9
|
+
remote: https://rubygems.org/
|
10
|
+
specs:
|
11
|
+
codeclimate-test-reporter (0.4.0)
|
12
|
+
simplecov (>= 0.7.1, < 1.0.0)
|
13
|
+
coderay (1.1.0)
|
14
|
+
diff-lcs (1.2.5)
|
15
|
+
docile (1.1.5)
|
16
|
+
json (1.8.1)
|
17
|
+
method_source (0.8.2)
|
18
|
+
mqtt (0.3.0)
|
19
|
+
multi_json (1.10.1)
|
20
|
+
pry (0.10.1)
|
21
|
+
coderay (~> 1.1.0)
|
22
|
+
method_source (~> 0.8.1)
|
23
|
+
slop (~> 3.4)
|
24
|
+
rake (10.3.2)
|
25
|
+
rspec (3.1.0)
|
26
|
+
rspec-core (~> 3.1.0)
|
27
|
+
rspec-expectations (~> 3.1.0)
|
28
|
+
rspec-mocks (~> 3.1.0)
|
29
|
+
rspec-core (3.1.2)
|
30
|
+
rspec-support (~> 3.1.0)
|
31
|
+
rspec-expectations (3.1.0)
|
32
|
+
diff-lcs (>= 1.2.0, < 2.0)
|
33
|
+
rspec-support (~> 3.1.0)
|
34
|
+
rspec-mocks (3.1.0)
|
35
|
+
rspec-support (~> 3.1.0)
|
36
|
+
rspec-support (3.1.0)
|
37
|
+
simplecov (0.9.0)
|
38
|
+
docile (~> 1.1.0)
|
39
|
+
multi_json
|
40
|
+
simplecov-html (~> 0.8.0)
|
41
|
+
simplecov-html (0.8.0)
|
42
|
+
slop (3.6.0)
|
43
|
+
|
44
|
+
PLATFORMS
|
45
|
+
ruby
|
46
|
+
|
47
|
+
DEPENDENCIES
|
48
|
+
bundler
|
49
|
+
codeclimate-test-reporter
|
50
|
+
mosca!
|
51
|
+
pry
|
52
|
+
rake
|
53
|
+
rspec
|
data/README.md
ADDED
@@ -0,0 +1,76 @@
|
|
1
|
+
[![Version ](https://img.shields.io/gem/v/mosca.svg)](https://rubygems.org/gems/mosca)
|
2
|
+
[![Dependency Status](https://gemnasium.com/ionia-corporation/mosca.svg)](https://gemnasium.com/ionia-corporation/mosca)
|
3
|
+
[![Code Climate](https://codeclimate.com/github/ionia-corporation/mosca.png)](https://codeclimate.com/github/ionia-corporation/mosca)
|
4
|
+
[![Build Status](https://img.shields.io/travis/ionia-corporation/mosca/master.svg)](https://travis-ci.org/ionia-corporation/mosca)
|
5
|
+
[![Coverage ](https://img.shields.io/codeclimate/coverage/github/ionia-corporation/mosca.svg)](https://codeclimate.com/github/ionia-corporation/mosca)
|
6
|
+
|
7
|
+
|
8
|
+
# Mosca
|
9
|
+
|
10
|
+
A simple client for mqtt communication
|
11
|
+
|
12
|
+
## Installation
|
13
|
+
|
14
|
+
Add this line to your application's Gemfile:
|
15
|
+
|
16
|
+
gem 'mosca'
|
17
|
+
|
18
|
+
And then execute:
|
19
|
+
|
20
|
+
$ bundle
|
21
|
+
|
22
|
+
Or install it yourself as:
|
23
|
+
|
24
|
+
$ gem install mosca
|
25
|
+
|
26
|
+
## Usage
|
27
|
+
|
28
|
+
### Configure
|
29
|
+
|
30
|
+
You can configure the default timeout for response, and default mqtt broker.
|
31
|
+
|
32
|
+
```ruby
|
33
|
+
Mosca::Client.default_timeout = 10 # 10 seconds
|
34
|
+
Mosca::Client.default_broker = "test.mosquitto.org"
|
35
|
+
```
|
36
|
+
|
37
|
+
### New instance
|
38
|
+
|
39
|
+
```ruby
|
40
|
+
client = Mosca::Client.new user: "username", pass: "password", topic_in: "readings", topic_out: "commands", topic_base: "/device/"
|
41
|
+
```
|
42
|
+
|
43
|
+
### Publishing
|
44
|
+
|
45
|
+
#### Single message
|
46
|
+
|
47
|
+
```ruby
|
48
|
+
client.publish "restart" # will be sent to topic /device/commands
|
49
|
+
```
|
50
|
+
|
51
|
+
#### Message with response
|
52
|
+
|
53
|
+
```ruby
|
54
|
+
response = client.publish "some_command", response: true, topic_in: "responses" # will publish and wait for a response on the /device/responses topic
|
55
|
+
|
56
|
+
```
|
57
|
+
|
58
|
+
### Getting messages
|
59
|
+
|
60
|
+
```ruby
|
61
|
+
puts client.get # will wait up to Mosca.default_timeout (default 5) seconds. will return if no response comes.
|
62
|
+
|
63
|
+
puts client.get timeout: 2, topic_in: "another_topic" # will wait up to 2 seconds for a response on the another_topic topic.
|
64
|
+
```
|
65
|
+
|
66
|
+
###TO DO
|
67
|
+
|
68
|
+
Readme not complete yet
|
69
|
+
|
70
|
+
## Contributing
|
71
|
+
|
72
|
+
1. Fork it
|
73
|
+
2. Create your feature branch (`git checkout -b my-new-feature`)
|
74
|
+
3. Commit your changes (`git commit -am 'Add some feature'`)
|
75
|
+
4. Push to the branch (`git push origin my-new-feature`)
|
76
|
+
5. Create new Pull Request
|
data/Rakefile
ADDED
data/lib/mosca.rb
CHANGED
@@ -1,105 +1,5 @@
|
|
1
|
-
require '
|
2
|
-
require '
|
1
|
+
require 'mosca/client'
|
2
|
+
require 'mosca/exceptions'
|
3
3
|
|
4
|
-
|
5
|
-
@@default_broker = "test.mosquitto.org"
|
6
|
-
@@default_timeout = 5
|
7
|
-
@@debug = false
|
8
|
-
|
9
|
-
attr_accessor :user, :pass, :topic_in, :topic_out, :broker, :topic_base, :client
|
10
|
-
|
11
|
-
def initialize params = {}
|
12
|
-
@user = params[:user]
|
13
|
-
@pass = params[:pass]
|
14
|
-
@topic_in = params[:topic_in]
|
15
|
-
@topic_out = params[:topic_out]
|
16
|
-
@topic_base = params[:topic_base] || ""
|
17
|
-
@broker = params[:broker] || @@default_broker
|
18
|
-
@client = params[:client] || MQTT::Client
|
19
|
-
end
|
20
|
-
|
21
|
-
def publish json, params = {}
|
22
|
-
connection do |c|
|
23
|
-
topic = params[:topic_out] || @topic_out
|
24
|
-
debug "[start publish] " + timestamp
|
25
|
-
c.subscribe(topic_base + topic_in) if params[:response]
|
26
|
-
c.publish(topic_base + topic,json)
|
27
|
-
debug "[end publish] " + timestamp
|
28
|
-
if params[:response]
|
29
|
-
return get(params.merge({connection: c}))
|
30
|
-
end
|
31
|
-
end
|
32
|
-
end
|
33
|
-
|
34
|
-
def get params = {}
|
35
|
-
response = {}
|
36
|
-
connection(params) do |c|
|
37
|
-
topic = params[:topic_in] || @topic_in
|
38
|
-
timeout = params[:timeout] || @@default_timeout
|
39
|
-
begin
|
40
|
-
Timeout.timeout(timeout) do
|
41
|
-
debug "[start get] " + timestamp
|
42
|
-
c.get(topic_base + topic) do |topic, message|
|
43
|
-
response = parse_response message
|
44
|
-
break
|
45
|
-
end
|
46
|
-
debug "[end get] " + timestamp
|
47
|
-
end
|
48
|
-
rescue
|
49
|
-
end
|
50
|
-
end
|
51
|
-
response
|
52
|
-
end
|
53
|
-
|
54
|
-
def self.default_broker= param
|
55
|
-
@@default_broker = param
|
56
|
-
end
|
57
|
-
|
58
|
-
def self.default_timeout= param
|
59
|
-
@@default_timeout = param
|
60
|
-
end
|
61
|
-
|
62
|
-
def self.debug= param
|
63
|
-
@@debug = param
|
64
|
-
end
|
65
|
-
|
66
|
-
private
|
67
|
-
|
68
|
-
def opts
|
69
|
-
{remote_host: @broker, username: @user, password: @pass}
|
70
|
-
end
|
71
|
-
|
72
|
-
def connection params = {}
|
73
|
-
if params[:connection]
|
74
|
-
yield params[:connection]
|
75
|
-
else
|
76
|
-
@client.connect(opts) do |c|
|
77
|
-
yield c
|
78
|
-
end
|
79
|
-
end
|
80
|
-
end
|
81
|
-
|
82
|
-
def parse_response response
|
83
|
-
if valid_json? response
|
84
|
-
response = JSON.parse response
|
85
|
-
end
|
86
|
-
response
|
87
|
-
end
|
88
|
-
|
89
|
-
def valid_json? json_
|
90
|
-
begin
|
91
|
-
JSON.parse(json_)
|
92
|
-
return true
|
93
|
-
rescue
|
94
|
-
return false
|
95
|
-
end
|
96
|
-
end
|
97
|
-
|
98
|
-
def debug message
|
99
|
-
puts message if @@debug
|
100
|
-
end
|
101
|
-
|
102
|
-
def timestamp
|
103
|
-
Time.new.to_f.to_s
|
104
|
-
end
|
4
|
+
module Mosca
|
105
5
|
end
|
data/lib/mosca/client.rb
ADDED
@@ -0,0 +1,89 @@
|
|
1
|
+
require 'mqtt'
|
2
|
+
require 'json'
|
3
|
+
require 'mosca/exceptions'
|
4
|
+
|
5
|
+
module Mosca
|
6
|
+
|
7
|
+
class Client
|
8
|
+
|
9
|
+
class << self
|
10
|
+
attr_accessor :default_broker, :default_timeout
|
11
|
+
end
|
12
|
+
|
13
|
+
self.default_broker = ENV["MOSCA_BROKER"] || "test.mosquitto.org"
|
14
|
+
self.default_timeout = 5
|
15
|
+
|
16
|
+
attr_accessor :user, :pass, :topic_in, :topic_out, :broker, :topic_base, :client
|
17
|
+
|
18
|
+
def initialize args = {}
|
19
|
+
options = default.merge(args)
|
20
|
+
attributes.each do |attribute|
|
21
|
+
send "#{attribute}=".to_sym, options[attribute]
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
25
|
+
def publish json, params = {}
|
26
|
+
topic_out = params[:topic_out] || params[:topic] || @topic_out || Exceptions.raise_missing_topic
|
27
|
+
topic_in = params[:topic_in] || @topic_in
|
28
|
+
connection.subscribe full_topic(topic_in) if params[:response]
|
29
|
+
connection.publish full_topic(topic_out), json
|
30
|
+
get(params) if params[:response]
|
31
|
+
end
|
32
|
+
|
33
|
+
def get! params = {}
|
34
|
+
timeout(params) do
|
35
|
+
topic = params[:topic_in] || params[:topic] || @topic_in || Exceptions.raise_missing_topic
|
36
|
+
connection.get(full_topic topic) do |topic, message|
|
37
|
+
return parse_response message
|
38
|
+
end
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def get params = {}
|
43
|
+
get! params
|
44
|
+
rescue Timeout::Error
|
45
|
+
nil
|
46
|
+
end
|
47
|
+
|
48
|
+
def full_topic topic_name
|
49
|
+
topic_base + topic_name
|
50
|
+
end
|
51
|
+
|
52
|
+
private
|
53
|
+
|
54
|
+
def default
|
55
|
+
{ topic_base: "",
|
56
|
+
broker: self.class.default_broker,
|
57
|
+
client: MQTT::Client }
|
58
|
+
end
|
59
|
+
|
60
|
+
def attributes
|
61
|
+
[:user, :pass, :topic_in, :topic_out, :topic_base, :broker, :client]
|
62
|
+
end
|
63
|
+
|
64
|
+
def client_options
|
65
|
+
{remote_host: @broker, username: @user, password: @pass}
|
66
|
+
end
|
67
|
+
|
68
|
+
def connection
|
69
|
+
if @connection and @connection.connected?
|
70
|
+
@connection
|
71
|
+
else
|
72
|
+
@connection ||= @client.connect(client_options)
|
73
|
+
end
|
74
|
+
end
|
75
|
+
|
76
|
+
def parse_response response
|
77
|
+
JSON.parse response
|
78
|
+
rescue JSON::ParserError
|
79
|
+
response
|
80
|
+
end
|
81
|
+
|
82
|
+
def timeout params
|
83
|
+
timeout = params[:timeout] || self.class.default_timeout
|
84
|
+
Timeout.timeout(timeout) do
|
85
|
+
yield
|
86
|
+
end
|
87
|
+
end
|
88
|
+
end
|
89
|
+
end
|
data/lib/mosca/version.rb
CHANGED
data/mosca.gemspec
CHANGED
@@ -19,6 +19,11 @@ Gem::Specification.new do |s|
|
|
19
19
|
s.test_files = s.files.grep(%r{^(test|spec|features)/})
|
20
20
|
s.require_paths = ["lib"]
|
21
21
|
|
22
|
-
s.add_dependency 'mqtt', '~> 0.
|
22
|
+
s.add_dependency 'mqtt', '~> 0.3.0'
|
23
23
|
s.add_dependency 'json', '~> 1.8.1'
|
24
|
+
|
25
|
+
s.add_development_dependency 'bundler'
|
26
|
+
s.add_development_dependency 'rake'
|
27
|
+
s.add_development_dependency 'rspec'
|
28
|
+
s.add_development_dependency 'pry'
|
24
29
|
end
|
data/spec/client_double.rb
CHANGED
@@ -1,20 +1,23 @@
|
|
1
1
|
class ClientDouble
|
2
|
+
attr_accessor :connected
|
2
3
|
def connect *args
|
3
|
-
|
4
|
+
connected = true
|
5
|
+
self
|
4
6
|
end
|
5
7
|
|
6
|
-
def
|
8
|
+
def connected?
|
9
|
+
!! connected
|
10
|
+
end
|
11
|
+
|
12
|
+
def method_missing *args
|
7
13
|
|
8
14
|
end
|
9
15
|
|
10
16
|
def get topic, *args
|
11
|
-
|
12
17
|
if topic == "json_in_topic"
|
13
18
|
response = '{"a":123}'
|
14
|
-
|
15
19
|
elsif topic == "json_array_in_topic"
|
16
20
|
response = '["a",1,2]'
|
17
|
-
|
18
21
|
else
|
19
22
|
response = "response"
|
20
23
|
end
|
data/spec/mosca_spec.rb
CHANGED
@@ -1,51 +1,128 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
|
-
describe Mosca do
|
3
|
+
describe Mosca::Client do
|
4
4
|
OUT = "out_topic"
|
5
5
|
IN = "in_topic"
|
6
|
-
|
6
|
+
MESSAGE = "test_message"
|
7
7
|
|
8
|
-
|
9
|
-
|
10
|
-
|
11
|
-
|
12
|
-
|
8
|
+
let (:client) {
|
9
|
+
ClientDouble.new
|
10
|
+
}
|
11
|
+
|
12
|
+
let (:mosca) {
|
13
|
+
Mosca::Client.new topic_out: OUT, topic_in: IN, client: client
|
14
|
+
}
|
13
15
|
|
14
16
|
it "has a default broker" do
|
15
|
-
|
17
|
+
expect(mosca.broker).to eq("test.mosquitto.org")
|
16
18
|
end
|
17
19
|
|
18
|
-
it "
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
new_out_topic = "other_out_topic"
|
24
|
-
@client_double.should_receive(:publish).with(new_out_topic,@test_message)
|
25
|
-
@mosca.publish @test_message, topic_out: new_out_topic
|
20
|
+
it "has attribute accessors" do
|
21
|
+
%w{user pass broker topic_in topic_out topic_base}.each do |attr|
|
22
|
+
expect(mosca).to respond_to(attr.to_sym)
|
23
|
+
expect(mosca).to respond_to("#{attr}=".to_sym)
|
24
|
+
end
|
26
25
|
end
|
27
26
|
|
28
|
-
|
29
|
-
|
30
|
-
|
27
|
+
describe "publishing" do
|
28
|
+
it "uses topic_out to publish if it was specified, and publishes the desired message" do
|
29
|
+
expect(client).to receive(:publish).with(OUT,MESSAGE)
|
30
|
+
mosca.publish MESSAGE
|
31
|
+
end
|
32
|
+
|
33
|
+
it "can take a topic_out as argument when publishing" do
|
34
|
+
new_out_topic = "other_out_topic"
|
35
|
+
expect(client).to receive(:publish).with(new_out_topic,MESSAGE)
|
36
|
+
mosca.publish MESSAGE, topic_out: new_out_topic
|
37
|
+
end
|
38
|
+
|
39
|
+
it "should wait for a response on topic_in if it's specified" do
|
40
|
+
expect(client).to receive(:connect).once.and_call_original
|
41
|
+
expect(mosca.publish(MESSAGE, response: true)).to eq("response")
|
42
|
+
end
|
31
43
|
end
|
32
44
|
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
45
|
+
describe "subscribing" do
|
46
|
+
it "uses topic_in to get messages if it was specified" do
|
47
|
+
expect(client).to receive(:get).with(IN)
|
48
|
+
mosca.get
|
49
|
+
end
|
50
|
+
|
51
|
+
it "can take a topic_in as argument when getting" do
|
52
|
+
new_in_topic = "other_in_topic"
|
53
|
+
expect(client).to receive(:get).with(new_in_topic)
|
54
|
+
mosca.get topic_in: new_in_topic
|
55
|
+
end
|
56
|
+
|
57
|
+
it "will receive the message with get" do
|
58
|
+
expect(mosca.get).to eq("response")
|
59
|
+
end
|
37
60
|
end
|
38
61
|
|
39
|
-
|
40
|
-
|
62
|
+
describe "parsing the incoming messages" do
|
63
|
+
it "gets a hash if the message was a JSON object" do
|
64
|
+
expect(mosca.get topic_in: "json_in_topic").to be_a Hash
|
65
|
+
end
|
66
|
+
|
67
|
+
it "gets an array if the message was a JSON array" do
|
68
|
+
expect(mosca.get topic_in: "json_array_in_topic").to be_a Array
|
69
|
+
end
|
70
|
+
|
71
|
+
it "gets plain text if the message aint JSON" do
|
72
|
+
expect(mosca.get topic_in: "plain_in_topic").to be_a String
|
73
|
+
end
|
41
74
|
end
|
42
75
|
|
43
|
-
|
44
|
-
|
76
|
+
describe "formatting the topic names" do
|
77
|
+
before do
|
78
|
+
mosca.topic_base = "/base/"
|
79
|
+
end
|
80
|
+
|
81
|
+
it "uses topic_base to form the full topic for publishing and receiving" do
|
82
|
+
expect(client).to receive(:get).with("/base/#{IN}")
|
83
|
+
expect(client).to receive(:publish).with("/base/#{OUT}", MESSAGE)
|
84
|
+
mosca.get
|
85
|
+
mosca.publish MESSAGE
|
86
|
+
end
|
45
87
|
end
|
46
88
|
|
47
|
-
|
48
|
-
|
89
|
+
describe "Exceptions raising" do
|
90
|
+
describe "raises MissingTopic" do
|
91
|
+
it "when publishing without topic" do
|
92
|
+
mosca.topic_out = nil
|
93
|
+
expect { mosca.publish "hi" }.to raise_error Mosca::Exceptions::MissingTopic
|
94
|
+
end
|
95
|
+
|
96
|
+
it "when getting without topic" do
|
97
|
+
mosca.topic_in = nil
|
98
|
+
expect { mosca.get }.to raise_error Mosca::Exceptions::MissingTopic
|
99
|
+
end
|
100
|
+
end
|
49
101
|
end
|
50
102
|
|
103
|
+
describe "Timeout" do
|
104
|
+
it "has a default timeout of 5 seconds" do
|
105
|
+
expect(Mosca::Client.default_timeout).to eq(5)
|
106
|
+
end
|
107
|
+
|
108
|
+
it "can set a default timeout" do
|
109
|
+
described_class.default_timeout = 1
|
110
|
+
expect(described_class.default_timeout).to eq 1
|
111
|
+
end
|
112
|
+
|
113
|
+
it "calls timeout when getting a message" do
|
114
|
+
expect(Timeout).to receive(:timeout)
|
115
|
+
mosca.get
|
116
|
+
end
|
117
|
+
|
118
|
+
context "time runs out" do
|
119
|
+
before do
|
120
|
+
expect(Timeout).to receive(:timeout).and_raise Timeout::Error
|
121
|
+
end
|
122
|
+
|
123
|
+
it "get returns nil" do
|
124
|
+
expect(mosca.get).to be nil
|
125
|
+
end
|
126
|
+
end
|
127
|
+
end
|
51
128
|
end
|
data/spec/spec_helper.rb
CHANGED
metadata
CHANGED
@@ -1,51 +1,115 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: mosca
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.4
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Armando Andini
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-09-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: mqtt
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.3.0
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 0.
|
26
|
+
version: 0.3.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: json
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: 1.8.1
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: 1.8.1
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: bundler
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - ">="
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - ">="
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rake
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: rspec
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: pry
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - ">="
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '0'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
41
97
|
description: A simple client for mqtt communication
|
42
98
|
email: armando.andini@hotmail.com
|
43
99
|
executables: []
|
44
100
|
extensions: []
|
45
101
|
extra_rdoc_files: []
|
46
102
|
files:
|
103
|
+
- ".rspec"
|
104
|
+
- ".travis.yml"
|
105
|
+
- Gemfile
|
106
|
+
- Gemfile.lock
|
107
|
+
- README.md
|
108
|
+
- Rakefile
|
47
109
|
- lib/command_builder.rb
|
48
110
|
- lib/mosca.rb
|
111
|
+
- lib/mosca/client.rb
|
112
|
+
- lib/mosca/exceptions.rb
|
49
113
|
- lib/mosca/version.rb
|
50
114
|
- mosca.gemspec
|
51
115
|
- spec/client_double.rb
|
@@ -61,17 +125,17 @@ require_paths:
|
|
61
125
|
- lib
|
62
126
|
required_ruby_version: !ruby/object:Gem::Requirement
|
63
127
|
requirements:
|
64
|
-
- -
|
128
|
+
- - ">="
|
65
129
|
- !ruby/object:Gem::Version
|
66
130
|
version: '0'
|
67
131
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
68
132
|
requirements:
|
69
|
-
- -
|
133
|
+
- - ">="
|
70
134
|
- !ruby/object:Gem::Version
|
71
135
|
version: '0'
|
72
136
|
requirements: []
|
73
137
|
rubyforge_project:
|
74
|
-
rubygems_version: 2.
|
138
|
+
rubygems_version: 2.4.1
|
75
139
|
signing_key:
|
76
140
|
specification_version: 4
|
77
141
|
summary: MQTT messaging made easy
|