libmagellan 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/libmagellan/core.rb +5 -0
- data/lib/libmagellan/http.rb +1 -0
- data/lib/libmagellan/mqtt.rb +12 -4
- data/lib/libmagellan/version.rb +1 -1
- data/libmagellan.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bc8880a5a51ce5f7768b4451932407594abbb253
|
4
|
+
data.tar.gz: 9f01a4463d21e579692b3dd16399c8f7f8c5c1b7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 94049a7872f4a97b029c2e1840048a144a82b4b8ac4a7f3021a21d5044d070adc22b3a0ba3b26764467d87943a562b74bb039f1ca4652bc7b7354d4ab0df5ff1
|
7
|
+
data.tar.gz: 86a6b343e2b324668456aac762fa71d953ca89686bcf25ff0f65a816515ac2e4d510c57886d668c2fa3eb2d8b59655060498cc571100839add4effa767b37036
|
data/lib/libmagellan/core.rb
CHANGED
data/lib/libmagellan/http.rb
CHANGED
@@ -64,6 +64,7 @@ module Libmagellan
|
|
64
64
|
$stderr.puts("\e[34m#{uri.to_s}\nHeaders:\n#{headers.inspect}#{verbose_body}\e[0m")
|
65
65
|
end
|
66
66
|
response = case method.downcase.to_sym
|
67
|
+
when :head then http.head(path_query, headers)
|
67
68
|
when :patch then http.patch(path_query, body, headers)
|
68
69
|
when :delete then http.delete(path_query, headers)
|
69
70
|
when :put then http.put(path_query, body, headers)
|
data/lib/libmagellan/mqtt.rb
CHANGED
@@ -85,10 +85,8 @@ module Libmagellan
|
|
85
85
|
alias :pub :publish
|
86
86
|
|
87
87
|
# Subscribe topic(s)
|
88
|
-
# @param [String|Array] topics Subscribe topics
|
89
|
-
def subscribe(topics, &block)
|
90
|
-
topics = [topics] unless topics.is_a?(::Array)
|
91
|
-
topics = topics.select{|t| t.is_a?(::String) }
|
88
|
+
# @param [String|Array|Hash] topics Subscribe topics
|
89
|
+
def subscribe(*topics, &block)
|
92
90
|
with_connection do |c|
|
93
91
|
c.subscribe(*topics)
|
94
92
|
topics.each {|t| log("[SUBSCRIBE] #{t}", Logger::DEBUG) }
|
@@ -99,6 +97,16 @@ module Libmagellan
|
|
99
97
|
end
|
100
98
|
alias :sub :subscribe
|
101
99
|
|
100
|
+
# Unsubscribe topic(s)
|
101
|
+
# @param [String|Array|Hash] topics Subscribe topics
|
102
|
+
def unsubscribe(*topics)
|
103
|
+
with_connection do |c|
|
104
|
+
c.unsubscribe(*topics)
|
105
|
+
topics.each {|t| log("[UNSUBSCRIBE] #{t}", Logger::DEBUG) }
|
106
|
+
end
|
107
|
+
end
|
108
|
+
alias :unsub :unsubscribe
|
109
|
+
|
102
110
|
# Get message to me
|
103
111
|
# @param [String] topic Topic name
|
104
112
|
# @return [Array] topic and payload
|
data/lib/libmagellan/version.rb
CHANGED
data/libmagellan.gemspec
CHANGED
@@ -18,7 +18,7 @@ Gem::Specification.new do |spec|
|
|
18
18
|
spec.test_files = spec.files.grep(%r{^(test|spec|features)/})
|
19
19
|
spec.require_paths = ["lib"]
|
20
20
|
|
21
|
-
spec.add_runtime_dependency "signet", "~> 0.
|
21
|
+
spec.add_runtime_dependency "signet", "~> 0.6.0"
|
22
22
|
spec.add_runtime_dependency "activesupport"
|
23
23
|
spec.add_runtime_dependency "mqtt", "~> 0.3.1"
|
24
24
|
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: libmagellan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- akima
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-09-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: signet
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 0.
|
19
|
+
version: 0.6.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.6.0
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: activesupport
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -140,7 +140,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
140
140
|
version: '0'
|
141
141
|
requirements: []
|
142
142
|
rubyforge_project:
|
143
|
-
rubygems_version: 2.4.5
|
143
|
+
rubygems_version: 2.4.5.1
|
144
144
|
signing_key:
|
145
145
|
specification_version: 4
|
146
146
|
summary: ruby client for magellanic cloud
|