active_memoize 2.0.2 → 2.0.3

This diff has not been reviewed by any users.
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: 319bbad01c674d237b4b2c66e865ba44127de572a67cfea712b51b5e2b5bdfc0
4
- data.tar.gz: d0f8439b424104e55939ac7fb373e08b1f3baa8e8d9997e8d01c009f781d299e
3
+ metadata.gz: e6f8ce3d9251bf7906de7964606d621bec7ff3260b34f5cc7c7d80719ef6ffdc
4
+ data.tar.gz: ca079bc5cbbd115636158ba08b1c0bb347232fab558483ec420cbd628bcae7e2
5
5
  SHA512:
6
- metadata.gz: a9d7c454c684d646a6a934230660d29280e992258c99f8d4ec6b7a23cc7388948b8812036d5c4fe1526905fd4b78efd34c45cb591e24ef2ecdc0ae872001949e
7
- data.tar.gz: bbd807429d3ab6e6df57afb7adf4e6f8ff476efb38a7801cbf418a63d109cad913d59b2b620ef0c35ca14c816aba46c33583cdb56a4bd31fd66f8cec55775a58
6
+ metadata.gz: addc7bd1aae638f156e605ac3772e81c087fc0a4777f5b93198fb843fa70b4e5aa2737eba64199ba0c9821ce0eab8727547d582bcf1fe8ed90b97c9def0e2b41
7
+ data.tar.gz: cccfca017b789426b4cddf372d6fb3f0adfd0f7dbca0d6d4e0d723acd640091d7c676fc37ecf1b9d419e83022af8601f958e72baaef96b0e41bff8fe8fb23830
data/.irbrc CHANGED
@@ -5,8 +5,8 @@ begin
5
5
  require 'awesome_print'
6
6
 
7
7
  AwesomePrint.irb!
8
- rescue LoadError => err
9
- warn "Couldn't load awesome_print: #{err}"
8
+ rescue LoadError => e
9
+ warn "Couldn't load awesome_print: #{e}"
10
10
  end
11
11
 
12
12
  # IRB
@@ -1,7 +1,8 @@
1
+ require: rubocop-performance
1
2
  AllCops:
2
3
  DisplayCopNames: true
3
4
  DisplayStyleGuide: true
4
- TargetRubyVersion: 2.5
5
+ TargetRubyVersion: 2.6
5
6
  Exclude:
6
7
  - 'spec/**/**/*'
7
8
  Performance/RegexpMatch:
@@ -16,6 +17,8 @@ Lint/RescueException:
16
17
  Enabled: false
17
18
  Metrics/ModuleLength:
18
19
  Enabled: false
20
+ Naming/UncommunicativeMethodParamName:
21
+ Enabled: false
19
22
  Style/Alias:
20
23
  EnforcedStyle: prefer_alias_method
21
24
  Style/ClassAndModuleChildren:
@@ -26,4 +26,5 @@ Gem::Specification.new do |spec|
26
26
  spec.add_development_dependency 'reek'
27
27
  spec.add_development_dependency 'rspec'
28
28
  spec.add_development_dependency 'rubocop'
29
+ spec.add_development_dependency 'rubocop-performance'
29
30
  end
@@ -80,12 +80,10 @@ module ActiveMemoize
80
80
 
81
81
  private
82
82
 
83
- # rubocop:disable Metrics/LineLength
84
83
  def caller_locals(block)
85
84
  local_vars = block.binding.local_variables
86
85
  local_vars.flat_map { |name| [name, block.binding.local_variable_get(name)] }
87
86
  end
88
- # rubocop:enable Metrics/LineLength
89
87
 
90
88
  def caller_method
91
89
  val = caller(2..2).first[CALLER_METHOD_REGEX, 1]
@@ -10,6 +10,8 @@ module ActiveMemoize
10
10
  end
11
11
 
12
12
  def key(method_name, method_args)
13
+ return method_name.to_s if method_args.empty?
14
+
13
15
  method_sha1 = Digest::SHA1.hexdigest(method_args.to_s)
14
16
  "#{method_name}:#{method_sha1}"
15
17
  end
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module ActiveMemoize
4
- VERSION ||= '2.0.2'
4
+ VERSION ||= '2.0.3'
5
5
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: active_memoize
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.0.2
4
+ version: 2.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Juan Gomez
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2019-03-19 00:00:00.000000000 Z
11
+ date: 2019-04-04 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -94,6 +94,20 @@ dependencies:
94
94
  - - ">="
95
95
  - !ruby/object:Gem::Version
96
96
  version: '0'
97
+ - !ruby/object:Gem::Dependency
98
+ name: rubocop-performance
99
+ requirement: !ruby/object:Gem::Requirement
100
+ requirements:
101
+ - - ">="
102
+ - !ruby/object:Gem::Version
103
+ version: '0'
104
+ type: :development
105
+ prerelease: false
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - ">="
109
+ - !ruby/object:Gem::Version
110
+ version: '0'
97
111
  description: Cache and memoize expensive calculations.
98
112
  email:
99
113
  - j.gomez@drexed.com