facebook-messenger 1.1.1 → 1.1.2

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: '08ae1854f4741cfd9dc774f747f5cca4c3909231'
4
- data.tar.gz: ed59b8698190ab80b02a19cab38898f4ac35b570
3
+ metadata.gz: 6973b5c241d0124c75e08a0441e26c8190d51f24
4
+ data.tar.gz: 58aae6e494b7a89f58e2d4e0f5e3c33df31b89cb
5
5
  SHA512:
6
- metadata.gz: 5ea5ab655716f28f7ab58dff5ae8e198ae2415f4b983629de6ad72a3c41271b7839ad1623d4c8bfed81f9b86ac4af69d84dc408d84655f671de104e96cf5e7ef
7
- data.tar.gz: edfd13bc6478194d42cbe1e6d05b16070ed347138d33af15dcbe2e728817ee84d1ab004c1575183c9aaea068414a7d902f5fd5409003ee97a7e662d2bf25a492
6
+ metadata.gz: 0ab183695ddbe1dcb6136bd4c2537b3f619e1cc0f96ddf63c3aac981e6ca947c19ca53437db1773c98419a0a5ea42179a31ae52dc6eb3f4f62edd78470722eb4
7
+ data.tar.gz: 49e973311172b2fbc2e81bce8c3a35f89470e5240da931ddd12b08fcff00e3f3d3d571b295565b6c12542d401c1ff3de87384cc8ef46a19f892f0d5fb93fa3bf
@@ -97,7 +97,7 @@ module Facebook
97
97
  def trigger(event, *args)
98
98
  hooks.fetch(event).call(*args)
99
99
  rescue KeyError
100
- $stderr.puts "Ignoring #{event} (no hook registered)"
100
+ warn "Ignoring #{event} (no hook registered)"
101
101
  end
102
102
 
103
103
  #
@@ -73,15 +73,15 @@ module Facebook
73
73
  end
74
74
 
75
75
  def internal_error?(error_code)
76
- INTERNAL_ERROR_CODES.keys.include? error_code
76
+ INTERNAL_ERROR_CODES.key? error_code
77
77
  end
78
78
 
79
79
  def access_token_error?(error_code)
80
- ACCESS_TOKEN_ERROR_CODES.keys.include? error_code
80
+ ACCESS_TOKEN_ERROR_CODES.key? error_code
81
81
  end
82
82
 
83
83
  def account_linking_error?(error_code)
84
- ACCOUNT_LINKING_ERROR_CODES.keys.include? error_code
84
+ ACCOUNT_LINKING_ERROR_CODES.key? error_code
85
85
  end
86
86
 
87
87
  def limit_error?(error_code, error_subcode)
@@ -78,7 +78,7 @@ module Facebook
78
78
  return unless app_secret_for(parsed_body['entry'][0]['id'])
79
79
 
80
80
  unless signature.start_with?('sha1='.freeze)
81
- $stderr.puts(X_HUB_SIGNATURE_MISSING_WARNING)
81
+ warn X_HUB_SIGNATURE_MISSING_WARNING
82
82
 
83
83
  raise BadRequestError, 'Error getting integrity signature'.freeze
84
84
  end
@@ -108,7 +108,7 @@ module Facebook
108
108
  # @return [String] A string describing its signature.
109
109
  #
110
110
  def signature_for(string)
111
- format('sha1=%s'.freeze, generate_hmac(string))
111
+ format('sha1=%<string>s'.freeze, string: generate_hmac(string))
112
112
  end
113
113
 
114
114
  # Generate a HMAC signature for the given content.
@@ -9,7 +9,7 @@ module Facebook
9
9
  module Subscriptions
10
10
  include HTTParty
11
11
 
12
- base_uri 'https://graph.facebook.com/v2.9/me'
12
+ base_uri 'https://graph.facebook.com/v3.2/me'
13
13
 
14
14
  format :json
15
15
 
@@ -27,9 +27,10 @@ module Facebook
27
27
  #
28
28
  # @return [Boolean] TRUE
29
29
  #
30
- def subscribe(access_token:)
30
+ def subscribe(access_token:, subscribed_fields: [])
31
31
  response = post '/subscribed_apps', query: {
32
- access_token: access_token
32
+ access_token: access_token,
33
+ subscribed_fields: subscribed_fields
33
34
  }
34
35
 
35
36
  raise_errors(response)
@@ -2,6 +2,6 @@ module Facebook
2
2
  module Messenger
3
3
  #
4
4
  # @return [String] Define the version of gem.
5
- VERSION = '1.1.1'.freeze
5
+ VERSION = '1.1.2'.freeze
6
6
  end
7
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: facebook-messenger
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.1
4
+ version: 1.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Johannes Gorset
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2018-07-10 00:00:00.000000000 Z
11
+ date: 2018-12-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: httparty
@@ -59,103 +59,103 @@ dependencies:
59
59
  - !ruby/object:Gem::Version
60
60
  version: '1.11'
61
61
  - !ruby/object:Gem::Dependency
62
- name: rspec
62
+ name: coveralls
63
63
  requirement: !ruby/object:Gem::Requirement
64
64
  requirements:
65
- - - "~>"
65
+ - - ">="
66
66
  - !ruby/object:Gem::Version
67
- version: '3.4'
67
+ version: '0'
68
68
  type: :development
69
69
  prerelease: false
70
70
  version_requirements: !ruby/object:Gem::Requirement
71
71
  requirements:
72
- - - "~>"
72
+ - - ">="
73
73
  - !ruby/object:Gem::Version
74
- version: '3.4'
74
+ version: '0'
75
75
  - !ruby/object:Gem::Dependency
76
- name: rack-test
76
+ name: pry
77
77
  requirement: !ruby/object:Gem::Requirement
78
78
  requirements:
79
- - - "~>"
79
+ - - ">="
80
80
  - !ruby/object:Gem::Version
81
- version: 0.6.3
81
+ version: '0'
82
82
  type: :development
83
83
  prerelease: false
84
84
  version_requirements: !ruby/object:Gem::Requirement
85
85
  requirements:
86
- - - "~>"
86
+ - - ">="
87
87
  - !ruby/object:Gem::Version
88
- version: 0.6.3
88
+ version: '0'
89
89
  - !ruby/object:Gem::Dependency
90
- name: rubocop
90
+ name: rack-test
91
91
  requirement: !ruby/object:Gem::Requirement
92
92
  requirements:
93
93
  - - "~>"
94
94
  - !ruby/object:Gem::Version
95
- version: 0.48.1
95
+ version: 0.6.3
96
96
  type: :development
97
97
  prerelease: false
98
98
  version_requirements: !ruby/object:Gem::Requirement
99
99
  requirements:
100
100
  - - "~>"
101
101
  - !ruby/object:Gem::Version
102
- version: 0.48.1
102
+ version: 0.6.3
103
103
  - !ruby/object:Gem::Dependency
104
- name: webmock
104
+ name: rake
105
105
  requirement: !ruby/object:Gem::Requirement
106
106
  requirements:
107
107
  - - "~>"
108
108
  - !ruby/object:Gem::Version
109
- version: '1.24'
109
+ version: '11.0'
110
110
  type: :development
111
111
  prerelease: false
112
112
  version_requirements: !ruby/object:Gem::Requirement
113
113
  requirements:
114
114
  - - "~>"
115
115
  - !ruby/object:Gem::Version
116
- version: '1.24'
116
+ version: '11.0'
117
117
  - !ruby/object:Gem::Dependency
118
- name: rake
118
+ name: rspec
119
119
  requirement: !ruby/object:Gem::Requirement
120
120
  requirements:
121
121
  - - "~>"
122
122
  - !ruby/object:Gem::Version
123
- version: '11.0'
123
+ version: '3.4'
124
124
  type: :development
125
125
  prerelease: false
126
126
  version_requirements: !ruby/object:Gem::Requirement
127
127
  requirements:
128
128
  - - "~>"
129
129
  - !ruby/object:Gem::Version
130
- version: '11.0'
130
+ version: '3.4'
131
131
  - !ruby/object:Gem::Dependency
132
- name: coveralls
132
+ name: rubocop
133
133
  requirement: !ruby/object:Gem::Requirement
134
134
  requirements:
135
- - - ">="
135
+ - - "~>"
136
136
  - !ruby/object:Gem::Version
137
- version: '0'
137
+ version: 0.58.1
138
138
  type: :development
139
139
  prerelease: false
140
140
  version_requirements: !ruby/object:Gem::Requirement
141
141
  requirements:
142
- - - ">="
142
+ - - "~>"
143
143
  - !ruby/object:Gem::Version
144
- version: '0'
144
+ version: 0.58.1
145
145
  - !ruby/object:Gem::Dependency
146
- name: pry
146
+ name: webmock
147
147
  requirement: !ruby/object:Gem::Requirement
148
148
  requirements:
149
- - - ">="
149
+ - - "~>"
150
150
  - !ruby/object:Gem::Version
151
- version: '0'
151
+ version: '1.24'
152
152
  type: :development
153
153
  prerelease: false
154
154
  version_requirements: !ruby/object:Gem::Requirement
155
155
  requirements:
156
- - - ">="
156
+ - - "~>"
157
157
  - !ruby/object:Gem::Version
158
- version: '0'
158
+ version: '1.24'
159
159
  description: Facebook Messenger client
160
160
  email:
161
161
  - jgorset@gmail.com