checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
---
2
2
SHA256:
3
- metadata.gz: 21f228e7863e5274343cddda10e487d18fe613c5dc6bc520e2db03f0475cf7fa
4
- data.tar.gz: b981d9c578d42bca6253c38bbb31690c3f0b417d1f43cbd23ed3a5ffac2e2bbd
3
+ metadata.gz: 071f0d4d2b5797121ee7f9cd444302a2fbb0e66de5c252815753b35a019c06ac
4
+ data.tar.gz: 7590349f4df19e38946d2a69308cadd067873f495e777c7205ed2fbbc58af342
5
5
SHA512:
6
- metadata.gz: cf9b9f217b374801aa1cff551b27dbe0454c82acd8608437918f9b3b301541bcddc40b8bc4d5d4353ba1d833a82ea3eca561c0a3111919836aafcc49e0144aef
7
- data.tar.gz: 3559c5cc114505be9fac3391222f29bdde5fbe2c4f75fe385b80fc6c8713332dff084a60e73a0a45596c9d8b67e4fbf8ab532a6d341ac5a6a22f029dba9a717d
6
+ metadata.gz: ea78a849edb4043510de9d4e60897991cf9c7dbfdf29a9447e2baca60e92c6e52e870208dc6cf8256543debf1fb55f07fe11fd68f2406c93f925274836df63b7
7
+ data.tar.gz: ce6d6fe0bdd409d1003b9a6cc676ac09a9795a69579d30f7de83adbc6287869db7fe489ee764e3004ef31d42686a06fd10b0c2ef22363d1f64c0f4052913459c
data/CHANGELOG.md CHANGED
@@ -2,6 +2,9 @@
2
2
3
3
## Next version
4
4
5
+ ## 1.6.1
6
+ - Add `SetupJobConcern`
7
+
5
8
## 1.6.0
6
9
- Remove `GetHTTP`
7
10
- I18n fixes
data/app/jobs/concerns/agilibox/setup_job_concern.rb ADDED
@@ -0,0 +1,35 @@
1
+ module Agilibox::SetupJobConcern
2
+ extend ActiveSupport::Concern
3
+
4
+ def perform(*args)
5
+ setup(*args)
6
+ call
7
+ end
8
+
9
+ def call
10
+ raise NotImplementedError
11
+ end
12
+
13
+ class_methods do
14
+ def setup_with(*attrs)
15
+ attr_reader(*attrs)
16
+
17
+ define_method(:setup) do |*args|
18
+ if attrs.length != args.length
19
+ message = "wrong number of arguments (given #{args.length}, expected #{attrs.length})"
20
+ raise ArgumentError, message
21
+ end
22
+
23
+ attrs.length.times do |i|
24
+ instance_variable_set("@#{attrs[i]}", args[i])
25
+ end
26
+ end
27
+ end
28
+
29
+ private :setup_with
30
+
31
+ def setup(*args)
32
+ new.tap { |instance| instance.setup(*args) }
33
+ end
34
+ end # class_methods
35
+ end
data/lib/agilibox/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
module Agilibox
2
- VERSION = "1.6.0"
2
+ VERSION = "1.6.1"
3
3
end
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.6.0
4
+ version: 1.6.1
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-08-20 00:00:00.000000000 Z
11
+ date: 2019-09-11 00:00:00.000000000 Z
12
12
dependencies:
13
13
- !ruby/object:Gem::Dependency
14
14
name: rails-i18n
@@ -112,6 +112,7 @@ files:
112
112
- app/helpers/agilibox/sorting_helper.rb
113
113
- app/helpers/agilibox/text_helper.rb
114
114
- app/helpers/h.rb
115
+ - app/jobs/concerns/agilibox/setup_job_concern.rb
115
116
- app/libs/agilibox/collection_update.rb
116
117
- app/libs/agilibox/fcm/notifier.rb
117
118
- app/libs/agilibox/fcm/request.rb