bmc 1.1.0 → 1.2.0

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
  SHA256:
3
- metadata.gz: 610c3313a3499ea6c4b1ab3b3d801ee892cfcce32e5adacf8b935a2032506f71
4
- data.tar.gz: 0db6265466d7b9f388b2a73b299b51b138fde69c89b08a67f8bc9fb67cef405d
3
+ metadata.gz: b9a6a356266f81ad7eb8ea4a4854057b183396375fa8eb0440dc5994e0ba619a
4
+ data.tar.gz: 7abd6a5c91201a3c34fd0e56014a19767a6113f55d8865da4d2c6ed79747a9b2
5
5
  SHA512:
6
- metadata.gz: acc8116f3b1beff954b12fe0558aa3023172f5e8720316b8dd3f851b60258f774a2d002fd72c84a5fbe1f65c3c6761c967bef7e38f32e5a79c61625fe6e9fd36
7
- data.tar.gz: 915fe7c88c4c6d7b201a9a8b70482207cf6f2b55a80222602825ebf33ceae0ebf0a0f0bf38dfe8d4781de2d20e40ff09b6b0ea32c5bec05c03afd9a480d9c4ce
6
+ metadata.gz: d3b50c4e23f67f61f8b9fcbf09af737459b0c5e2aacd97fccc76935b1cac3acecbe388cd630dbe24df11ef15ead5eef6a2f574af98e118e08b561247a7eff392
7
+ data.tar.gz: 2739cc1504180bf2ecb05609d90c788e80142cb3986fa6939853ec9c108d12563fb21443b7f715f271d742699a5d14ab827ec4ff80bc47086394064c9884a1d2
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## v1.2.0
6
+ - Remove FCM
7
+
5
8
  ## v1.1.0
6
9
  - SMS strategies rewrite
7
10
 
data/lib/bmc/engine.rb CHANGED
@@ -12,7 +12,6 @@ module BMC
12
12
  initializer "inflections" do
13
13
  ActiveSupport::Inflector.inflections(:en) do |inflect|
14
14
  inflect.acronym "BMC"
15
- inflect.acronym "FCM"
16
15
  inflect.acronym "SMS"
17
16
  inflect.acronym "UUID"
18
17
  inflect.acronym "XLSX"
data/lib/bmc/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module BMC
2
- VERSION = "1.1.0"
2
+ VERSION = "1.2.0"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: bmc
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.0
4
+ version: 1.2.0
5
5
  platform: ruby
6
6
  authors:
7
- - agilidée
8
- autorequire:
7
+ - Benoit MARTIN-CHAVE
8
+ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-11-09 00:00:00.000000000 Z
11
+ date: 2022-01-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-i18n
@@ -150,8 +150,6 @@ files:
150
150
  - app/jobs/bmc/application_job.rb
151
151
  - app/jobs/concerns/bmc/setup_job_concern.rb
152
152
  - app/libs/bmc/collection_update.rb
153
- - app/libs/bmc/fcm/notifier.rb
154
- - app/libs/bmc/fcm/request.rb
155
153
  - app/libs/bmc/mini_model_serializer/serialize.rb
156
154
  - app/libs/bmc/mini_model_serializer/serializer.rb
157
155
  - app/libs/bmc/monkey.rb
@@ -215,7 +213,7 @@ homepage: https://gitlab.benoitmc.com/pub/bmc
215
213
  licenses:
216
214
  - MIT
217
215
  metadata: {}
218
- post_install_message:
216
+ post_install_message:
219
217
  rdoc_options: []
220
218
  require_paths:
221
219
  - lib
@@ -231,7 +229,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
231
229
  version: '0'
232
230
  requirements: []
233
231
  rubygems_version: 3.1.6
234
- signing_key:
232
+ signing_key:
235
233
  specification_version: 4
236
234
  summary: BMC
237
235
  test_files: []
@@ -1,32 +0,0 @@
1
- class BMC::FCM::Notifier
2
- attr_reader :to, :title, :body, :badge, :sound, :data
3
-
4
- # rubocop:disable Metrics/ParameterLists
5
- def initialize(to:, title: nil, body:, badge: 0, sound: "default", data: {})
6
- super()
7
- @to = to
8
- @title = title
9
- @body = body
10
- @badge = badge
11
- @sound = sound
12
- @data = data
13
- end
14
- # rubocop:enable Metrics/ParameterLists
15
-
16
- def call
17
- BMC::FCM::Request.call(
18
- :to => to,
19
- :notification => {
20
- :title => title,
21
- :body => body,
22
- :badge => badge,
23
- :sound => sound,
24
- },
25
- :data => data,
26
- )
27
- end
28
-
29
- def self.call(...)
30
- new(...).call
31
- end
32
- end
@@ -1,54 +0,0 @@
1
- class BMC::FCM::Request
2
- extend AttrExtras.mixin
3
-
4
- URL = "https://fcm.googleapis.com/fcm/send"
5
-
6
- class << self
7
- attr_writer :api_key
8
-
9
- def api_key
10
- @api_key ||= ENV["FCM_API_KEY"]
11
- end
12
- end
13
-
14
- attr_reader_initialize :request_body
15
-
16
- attr_reader :response_json
17
-
18
- def self.call(...)
19
- new(...).call
20
- end
21
-
22
- def call
23
- response_body = HTTParty.post(URL,
24
- :body => request_body.to_json,
25
- :headers => {
26
- "Content-Type" => "application/json",
27
- "Authorization" => "key=#{self.class.api_key}",
28
- },
29
- ).body
30
-
31
- @response_json = JSON.parse(response_body).deep_symbolize_keys
32
-
33
- self
34
- rescue JSON::ParserError
35
- @response_json = {success: 0, failure: 1, results: [{:error => "InvalidJsonResponse"}]}
36
- self
37
- end
38
-
39
- def ok?
40
- response_json[:success].positive? && response_json[:failure].zero?
41
- end
42
-
43
- def error?
44
- !ok?
45
- end
46
-
47
- def errors
48
- response_json[:results].pluck(:error).compact
49
- end
50
-
51
- def invalid_token?
52
- errors.include?("NotRegistered") || errors.include?("InvalidRegistration")
53
- end
54
- end