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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3871e63211b7396a0ba438cf859071efd30a810c
4
- data.tar.gz: e93b0f9b640106a7b305fad091123e61994c25f8
3
+ metadata.gz: bc8880a5a51ce5f7768b4451932407594abbb253
4
+ data.tar.gz: 9f01a4463d21e579692b3dd16399c8f7f8c5c1b7
5
5
  SHA512:
6
- metadata.gz: 99775a4dc3340ef07c1b0a80584c84719e01e59b5926152e74410a372532b6e75362bc992cc85b59e26af44fef9ff3243eb152c8e295c827460eb339de439a3c
7
- data.tar.gz: f146f7fee6374a3d34221344999a555ccd67a4a48c793e902df4279b769c87f590227339ed668509596d6d0512f8feac47edfb83623bb13829be47e4678eae5f
6
+ metadata.gz: 94049a7872f4a97b029c2e1840048a144a82b4b8ac4a7f3021a21d5044d070adc22b3a0ba3b26764467d87943a562b74bb039f1ca4652bc7b7354d4ab0df5ff1
7
+ data.tar.gz: 86a6b343e2b324668456aac762fa71d953ca89686bcf25ff0f65a816515ac2e4d510c57886d668c2fa3eb2d8b59655060498cc571100839add4effa767b37036
@@ -78,6 +78,11 @@ module Libmagellan
78
78
  end
79
79
  alias :sub :subscribe
80
80
 
81
+ def unsubscribe(*args)
82
+ @mqtt.unsubscribe(*args)
83
+ end
84
+ alias :unsub :unsubscribe
85
+
81
86
  def get_packet(topic=nil, &block)
82
87
  @mqtt.get_packet(topic, &block)
83
88
  end
@@ -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)
@@ -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
@@ -1,3 +1,3 @@
1
1
  module Libmagellan
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
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.5.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
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-02-20 00:00:00.000000000 Z
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.5.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.5.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