rails_core_extensions 0.2.0 → 0.3.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/.gitignore +2 -0
- data/CHANGELOG.md +6 -0
- data/lib/rails_core_extensions/active_record_cache_all_attributes.rb +2 -10
- data/lib/rails_core_extensions/concurrency.rb +2 -2
- data/lib/rails_core_extensions/version.rb +1 -1
- data/rails_core_extensions.gemspec +1 -1
- data/spec/support/coverage_loader.rb +4 -27
- metadata +4 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 66b12180b0871631d3aa748d769096169a861e1c
|
4
|
+
data.tar.gz: 35d1ef716439e10dd806131a99254cfd40f98765
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ed049d5b08476af111e543f13771d91b96584b29732bfa8ea6376a1bfd4dd1a4e6c6b248a17c9d4761e37ca73fa053413d6c51d2d5174c8f59c27ace3b445720
|
7
|
+
data.tar.gz: b1ec8619fedbab171426d8fb4ec929cccd77bc6e1492a965da00b9905ac79b555cbc70522842a4a2c514300970043deab9e4e61db00d98fb21a8e8b652430a86
|
data/.gitignore
CHANGED
data/CHANGELOG.md
CHANGED
@@ -5,7 +5,7 @@ module ActiveRecordCacheAllAttributes
|
|
5
5
|
|
6
6
|
module InstanceMethods
|
7
7
|
def clear_attribute_cache
|
8
|
-
self.class.cache.delete("#{self.class.name}.attribute_cache")
|
8
|
+
self.class.cache.delete("#{self.class.name}.attribute_cache")
|
9
9
|
end
|
10
10
|
end
|
11
11
|
|
@@ -16,11 +16,7 @@ module ActiveRecordCacheAllAttributes
|
|
16
16
|
|
17
17
|
def attribute_cache
|
18
18
|
cache_key = "#{self.name}.attribute_cache"
|
19
|
-
|
20
|
-
cache.read(cache_key) || self.generate_cache(cache_key)
|
21
|
-
else
|
22
|
-
self.generate_attributes_hash
|
23
|
-
end
|
19
|
+
cache.read(cache_key) || self.generate_cache(cache_key)
|
24
20
|
end
|
25
21
|
|
26
22
|
def generate_attributes_hash
|
@@ -35,9 +31,5 @@ module ActiveRecordCacheAllAttributes
|
|
35
31
|
end
|
36
32
|
cache_value
|
37
33
|
end
|
38
|
-
|
39
|
-
def should_cache?
|
40
|
-
Rails.configuration.action_controller.perform_caching
|
41
|
-
end
|
42
34
|
end
|
43
35
|
end
|
@@ -46,8 +46,8 @@ module Concurrency
|
|
46
46
|
end
|
47
47
|
return_value
|
48
48
|
end
|
49
|
-
|
50
|
-
|
49
|
+
alias_method :#{method}_without_concurrency_lock, :#{method}
|
50
|
+
alias_method :#{method}, :#{method}_with_concurrency_lock
|
51
51
|
DEFINITION
|
52
52
|
|
53
53
|
if method_type(method, options[:type]) == 'class'
|
@@ -26,7 +26,7 @@ Gem::Specification.new do |spec|
|
|
26
26
|
spec.add_development_dependency 'rake'
|
27
27
|
spec.add_development_dependency 'rspec'
|
28
28
|
spec.add_development_dependency 'activerecord-nulldb-adapter'
|
29
|
-
spec.add_development_dependency '
|
29
|
+
spec.add_development_dependency 'coverage-kit'
|
30
30
|
spec.add_development_dependency 'simplecov-rcov'
|
31
31
|
spec.add_development_dependency 'coveralls'
|
32
32
|
spec.add_development_dependency 'sqlite3'
|
@@ -1,27 +1,4 @@
|
|
1
|
-
|
2
|
-
|
3
|
-
|
4
|
-
|
5
|
-
require 'simplecov-rcov'
|
6
|
-
require 'coveralls'
|
7
|
-
Coveralls.wear!
|
8
|
-
|
9
|
-
SimpleCov.formatters = [
|
10
|
-
SimpleCov::Formatter::RcovFormatter,
|
11
|
-
Coveralls::SimpleCov::Formatter
|
12
|
-
]
|
13
|
-
SimpleCov.start do
|
14
|
-
add_filter '/vendor/'
|
15
|
-
add_filter '/spec/'
|
16
|
-
add_group 'lib', 'lib'
|
17
|
-
end
|
18
|
-
SimpleCov.at_exit do
|
19
|
-
SimpleCov.result.format!
|
20
|
-
percent = SimpleCov.result.covered_percent
|
21
|
-
puts "Coverage is #{"%.2f" % percent}%"
|
22
|
-
unless percent >= MINIMUM_COVERAGE
|
23
|
-
puts "Coverage must be above #{MINIMUM_COVERAGE}%"
|
24
|
-
Kernel.exit(1)
|
25
|
-
end
|
26
|
-
end
|
27
|
-
end
|
1
|
+
require 'simplecov-rcov'
|
2
|
+
require 'coveralls'
|
3
|
+
require 'coverage/kit'
|
4
|
+
Coverage::Kit.setup(minimum_coverage: 81)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rails_core_extensions
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.3.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Michael Noack
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date:
|
12
|
+
date: 2017-09-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: activerecord
|
@@ -96,7 +96,7 @@ dependencies:
|
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
- !ruby/object:Gem::Dependency
|
99
|
-
name:
|
99
|
+
name: coverage-kit
|
100
100
|
requirement: !ruby/object:Gem::Requirement
|
101
101
|
requirements:
|
102
102
|
- - ">="
|
@@ -272,7 +272,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
272
272
|
version: '0'
|
273
273
|
requirements: []
|
274
274
|
rubyforge_project:
|
275
|
-
rubygems_version: 2.
|
275
|
+
rubygems_version: 2.6.8
|
276
276
|
signing_key:
|
277
277
|
specification_version: 4
|
278
278
|
summary: Set of extensions to core rails libraries.
|