agilibox 1.3.4 → 1.3.5

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: 1a9379230e4aad6c54c0d2d50e8817e44b06b0b96e2c21a69bbc954f304e577d
4
- data.tar.gz: 0a585a25d2957a902b3ba8148860ccb13bbd5d90d37f318fbea93efafce9a023
3
+ metadata.gz: 66337e184cad2e838e45b87d65dc32fba8939e49d57651c0116aa52940ae14ff
4
+ data.tar.gz: 01b1e3d2c551d68b8a5e7f69bb4e48200bd8db63d07cd43eb482e3cf7d3958d4
5
5
  SHA512:
6
- metadata.gz: 156b0dc96de93996f93687a907e0f591a3401c3a4732f43ce85a3f1dd6494e814a2e2a9abb4dc0cc7f35b5024ee5d9287f23571702f23331d61257851508f0b6
7
- data.tar.gz: 3b7c85f43f220f855c357167d2987418d79e22b71e2fb8a98b5e0dab9937fa5b637dfa67f2d3e874471e723fef2c62acf75524f3454095cf46d4adcb16cb7f23
6
+ metadata.gz: 2b9211f2cf491df7db05981879b35c466a4b13217c18c76d612585d2d83a951d0d88967f499fec90bdf63d940fa269ca40e9b6f70589c523fa098de284b67146
7
+ data.tar.gz: a56c82f2d46b32db501e31a1e684f76db80c7742b5a498d7e579916ab72092ec9f9bc601b22fcd7aec4c85af9c954bc1ca6dcb64965378e66f9c446fa8b69bb1
data/CHANGELOG.md CHANGED
@@ -2,6 +2,10 @@
2
2
 
3
3
  ## Next version
4
4
 
5
+ ## 1.3.5
6
+
7
+ - Add `Agilibox::Monkey`
8
+
5
9
  ## 1.3.4
6
10
 
7
11
  - Support FontAwesome v4
@@ -27,7 +27,7 @@ module Agilibox::TextHelper
27
27
 
28
28
  opts = {}
29
29
 
30
- if n.class.to_s =~ /Float|Decimal/i
30
+ if n.class.to_s.match?(/Float|Decimal/i)
31
31
  opts[:precision] = 2
32
32
  else
33
33
  opts[:precision] = 0
@@ -2,7 +2,7 @@ class Agilibox::CollectionUpdate < Agilibox::Service
2
2
  initialize_with :scope, :params_array
3
3
 
4
4
  def call
5
- update
5
+ update # rubocop:disable Rails/SaveBang
6
6
  end
7
7
 
8
8
  def update!
@@ -28,7 +28,7 @@ class Agilibox::FCM::Request < Agilibox::Service
28
28
  end
29
29
 
30
30
  def ok?
31
- response_json[:success] > 0 && response_json[:failure].zero?
31
+ response_json[:success].positive? && response_json[:failure].zero?
32
32
  end
33
33
 
34
34
  def error?
@@ -0,0 +1,39 @@
1
+ module Agilibox::Monkey
2
+ extend ActiveSupport::Concern
3
+
4
+ class_methods do
5
+ def prepend_instances(&block)
6
+ m = Module.new(&block)
7
+ send(:prepend, m)
8
+ end
9
+
10
+ def prepend_class(&block)
11
+ m = Module.new(&block)
12
+ singleton_class.send(:prepend, m)
13
+ end
14
+
15
+ def prepend_instance_method(name, &block)
16
+ check_instance_method_exist!(name)
17
+
18
+ m = Module.new
19
+ m.send(:define_method, name, &block)
20
+ send(:prepend, m)
21
+ end
22
+
23
+ def prepend_class_method(name, &block)
24
+ check_class_method_exist!(name)
25
+
26
+ m = Module.new
27
+ m.send(:define_method, name, &block)
28
+ singleton_class.send(:prepend, m)
29
+ end
30
+
31
+ def check_instance_method_exist!(name)
32
+ raise "instance method `#{name}` does not exist" unless instance_methods.include?(name)
33
+ end
34
+
35
+ def check_class_method_exist!(name)
36
+ raise "class method `#{name}` does not exist" unless methods.include?(name)
37
+ end
38
+ end
39
+ end
@@ -1,3 +1,3 @@
1
1
  module Agilibox
2
- VERSION = "1.3.4"
2
+ VERSION = "1.3.5"
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.3.4
4
+ version: 1.3.5
5
5
  platform: ruby
6
6
  authors:
7
7
  - agilidée
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-07-06 00:00:00.000000000 Z
11
+ date: 2018-10-17 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rails-i18n
@@ -114,6 +114,7 @@ files:
114
114
  - app/libs/agilibox/initialize_with.rb
115
115
  - app/libs/agilibox/mini_model_serializer/serialize.rb
116
116
  - app/libs/agilibox/mini_model_serializer/serializer.rb
117
+ - app/libs/agilibox/monkey.rb
117
118
  - app/libs/agilibox/phone_number_sanitizer.rb
118
119
  - app/libs/agilibox/sortable_uuid_generator.rb
119
120
  - app/libs/agilibox/token_generator.rb