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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 20b022eccf968998d9236870dd9255b5ca5eff46
4
- data.tar.gz: a82a4adf1601c57035016df31d53d6a2fbc5e41e
3
+ metadata.gz: 66b12180b0871631d3aa748d769096169a861e1c
4
+ data.tar.gz: 35d1ef716439e10dd806131a99254cfd40f98765
5
5
  SHA512:
6
- metadata.gz: 53bfc4fb4f56485453989c62428fb370748e6cda40bd082ce98e21a544518bc5354b70cc6b3294b59f897664e08b146e21bd6ce385a64880e10a3184649ad0bc
7
- data.tar.gz: d1d3a4637dff550333f1eba6fb3ae7ca9d19bfa6aad31f8deb4344ab60a9e99ac519b139e356ee9e203f4aa9a2ec98a707774d4c6b1841780f74000574194c64
6
+ metadata.gz: ed049d5b08476af111e543f13771d91b96584b29732bfa8ea6376a1bfd4dd1a4e6c6b248a17c9d4761e37ca73fa053413d6c51d2d5174c8f59c27ace3b445720
7
+ data.tar.gz: b1ec8619fedbab171426d8fb4ec929cccd77bc6e1492a965da00b9905ac79b555cbc70522842a4a2c514300970043deab9e4e61db00d98fb21a8e8b652430a86
data/.gitignore CHANGED
@@ -2,3 +2,5 @@ pkg
2
2
  coverage
3
3
  Gemfile.lock
4
4
  tmp
5
+ vendor
6
+ .bundle
@@ -1,5 +1,11 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.3.0
4
+
5
+ * Use coverage kit to enforce maximum coverage
6
+ * [ROT-73] Always cache cacheable attributes
7
+ * [RU-133] Replace alias_method_chain with alias_method
8
+
3
9
  ## 0.2.0
4
10
 
5
11
  * Extract and test translations
@@ -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") if self.class.should_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
- if self.should_cache?
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
- alias_method_chain :#{method}, :concurrency_lock
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'
@@ -1,3 +1,3 @@
1
1
  module RailsCoreExtensions
2
- VERSION = '0.2.0'
2
+ VERSION = '0.3.0'
3
3
  end
@@ -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 'simplecov'
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
- MINIMUM_COVERAGE = 81.1
2
-
3
- unless ENV['COVERAGE'] == 'off'
4
- require 'simplecov'
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.2.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: 2016-08-30 00:00:00.000000000 Z
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: simplecov
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.4.8
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.