bmo 0.8.1 → 0.8.2

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: 400bd7a1ffb123b471fca73b2044ecd7bd969bcc
4
- data.tar.gz: df713f2d5c6795b00518e5cc4b481436668d5934
3
+ metadata.gz: d609b4d26395f9bfda12fb143c998bab3488ca0b
4
+ data.tar.gz: 5d9c2545c5437cded63ebe1649f665561fd46549
5
5
  SHA512:
6
- metadata.gz: 4c389cf9fac211323fccb74fbe567ef388a5d86e458c30a9bfcf6da75be93f63a58735fcc608b349f21fface71d45bdf450a65df4a7de1ca6a7a730e759b0f30
7
- data.tar.gz: 7c5ea04f2c68fa3731e968d3e661f8c880bcab9e07d18719e59791543d5e232a9a24466a102133bc101409d72c0994f8dd36f802bb625182b070da1af26132fb
6
+ metadata.gz: 1abfaa97370cdfc108360ed3084743c53296198bf2d584a46ba16747b427a95187a81decd198ba8c2d52a10b0f6c6d50233eb1e79f39355b1d989b4c03901dc0
7
+ data.tar.gz: d43b396920e000f54ffce756fae5e68ab8a4c0bfc98cd7f3843a13d66581f898e547cd1a5111766300e7eec0f4329ae345cebe0f82fef02dd9a6fc23ef54d2b5
data/Gemfile.lock CHANGED
@@ -26,7 +26,7 @@ GIT
26
26
  PATH
27
27
  remote: .
28
28
  specs:
29
- bmo (0.8.0)
29
+ bmo (0.8.2)
30
30
  equalizer (~> 0.0.0)
31
31
  faraday (~> 0.8.0)
32
32
 
@@ -43,25 +43,23 @@ module BMO
43
43
  end
44
44
  end # class Configuration
45
45
 
46
- module_function
47
-
48
- def configure
46
+ def self.configure
49
47
  yield(configuration) if block_given?
50
48
  configuration
51
49
  end
52
50
 
53
- def configuration
51
+ def self.configuration
54
52
  @configuration ||= Configuration.new
55
53
  end
56
54
 
57
- # Needed because we can't use module_function and attr_writer
55
+ # Help ?
58
56
  # rubocop:disable TrivialAccessors
59
- def configuration=(configuration)
57
+ def self.configuration=(configuration)
60
58
  @configuration = configuration
61
59
  end
62
60
  # rubocop:enable
63
61
 
64
- def reset_configuration
62
+ def self.reset_configuration
65
63
  @configuration = Configuration.new
66
64
  end
67
65
  end # BMO
data/lib/bmo/utils.rb CHANGED
@@ -2,10 +2,8 @@
2
2
  module BMO
3
3
  # Utility module
4
4
  module Utils
5
- module_function
6
-
7
5
  # Coerce string hash keys to symbols
8
- def coerce_to_symbols(hash)
6
+ def self.coerce_to_symbols(hash)
9
7
  hash_symbolized = {}
10
8
  hash.each_pair do |key, value|
11
9
  key = key.to_sym if key.respond_to?(:to_sym)
data/lib/bmo/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # encoding: utf-8
2
2
  # Main BMO module, version get right here
3
3
  module BMO
4
- VERSION = '0.8.1'.freeze
4
+ VERSION = '0.8.2'.freeze
5
5
  end
data/lib/bmo.rb CHANGED
@@ -20,9 +20,6 @@ require 'bmo/gcm/client'
20
20
 
21
21
  # Main BMO namespace
22
22
  module BMO
23
- # All the methods will be Class Methods
24
- module_function
25
-
26
23
  # Send ios notification with the configuration of BMO
27
24
  # (see #BMO::Configuration)
28
25
  #
@@ -34,7 +31,7 @@ module BMO
34
31
  # @see https://developer.apple.com/library/ios/documentation/
35
32
  # NetworkingInternet/Conceptual/RemoteNotificationsPG/
36
33
  # Chapters/ApplePushService.html
37
- def send_ios_notification(device_token, data)
34
+ def self.send_ios_notification(device_token, data)
38
35
  notification = APNS::Notification.new(device_token, data)
39
36
  apns_client.send_notification(notification)
40
37
  end
@@ -43,7 +40,7 @@ module BMO
43
40
  #
44
41
  # @return [Array<FeedbackTuple>] Feedback Object containing
45
42
  # a time and a token
46
- def get_ios_feedback
43
+ def self.get_ios_feedback
47
44
  apns_client.get_feedback
48
45
  end
49
46
 
@@ -56,14 +53,14 @@ module BMO
56
53
  # @return [Faraday::Response] The HTTP Response
57
54
  #
58
55
  # @see http://developer.android.com/google/gcm/server.html]
59
- def send_android_notification(device_token, data)
56
+ def self.send_android_notification(device_token, data)
60
57
  notification = GCM::Notification.new(device_token, data)
61
- android_client.send_notification(notification)
58
+ gcm_client.send_notification(notification)
62
59
  end
63
60
 
64
61
  private
65
62
 
66
- def apns_client
63
+ def self.apns_client
67
64
  conf = BMO.configuration.apns
68
65
  APNS::Client.new(conf.gateway_host,
69
66
  conf.gateway_port,
@@ -73,7 +70,7 @@ module BMO
73
70
  cert_pass: conf.cert_pass)
74
71
  end
75
72
 
76
- def gcm_client
73
+ def self.gcm_client
77
74
  conf = BMO.configuration.gcm
78
75
  GCM::Client.new(conf.gateway_url,
79
76
  conf.api_key)
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.1
4
+ version: 0.8.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antoine Lyset