cacheable 1.0.4 → 2.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: ba379f0770988ff42a99397f056206bbbb9b60a59b51a5fee51d687263adb96e
4
- data.tar.gz: ef68f492cf221457515452df0324ff87d634914ac67e286a4e698c096e5a2a3e
3
+ metadata.gz: bc26289c032b688f215069cb986bc985a279f17e0714bfbb090f572ae3f8e260
4
+ data.tar.gz: 4d53f73bd106b0ce936beb00afc814b67031d33c50839c996e349e065879904e
5
5
  SHA512:
6
- metadata.gz: 79e94e9ec720e03d2be5370ac8554c2c1635589b5cfffec5a56f27fe228944e659da1e5aa52b94836559fc06301a6f1e41d0df418c7305db925a175754ce73d8
7
- data.tar.gz: e56db78b1855a5cb4bcba7b1f408d4c4cff9cbef03f05641596e721c0b332bfc7878769632ef2eda6e6d2476505bdaf38b477fa32abc6513170b88806d21209b
6
+ metadata.gz: edaf2e450ffa47cb098555d981ef08cd34decd635e08b982c4a8239f899fcf378a027ec4af4579ba6aba0b191df6c67bfc1294c5a1abb1c17f782f4896e5d7f6
7
+ data.tar.gz: e9f4745f0301b7d49c7d6170295923c4225dac1e58ec3466bf50d4e4a1ac493e96aa775126cd337df3b9418be7bff2a071876f6410fab8f72fdc2865a4ed9d68
@@ -20,7 +20,7 @@ module Cacheable
20
20
  def fetch(key, _options = {})
21
21
  return read(key) if exist?(key)
22
22
 
23
- write(key, Proc.new.call)
23
+ write(key, yield)
24
24
  end
25
25
 
26
26
  def delete(key)
@@ -14,7 +14,7 @@ module Cacheable
14
14
  private
15
15
 
16
16
  def class_name_for(string)
17
- string.split('_').map { |name_part| "#{name_part[0].upcase}#{name_part[1..-1].downcase}" }.join
17
+ string.split('_').map { |name_part| "#{name_part[0].upcase}#{name_part[1..].downcase}" }.join
18
18
  end
19
19
  end
20
20
  end
@@ -1,7 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
- require 'English'
4
-
5
3
  module Cacheable
6
4
  module MethodGenerator
7
5
  def cacheable(*original_method_names, **opts)
@@ -66,7 +64,7 @@ module Cacheable
66
64
 
67
65
  def create_method_names(original_method_name)
68
66
  method_name_without_punctuation = original_method_name.to_s.sub(/([?!=])$/, '')
69
- punctuation = $LAST_PAREN_MATCH
67
+ punctuation = Regexp.last_match(-1)
70
68
 
71
69
  {
72
70
  with_cache_method_name: "#{method_name_without_punctuation}_with_cache#{punctuation}",
@@ -2,15 +2,13 @@
2
2
 
3
3
  module Cacheable
4
4
  module VERSION
5
- MAJOR = 1
5
+ MAJOR = 2
6
6
  MINOR = 0
7
- TINY = 4
7
+ TINY = 0
8
8
  PRE = nil
9
9
 
10
- STRING = [MAJOR, MINOR, TINY, PRE].compact.join('.').freeze
11
-
12
10
  def self.to_s
13
- STRING
11
+ [MAJOR, MINOR, TINY, PRE].compact.join('.').freeze
14
12
  end
15
13
  end
16
14
  end
metadata CHANGED
@@ -1,16 +1,16 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: cacheable
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.4
4
+ version: 2.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Jess Hottenstein
8
8
  - Ryan Laughlin
9
9
  - Aaron Rosenberg
10
- autorequire:
10
+ autorequire:
11
11
  bindir: bin
12
12
  cert_chain: []
13
- date: 2018-07-31 00:00:00.000000000 Z
13
+ date: 2022-02-08 00:00:00.000000000 Z
14
14
  dependencies: []
15
15
  description: Add caching simply without modifying your existing code. Includes configurable
16
16
  options for simple cache invalidation. See README on github for more information.
@@ -30,8 +30,9 @@ files:
30
30
  homepage: https://github.com/splitwise/cacheable
31
31
  licenses:
32
32
  - MIT
33
- metadata: {}
34
- post_install_message:
33
+ metadata:
34
+ rubygems_mfa_required: 'true'
35
+ post_install_message:
35
36
  rdoc_options: []
36
37
  require_paths:
37
38
  - lib
@@ -39,16 +40,15 @@ required_ruby_version: !ruby/object:Gem::Requirement
39
40
  requirements:
40
41
  - - ">="
41
42
  - !ruby/object:Gem::Version
42
- version: 2.3.0
43
+ version: 2.6.0
43
44
  required_rubygems_version: !ruby/object:Gem::Requirement
44
45
  requirements:
45
46
  - - ">="
46
47
  - !ruby/object:Gem::Version
47
48
  version: '0'
48
49
  requirements: []
49
- rubyforge_project:
50
- rubygems_version: 2.7.8
51
- signing_key:
50
+ rubygems_version: 3.3.3
51
+ signing_key:
52
52
  specification_version: 4
53
53
  summary: Add caching to any Ruby method in a aspect orientated programming approach.
54
54
  test_files: []