artirix_data_models 1.0.0.beta9 → 1.0.0.beta10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.travis.yml +5 -1
- data/README.md +4 -0
- data/artirix_data_models.gemspec +2 -2
- data/lib/artirix_data_models/cached_action_adaptor.rb +10 -8
- data/lib/artirix_data_models/version.rb +1 -1
- metadata +6 -6
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4cd6a068a83b61ecedda5145e35fbd18a92fa2457e9a950a4d381d5a705761c5
|
4
|
+
data.tar.gz: a5011b338480743016e8c2e96fb76610a2d0671298f51fecaee86a45b279d5c8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 388141e372f2237ca7d7e645ef82c15b351259255308bf03a2343029c99c9dc468fef59a63b65f0f1149556e0642ba571662f3c429c9b63dad47becfeaae1bf3
|
7
|
+
data.tar.gz: c61faab4ea50ff52a5802c521d8084b25748ece7bc32aa24fb328604f80bdc63c81b08da641511e9a2ee1556e94533b69c62cb3c4ab7dbad2242bfa4187018be
|
data/.travis.yml
CHANGED
@@ -2,8 +2,12 @@ language: ruby
|
|
2
2
|
rvm:
|
3
3
|
- 2.3.3
|
4
4
|
- 2.4.0
|
5
|
+
- 2.5.3
|
6
|
+
- 2.6
|
5
7
|
|
6
|
-
before_install:
|
8
|
+
before_install:
|
9
|
+
- gem uninstall -v '>= 2' -i $(rvm gemdir)@global -ax bundler || true
|
10
|
+
- gem install bundler -v '< 2'
|
7
11
|
|
8
12
|
addons:
|
9
13
|
code_climate:
|
data/README.md
CHANGED
data/artirix_data_models.gemspec
CHANGED
@@ -31,8 +31,8 @@ Gem::Specification.new do |spec|
|
|
31
31
|
spec.add_development_dependency 'kaminari', '~> 0.16'
|
32
32
|
spec.add_development_dependency 'will_paginate', '~> 3.0'
|
33
33
|
|
34
|
-
spec.add_development_dependency 'bundler', '
|
35
|
-
spec.add_development_dependency 'rake', '
|
34
|
+
spec.add_development_dependency 'bundler', '>= 1.10'
|
35
|
+
spec.add_development_dependency 'rake', '>= 10.0'
|
36
36
|
spec.add_development_dependency 'rspec'
|
37
37
|
spec.add_development_dependency 'rspec-given'
|
38
38
|
spec.add_development_dependency 'faker'
|
@@ -1,13 +1,13 @@
|
|
1
1
|
class ArtirixDataModels::CachedActionAdaptor
|
2
|
-
STATUS_OK
|
2
|
+
STATUS_OK = 'ok'.freeze
|
3
3
|
STATUS_NOT_FOUND = 'not_found'.freeze
|
4
|
-
STATUSES
|
4
|
+
STATUSES = [STATUS_OK, STATUS_NOT_FOUND]
|
5
5
|
|
6
6
|
attr_reader :logger, :cache
|
7
7
|
|
8
|
-
def initialize(logger: nil, cache: nil, **
|
9
|
-
@logger
|
10
|
-
@cache
|
8
|
+
def initialize(logger: nil, cache: nil, **_ignored_options)
|
9
|
+
@logger = logger || ArtirixDataModels.logger
|
10
|
+
@cache = cache || ArtirixDataModels.cache
|
11
11
|
@enabled = true
|
12
12
|
end
|
13
13
|
|
@@ -21,14 +21,16 @@ class ArtirixDataModels::CachedActionAdaptor
|
|
21
21
|
if cached?
|
22
22
|
get_cached_result
|
23
23
|
elsif block_given?
|
24
|
-
perform
|
25
|
-
else
|
26
|
-
nil
|
24
|
+
perform(&block)
|
27
25
|
end
|
28
26
|
end
|
29
27
|
|
30
28
|
alias_method :call, :fetch
|
31
29
|
|
30
|
+
def force_fresh_fetch(&block)
|
31
|
+
perform(&block) if block_given?
|
32
|
+
end
|
33
|
+
|
32
34
|
def enable
|
33
35
|
@enabled = true
|
34
36
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artirix_data_models
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.0.
|
4
|
+
version: 1.0.0.beta10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Eduardo Turiño
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-05-29 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activesupport
|
@@ -154,28 +154,28 @@ dependencies:
|
|
154
154
|
name: bundler
|
155
155
|
requirement: !ruby/object:Gem::Requirement
|
156
156
|
requirements:
|
157
|
-
- - "
|
157
|
+
- - ">="
|
158
158
|
- !ruby/object:Gem::Version
|
159
159
|
version: '1.10'
|
160
160
|
type: :development
|
161
161
|
prerelease: false
|
162
162
|
version_requirements: !ruby/object:Gem::Requirement
|
163
163
|
requirements:
|
164
|
-
- - "
|
164
|
+
- - ">="
|
165
165
|
- !ruby/object:Gem::Version
|
166
166
|
version: '1.10'
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: rake
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
170
170
|
requirements:
|
171
|
-
- - "
|
171
|
+
- - ">="
|
172
172
|
- !ruby/object:Gem::Version
|
173
173
|
version: '10.0'
|
174
174
|
type: :development
|
175
175
|
prerelease: false
|
176
176
|
version_requirements: !ruby/object:Gem::Requirement
|
177
177
|
requirements:
|
178
|
-
- - "
|
178
|
+
- - ">="
|
179
179
|
- !ruby/object:Gem::Version
|
180
180
|
version: '10.0'
|
181
181
|
- !ruby/object:Gem::Dependency
|