agilibox 1.7.4 → 1.8.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +5 -0
- data/app/sms/agilibox/sms.rb +11 -1
- data/app/sms/agilibox/sms/application_sms.rb +1 -1
- data/app/sms/agilibox/sms/message.rb +25 -0
- data/app/sms/agilibox/sms/strategies/amazon_sns.rb +0 -2
- data/app/sms/agilibox/sms/strategies/base.rb +4 -11
- data/app/sms/agilibox/sms/strategies/test.rb +0 -2
- data/lib/agilibox/engine.rb +2 -0
- data/lib/agilibox/version.rb +1 -1
- metadata +31 -3
- data/app/models/concerns/agilibox/tap_methods.rb +0 -33
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 32ae9547194bc24867f080fd2d519d8c5121f0bd29c5f04a77ef3a0cc73ab193
|
4
|
+
data.tar.gz: b3842b9bcaf9a53cabe3ff70e35397f24486848b5b4b63ba718eeac3197149fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 57219afef63509df9ecef5d62e889f163808acb127634d869b644de4a6510a419880ccbd2bc655e8a892a69cebf29048a0afd2b24efecb72d7cb6f54f2ddf30a
|
7
|
+
data.tar.gz: 74850c8fd415e42e1cd1580ab02f55b5b8b5e2ed557f7b70bb7b036c3b801dfa1c38befe388e78dd8428cf15707ad58591b52ec4b8e698257e1cd83c1d51b671
|
data/CHANGELOG.md
CHANGED
data/app/sms/agilibox/sms.rb
CHANGED
@@ -1,6 +1,8 @@
|
|
1
1
|
module Agilibox::SMS
|
2
2
|
class << self
|
3
|
-
|
3
|
+
def strategy=(value)
|
4
|
+
@strategy = parse_strategy(value)
|
5
|
+
end
|
4
6
|
|
5
7
|
def strategy
|
6
8
|
@strategy ||= default_strategy
|
@@ -12,6 +14,14 @@ module Agilibox::SMS
|
|
12
14
|
@default_from ||= Rails.application.class.to_s.chomp("::Application")
|
13
15
|
end
|
14
16
|
|
17
|
+
def parse_strategy(value)
|
18
|
+
if value.is_a?(Symbol)
|
19
|
+
"Agilibox::SMS::Strategies::#{value.to_s.camelcase}".constantize
|
20
|
+
else
|
21
|
+
value
|
22
|
+
end
|
23
|
+
end
|
24
|
+
|
15
25
|
private
|
16
26
|
|
17
27
|
def default_strategy
|
@@ -0,0 +1,25 @@
|
|
1
|
+
class Agilibox::SMS::Message
|
2
|
+
attr_reader :data
|
3
|
+
|
4
|
+
def initialize(data)
|
5
|
+
@data = data
|
6
|
+
end
|
7
|
+
|
8
|
+
def strategy=(value)
|
9
|
+
@strategy = Agilibox::SMS.parse_strategy(value)
|
10
|
+
end
|
11
|
+
|
12
|
+
def strategy(value = :no_argument)
|
13
|
+
self.strategy = value unless value == :no_argument
|
14
|
+
@strategy || Agilibox::SMS.strategy
|
15
|
+
end
|
16
|
+
|
17
|
+
def deliver_now
|
18
|
+
strategy.call(data)
|
19
|
+
end
|
20
|
+
|
21
|
+
# TODO : Delay
|
22
|
+
def deliver_later
|
23
|
+
deliver_now
|
24
|
+
end
|
25
|
+
end
|
@@ -5,18 +5,11 @@ class Agilibox::SMS::Strategies::Base
|
|
5
5
|
@data = data
|
6
6
|
end
|
7
7
|
|
8
|
-
def deliver_now
|
9
|
-
call
|
10
|
-
end
|
11
|
-
|
12
|
-
# TODO : Delay
|
13
|
-
def deliver_later
|
14
|
-
deliver_now
|
15
|
-
end
|
16
|
-
|
17
|
-
private
|
18
|
-
|
19
8
|
def call
|
20
9
|
raise NotImplementedError
|
21
10
|
end
|
11
|
+
|
12
|
+
def self.call(*args)
|
13
|
+
new(*args).call
|
14
|
+
end
|
22
15
|
end
|
data/lib/agilibox/engine.rb
CHANGED
data/lib/agilibox/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: agilibox
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.
|
4
|
+
version: 1.8.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- agilidée
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rails-i18n
|
@@ -52,6 +52,34 @@ dependencies:
|
|
52
52
|
- - ">="
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: nilify_blanks
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - ">="
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - ">="
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: tapenade
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - ">="
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - ">="
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0'
|
55
83
|
description: Agilibox
|
56
84
|
email:
|
57
85
|
- contact@agilidee.com
|
@@ -133,7 +161,6 @@ files:
|
|
133
161
|
- app/models/concerns/agilibox/pluck_to_hash.rb
|
134
162
|
- app/models/concerns/agilibox/polymorphic_id.rb
|
135
163
|
- app/models/concerns/agilibox/search.rb
|
136
|
-
- app/models/concerns/agilibox/tap_methods.rb
|
137
164
|
- app/models/concerns/agilibox/timestamp_helpers.rb
|
138
165
|
- app/serializers/agilibox/serializers.rb
|
139
166
|
- app/serializers/agilibox/serializers/axlsx.rb
|
@@ -142,6 +169,7 @@ files:
|
|
142
169
|
- app/services/agilibox/service.rb
|
143
170
|
- app/sms/agilibox/sms.rb
|
144
171
|
- app/sms/agilibox/sms/application_sms.rb
|
172
|
+
- app/sms/agilibox/sms/message.rb
|
145
173
|
- app/sms/agilibox/sms/strategies/amazon_sns.rb
|
146
174
|
- app/sms/agilibox/sms/strategies/base.rb
|
147
175
|
- app/sms/agilibox/sms/strategies/test.rb
|
@@ -1,33 +0,0 @@
|
|
1
|
-
module Agilibox::TapMethods
|
2
|
-
extend ActiveSupport::Concern
|
3
|
-
|
4
|
-
def tap_save!(options = {})
|
5
|
-
save!(options)
|
6
|
-
self
|
7
|
-
end
|
8
|
-
|
9
|
-
def tap_update!(attributes)
|
10
|
-
update!(attributes)
|
11
|
-
self
|
12
|
-
end
|
13
|
-
|
14
|
-
def tap_validate(context = nil)
|
15
|
-
validate(context)
|
16
|
-
self
|
17
|
-
end
|
18
|
-
|
19
|
-
def tap_validate!(context = nil)
|
20
|
-
validate!(context)
|
21
|
-
self
|
22
|
-
end
|
23
|
-
|
24
|
-
def tap_update_columns(attributes)
|
25
|
-
update_columns(attributes) # rubocop:disable Rails/SkipsModelValidations
|
26
|
-
self
|
27
|
-
end
|
28
|
-
|
29
|
-
def tap_update_column(name, value)
|
30
|
-
update_column(name, value) # rubocop:disable Rails/SkipsModelValidations
|
31
|
-
self
|
32
|
-
end
|
33
|
-
end
|