db_memoize 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/.gitignore +9 -0
- data/.rspec +2 -0
- data/.rubocop.yml +68 -0
- data/.travis.yml +8 -0
- data/Gemfile +4 -0
- data/LICENSE +21 -0
- data/README.md +121 -0
- data/Rakefile +6 -0
- data/bin/console +14 -0
- data/bin/setup +8 -0
- data/db_memoize.gemspec +44 -0
- data/lib/db_memoize.rb +19 -0
- data/lib/db_memoize/migrations.rb +19 -0
- data/lib/db_memoize/model.rb +108 -0
- data/lib/db_memoize/railtie.rb +15 -0
- data/lib/db_memoize/value.rb +5 -0
- data/lib/db_memoize/version.rb +3 -0
- data/lib/tasks/clear.rake +12 -0
- data/lib/tasks/warmup.rake +28 -0
- metadata +343 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 5cf37e7e3bcb43c485a32f066bf662c46c677400
|
4
|
+
data.tar.gz: e0e4c7ba6212f110b4eb86198c0633728f4557ae
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: f15c0a14ded498437c44dc83b08ab3dec65bf3fe481c3d3c9a9a315884e6354bdb91b467158109f68e3fa747810eb30e4393290d3660d7390c00959669b94ecd
|
7
|
+
data.tar.gz: 4794780073585583111c8aa03b259f5674dbbac73f359e0eaf9ae00a3e79390aadfd098074d29b86595c79c31f6b60c1ef1149fe2d59cbe96215246a9e946d0b
|
data/.gitignore
ADDED
data/.rspec
ADDED
data/.rubocop.yml
ADDED
@@ -0,0 +1,68 @@
|
|
1
|
+
AllCops:
|
2
|
+
TargetRubyVersion: 2.3
|
3
|
+
Include:
|
4
|
+
- Rakefile
|
5
|
+
- config.ru
|
6
|
+
Exclude:
|
7
|
+
- Rakefile
|
8
|
+
- bin/*
|
9
|
+
- config.ru
|
10
|
+
- config/**/*
|
11
|
+
- db/**/*
|
12
|
+
- doc/**/*
|
13
|
+
- gems/**/*
|
14
|
+
- gems/*/vendor/**/*
|
15
|
+
- script/**/*
|
16
|
+
- sh/**/*
|
17
|
+
- spec/rails_helper.rb
|
18
|
+
- spec/spec_helper.rb
|
19
|
+
- vendor/**/*
|
20
|
+
- spec/support/v20140601/requests_helper.rb
|
21
|
+
|
22
|
+
Style/FrozenStringLiteralComment:
|
23
|
+
Enabled: false
|
24
|
+
|
25
|
+
Metrics/LineLength:
|
26
|
+
Max: 140
|
27
|
+
|
28
|
+
Rails:
|
29
|
+
Enabled: true
|
30
|
+
|
31
|
+
Rails/HasAndBelongsToMany:
|
32
|
+
Enabled: false
|
33
|
+
|
34
|
+
Style/Documentation:
|
35
|
+
Enabled: false
|
36
|
+
|
37
|
+
Style/BlockDelimiters:
|
38
|
+
Enabled: false
|
39
|
+
|
40
|
+
Style/CollectionMethods:
|
41
|
+
PreferredMethods:
|
42
|
+
collect: 'map'
|
43
|
+
collect!: 'map!'
|
44
|
+
inject: 'reduce'
|
45
|
+
detect: 'find'
|
46
|
+
find_all: 'select'
|
47
|
+
|
48
|
+
Style/TrivialAccessors:
|
49
|
+
Enabled: true
|
50
|
+
ExactNameMatch: true
|
51
|
+
AllowPredicates: true
|
52
|
+
|
53
|
+
# TODO in the future try to reduce this section:
|
54
|
+
Metrics/AbcSize:
|
55
|
+
Max: 36
|
56
|
+
|
57
|
+
Metrics/ClassLength:
|
58
|
+
Max: 125
|
59
|
+
|
60
|
+
Metrics/ModuleLength:
|
61
|
+
Max: 150
|
62
|
+
|
63
|
+
Metrics/MethodLength:
|
64
|
+
Max: 30
|
65
|
+
|
66
|
+
# "Prefer !expression.nil? over expression != nil." no way!
|
67
|
+
Style/NonNilCheck:
|
68
|
+
Enabled: false
|
data/.travis.yml
ADDED
data/Gemfile
ADDED
data/LICENSE
ADDED
@@ -0,0 +1,21 @@
|
|
1
|
+
MIT License
|
2
|
+
|
3
|
+
Copyright (c) 2016 mediapeers
|
4
|
+
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
7
|
+
in the Software without restriction, including without limitation the rights
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
10
|
+
furnished to do so, subject to the following conditions:
|
11
|
+
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
13
|
+
copies or substantial portions of the Software.
|
14
|
+
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
21
|
+
SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,121 @@
|
|
1
|
+
# db_memoize
|
2
|
+
library to cache (memoize) method return values in database
|
3
|
+
|
4
|
+
## Usage in ActiveRecord models:
|
5
|
+
|
6
|
+
### Example Class:
|
7
|
+
|
8
|
+
```
|
9
|
+
class Letter < ActiveRecord::Base
|
10
|
+
include DbMemoize::Model
|
11
|
+
|
12
|
+
def hello(name = 'John')
|
13
|
+
"Hello #{name}!"
|
14
|
+
end
|
15
|
+
db_memoize :hello
|
16
|
+
|
17
|
+
def bye
|
18
|
+
'Best regards'
|
19
|
+
end
|
20
|
+
db_memoize :bye
|
21
|
+
end
|
22
|
+
```
|
23
|
+
|
24
|
+
### Get Values
|
25
|
+
|
26
|
+
```
|
27
|
+
record = Letter.first
|
28
|
+
record.hello
|
29
|
+
=> 'Hello John!'
|
30
|
+
record.hello
|
31
|
+
=> 'Hello John!'
|
32
|
+
```
|
33
|
+
|
34
|
+
will call the original method only once. Consecutive calls will return a cached value.
|
35
|
+
|
36
|
+
If the method takes arguments..
|
37
|
+
|
38
|
+
```
|
39
|
+
record.hello('Maria')
|
40
|
+
record.hello('John')
|
41
|
+
```
|
42
|
+
|
43
|
+
a cached value will be created for every set of arguments.
|
44
|
+
|
45
|
+
### Clear Values
|
46
|
+
|
47
|
+
To clear cached values for a single method
|
48
|
+
|
49
|
+
```
|
50
|
+
record.unmemoize(:hello)
|
51
|
+
```
|
52
|
+
|
53
|
+
To clear all cached values of one record
|
54
|
+
|
55
|
+
```
|
56
|
+
record.unmemoize
|
57
|
+
```
|
58
|
+
|
59
|
+
To clear cached values of given records for a single method
|
60
|
+
|
61
|
+
```
|
62
|
+
Letter.unmemoize([letter1, letter2], :hello)
|
63
|
+
```
|
64
|
+
|
65
|
+
To clear all cached values of given records
|
66
|
+
|
67
|
+
```
|
68
|
+
Letter.unmemoize([letter1, letter2])
|
69
|
+
```
|
70
|
+
|
71
|
+
Instead of ActiveRecord instances it's sufficient to pass in the ids of the records, too
|
72
|
+
|
73
|
+
```
|
74
|
+
Letter.unmemoize([23,24])
|
75
|
+
```
|
76
|
+
|
77
|
+
### Gotchas
|
78
|
+
|
79
|
+
As the cached values themselves are writtten to the database, are ActiveRecord records (of type `DbMemoize::Value`) and are reqistered as an association you can access all of the cached values of an object like this:
|
80
|
+
|
81
|
+
```
|
82
|
+
record.memoized_values
|
83
|
+
```
|
84
|
+
|
85
|
+
This means you can also very easily perform eager loading on them:
|
86
|
+
|
87
|
+
```
|
88
|
+
Letter.includes(:memoized_values).all
|
89
|
+
```
|
90
|
+
|
91
|
+
DbMemoize by default will write log output to STDOUT. You can change this by setting another logger like so:
|
92
|
+
|
93
|
+
```
|
94
|
+
DbMemoize.logger = your_logger
|
95
|
+
```
|
96
|
+
|
97
|
+
To invalidate all cached keys easily you can specify a default custom key to be used internally like this:
|
98
|
+
|
99
|
+
```
|
100
|
+
DbMemoize.default_custom_key = 'e.g. latest git commit hash'
|
101
|
+
```
|
102
|
+
|
103
|
+
### Rake Tasks
|
104
|
+
|
105
|
+
To _warmup_ your cache you can pre-generate cached values via a rake task like this (only works for methods not depending on arguments)
|
106
|
+
|
107
|
+
```
|
108
|
+
bundle exec rake db_memoize:warmup class=Letter methods=hello,bye
|
109
|
+
```
|
110
|
+
|
111
|
+
Similarly you can wipe all cached values for a given class
|
112
|
+
|
113
|
+
```
|
114
|
+
bundle exec rake db_memoize:clear class=Letter
|
115
|
+
```
|
116
|
+
|
117
|
+
|
118
|
+
Have fun!
|
119
|
+
|
120
|
+
|
121
|
+
|
data/Rakefile
ADDED
data/bin/console
ADDED
@@ -0,0 +1,14 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
|
3
|
+
require "bundler/setup"
|
4
|
+
require "db_memoize"
|
5
|
+
|
6
|
+
# You can add fixtures and/or initialization code here to make experimenting
|
7
|
+
# with your gem easier. You can also use a different console, if you like.
|
8
|
+
|
9
|
+
# (If you use this, don't forget to add pry to your Gemfile!)
|
10
|
+
# require "pry"
|
11
|
+
# Pry.start
|
12
|
+
|
13
|
+
require "irb"
|
14
|
+
IRB.start
|
data/bin/setup
ADDED
data/db_memoize.gemspec
ADDED
@@ -0,0 +1,44 @@
|
|
1
|
+
# coding: utf-8
|
2
|
+
lib = File.expand_path('../lib', __FILE__)
|
3
|
+
$LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
|
4
|
+
require 'db_memoize/version'
|
5
|
+
|
6
|
+
Gem::Specification.new do |spec|
|
7
|
+
spec.name = "db_memoize"
|
8
|
+
spec.version = DbMemoize::VERSION
|
9
|
+
spec.licenses = ['MIT']
|
10
|
+
spec.authors = ["johannes-kostas goetzinger"]
|
11
|
+
spec.email = ["goetzinger@mediapeers.com"]
|
12
|
+
|
13
|
+
spec.summary = %q{library to cache (memoize) method return values in database}
|
14
|
+
spec.description = %q{library to cache (memoize) method return values in database}
|
15
|
+
spec.homepage = "https://github.com/mediapeers/db_memoize"
|
16
|
+
|
17
|
+
spec.files = `git ls-files -z`.split("\x0").reject do |f|
|
18
|
+
f.match(%r{^(test|spec|features)/})
|
19
|
+
end
|
20
|
+
spec.bindir = 'exe'
|
21
|
+
spec.executables = spec.files.grep(%r{^exe/}) { |f| File.basename(f) }
|
22
|
+
spec.require_paths = ['lib']
|
23
|
+
|
24
|
+
spec.add_development_dependency 'railties', '~> 4.2'
|
25
|
+
spec.add_development_dependency 'activemodel', '~> 4.2'
|
26
|
+
spec.add_development_dependency 'actionpack', '~> 4.2'
|
27
|
+
spec.add_development_dependency 'activesupport', '~> 4.2'
|
28
|
+
spec.add_development_dependency 'activerecord', '~> 4.2'
|
29
|
+
spec.add_development_dependency 'activejob', '~> 4.2'
|
30
|
+
spec.add_development_dependency 'arel', '6.0.0'
|
31
|
+
spec.add_development_dependency 'rake', '~> 10.5'
|
32
|
+
spec.add_development_dependency 'sqlite3'
|
33
|
+
spec.add_development_dependency 'rspec-rails', '~> 3.4'
|
34
|
+
spec.add_development_dependency 'pry', '~> 0.10'
|
35
|
+
spec.add_development_dependency 'pry-byebug', '~> 2.0'
|
36
|
+
spec.add_development_dependency 'yard', '~> 0'
|
37
|
+
spec.add_development_dependency 'simplecov', '~> 0.7.1'
|
38
|
+
spec.add_development_dependency 'rubocop', '~> 0.37.2'
|
39
|
+
spec.add_development_dependency 'database_cleaner', '~> 1.5.3'
|
40
|
+
spec.add_development_dependency 'factory_girl', '~> 4.7.0'
|
41
|
+
spec.add_development_dependency 'ruby-progressbar', '~> 1.7'
|
42
|
+
spec.add_development_dependency 'ffaker'
|
43
|
+
spec.add_development_dependency 'awesome_print'
|
44
|
+
end
|
data/lib/db_memoize.rb
ADDED
@@ -0,0 +1,19 @@
|
|
1
|
+
require 'active_record'
|
2
|
+
require 'active_support'
|
3
|
+
require 'digest'
|
4
|
+
require 'benchmark'
|
5
|
+
require 'db_memoize/version'
|
6
|
+
require 'db_memoize/value'
|
7
|
+
require 'db_memoize/model'
|
8
|
+
require 'db_memoize/railtie' if defined?(Rails)
|
9
|
+
|
10
|
+
module DbMemoize
|
11
|
+
class << self
|
12
|
+
attr_accessor :default_custom_key
|
13
|
+
attr_writer :logger
|
14
|
+
|
15
|
+
def logger
|
16
|
+
@logger ||= ::Logger.new(STDOUT)
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,19 @@
|
|
1
|
+
module DbMemoize
|
2
|
+
class Migrations
|
3
|
+
class << self
|
4
|
+
def create_tables(migration)
|
5
|
+
migration.create_table :memoized_values, id: false do |t|
|
6
|
+
t.string :entity_table_name
|
7
|
+
t.string :entity_id
|
8
|
+
t.string :method_name
|
9
|
+
t.string :arguments_hash
|
10
|
+
t.string :custom_key
|
11
|
+
t.binary :value
|
12
|
+
t.datetime :created_at
|
13
|
+
end
|
14
|
+
|
15
|
+
migration.add_index :memoized_values, [:entity_table_name, :entity_id]
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
@@ -0,0 +1,108 @@
|
|
1
|
+
module DbMemoize
|
2
|
+
module Model
|
3
|
+
extend ActiveSupport::Concern
|
4
|
+
|
5
|
+
def memoized_value(method_name, args)
|
6
|
+
if changed? || !persisted?
|
7
|
+
return send("#{method_name}_without_memoize", *args)
|
8
|
+
end
|
9
|
+
|
10
|
+
value = nil
|
11
|
+
args_hash = ::Digest::MD5.hexdigest(Marshal.dump(args))
|
12
|
+
cached_value = find_memoized_value(method_name, args_hash)
|
13
|
+
|
14
|
+
if cached_value
|
15
|
+
log(method_name, 'cache hit')
|
16
|
+
value = Marshal.load(cached_value.value)
|
17
|
+
else
|
18
|
+
time = ::Benchmark.realtime do
|
19
|
+
value = send("#{method_name}_without_memoize", *args)
|
20
|
+
end
|
21
|
+
# dear rubocop, we can't use `format` here, since some of our models have a
|
22
|
+
# `format` method themselves.
|
23
|
+
# rubocop:disable Style/FormatString
|
24
|
+
log(method_name, "cache miss. took #{sprintf('%.2f', time * 1_000)}ms")
|
25
|
+
# rubocop:enable Style/FormatString
|
26
|
+
create_memoized_value(method_name, args_hash, value)
|
27
|
+
end
|
28
|
+
|
29
|
+
value
|
30
|
+
end
|
31
|
+
|
32
|
+
def unmemoize(method_name = :all)
|
33
|
+
self.class.unmemoize(self, method_name)
|
34
|
+
end
|
35
|
+
|
36
|
+
def memoized_custom_key
|
37
|
+
::DbMemoize.default_custom_key
|
38
|
+
end
|
39
|
+
|
40
|
+
private
|
41
|
+
|
42
|
+
def create_memoized_value(method_name, args_hash, value)
|
43
|
+
memoized_values.create!(
|
44
|
+
entity_table_name: self.class.table_name,
|
45
|
+
method_name: method_name.to_s,
|
46
|
+
arguments_hash: args_hash,
|
47
|
+
custom_key: memoized_custom_key.to_s,
|
48
|
+
value: Marshal.dump(value)
|
49
|
+
)
|
50
|
+
end
|
51
|
+
|
52
|
+
def find_memoized_value(method_name, args_hash)
|
53
|
+
memoized_values.detect do |rec|
|
54
|
+
rec.method_name == method_name.to_s &&
|
55
|
+
rec.arguments_hash == args_hash &&
|
56
|
+
rec.custom_key == memoized_custom_key.to_s
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
def log(method_name, msg)
|
61
|
+
DbMemoize.logger.info "DbMemoize <#{self.class.name} id: #{id}>##{method_name} - #{msg}"
|
62
|
+
end
|
63
|
+
|
64
|
+
module ClassMethods
|
65
|
+
def db_memoize(method_name)
|
66
|
+
create_alias_method(method_name)
|
67
|
+
create_memoized_values_association
|
68
|
+
end
|
69
|
+
|
70
|
+
def unmemoize(records_or_ids, method_name = :all)
|
71
|
+
records_or_ids = Array(records_or_ids)
|
72
|
+
return if records_or_ids.empty?
|
73
|
+
|
74
|
+
ids = if records_or_ids.first.is_a?(ActiveRecord::Base)
|
75
|
+
records_or_ids.map(&:id)
|
76
|
+
else
|
77
|
+
records_or_ids
|
78
|
+
end
|
79
|
+
|
80
|
+
conditions = {
|
81
|
+
entity_table_name: table_name,
|
82
|
+
entity_id: ids
|
83
|
+
}
|
84
|
+
conditions[:method_name] = method_name unless method_name == :all
|
85
|
+
|
86
|
+
DbMemoize::Value.where(conditions).delete_all
|
87
|
+
end
|
88
|
+
|
89
|
+
private
|
90
|
+
|
91
|
+
def create_alias_method(method_name)
|
92
|
+
define_method "#{method_name}_with_memoize" do |*args|
|
93
|
+
memoized_value(method_name, args)
|
94
|
+
end
|
95
|
+
|
96
|
+
alias_method_chain method_name, :memoize
|
97
|
+
end
|
98
|
+
|
99
|
+
def create_memoized_values_association
|
100
|
+
unless reflect_on_association(:memoized_values)
|
101
|
+
conditions = { entity_table_name: table_name }
|
102
|
+
has_many :memoized_values, -> { where(conditions) },
|
103
|
+
dependent: :destroy, class_name: 'DbMemoize::Value', foreign_key: :entity_id
|
104
|
+
end
|
105
|
+
end
|
106
|
+
end
|
107
|
+
end
|
108
|
+
end
|
@@ -0,0 +1,15 @@
|
|
1
|
+
module DbMemoize
|
2
|
+
class Railtie < ::Rails::Railtie
|
3
|
+
initializer 'Rails logger' do
|
4
|
+
DbMemoize.logger = Rails.logger
|
5
|
+
|
6
|
+
# by default invalidate cache when db schema has changed
|
7
|
+
DbMemoize.default_custom_key = ActiveRecord::Migrator.current_version
|
8
|
+
end
|
9
|
+
|
10
|
+
rake_tasks do
|
11
|
+
load 'tasks/clear.rake'
|
12
|
+
load 'tasks/warmup.rake'
|
13
|
+
end
|
14
|
+
end
|
15
|
+
end
|
@@ -0,0 +1,12 @@
|
|
1
|
+
namespace :db_memoize do
|
2
|
+
desc "wipes all currently memoized values (pass 'class=Product') to filter by class name"
|
3
|
+
task clear: :environment do
|
4
|
+
scope = DbMemoize::Value.all
|
5
|
+
|
6
|
+
if klass_name = ENV['class']
|
7
|
+
scope = scope.where(entity_table_name: klass_name.constantize.table_name)
|
8
|
+
end
|
9
|
+
|
10
|
+
scope.delete_all
|
11
|
+
end
|
12
|
+
end
|
@@ -0,0 +1,28 @@
|
|
1
|
+
namespace :db_memoize do
|
2
|
+
desc "generates memoized values (pass e.g. 'class=Product methods=to_document,to_hash')"
|
3
|
+
task warmup: :environment do
|
4
|
+
require 'ruby-progressbar'
|
5
|
+
|
6
|
+
klass_name = ENV['class']
|
7
|
+
methods = ENV['methods'].split(',')
|
8
|
+
klass = klass_name.constantize
|
9
|
+
count = klass.count
|
10
|
+
|
11
|
+
progressbar = ProgressBar.create(
|
12
|
+
title: "db_memoize warmup run for #{klass_name}",
|
13
|
+
starting_at: 0,
|
14
|
+
total: count,
|
15
|
+
format: "%t [#{count}] |%bᗧ%i| %p%% %e",
|
16
|
+
progress_mark: ' ',
|
17
|
+
remainder_mark: '.'
|
18
|
+
)
|
19
|
+
|
20
|
+
klass_name.constantize.find_each do |record|
|
21
|
+
methods.each do |meth|
|
22
|
+
record.send(meth)
|
23
|
+
end
|
24
|
+
|
25
|
+
progressbar.increment
|
26
|
+
end
|
27
|
+
end
|
28
|
+
end
|
metadata
ADDED
@@ -0,0 +1,343 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: db_memoize
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- johannes-kostas goetzinger
|
8
|
+
autorequire:
|
9
|
+
bindir: exe
|
10
|
+
cert_chain: []
|
11
|
+
date: 2017-01-03 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: railties
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '4.2'
|
20
|
+
type: :development
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '4.2'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: activemodel
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '4.2'
|
34
|
+
type: :development
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '4.2'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: actionpack
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '4.2'
|
48
|
+
type: :development
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '4.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: activesupport
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '4.2'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '4.2'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: activerecord
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '4.2'
|
76
|
+
type: :development
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '4.2'
|
83
|
+
- !ruby/object:Gem::Dependency
|
84
|
+
name: activejob
|
85
|
+
requirement: !ruby/object:Gem::Requirement
|
86
|
+
requirements:
|
87
|
+
- - "~>"
|
88
|
+
- !ruby/object:Gem::Version
|
89
|
+
version: '4.2'
|
90
|
+
type: :development
|
91
|
+
prerelease: false
|
92
|
+
version_requirements: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - "~>"
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '4.2'
|
97
|
+
- !ruby/object:Gem::Dependency
|
98
|
+
name: arel
|
99
|
+
requirement: !ruby/object:Gem::Requirement
|
100
|
+
requirements:
|
101
|
+
- - '='
|
102
|
+
- !ruby/object:Gem::Version
|
103
|
+
version: 6.0.0
|
104
|
+
type: :development
|
105
|
+
prerelease: false
|
106
|
+
version_requirements: !ruby/object:Gem::Requirement
|
107
|
+
requirements:
|
108
|
+
- - '='
|
109
|
+
- !ruby/object:Gem::Version
|
110
|
+
version: 6.0.0
|
111
|
+
- !ruby/object:Gem::Dependency
|
112
|
+
name: rake
|
113
|
+
requirement: !ruby/object:Gem::Requirement
|
114
|
+
requirements:
|
115
|
+
- - "~>"
|
116
|
+
- !ruby/object:Gem::Version
|
117
|
+
version: '10.5'
|
118
|
+
type: :development
|
119
|
+
prerelease: false
|
120
|
+
version_requirements: !ruby/object:Gem::Requirement
|
121
|
+
requirements:
|
122
|
+
- - "~>"
|
123
|
+
- !ruby/object:Gem::Version
|
124
|
+
version: '10.5'
|
125
|
+
- !ruby/object:Gem::Dependency
|
126
|
+
name: sqlite3
|
127
|
+
requirement: !ruby/object:Gem::Requirement
|
128
|
+
requirements:
|
129
|
+
- - ">="
|
130
|
+
- !ruby/object:Gem::Version
|
131
|
+
version: '0'
|
132
|
+
type: :development
|
133
|
+
prerelease: false
|
134
|
+
version_requirements: !ruby/object:Gem::Requirement
|
135
|
+
requirements:
|
136
|
+
- - ">="
|
137
|
+
- !ruby/object:Gem::Version
|
138
|
+
version: '0'
|
139
|
+
- !ruby/object:Gem::Dependency
|
140
|
+
name: rspec-rails
|
141
|
+
requirement: !ruby/object:Gem::Requirement
|
142
|
+
requirements:
|
143
|
+
- - "~>"
|
144
|
+
- !ruby/object:Gem::Version
|
145
|
+
version: '3.4'
|
146
|
+
type: :development
|
147
|
+
prerelease: false
|
148
|
+
version_requirements: !ruby/object:Gem::Requirement
|
149
|
+
requirements:
|
150
|
+
- - "~>"
|
151
|
+
- !ruby/object:Gem::Version
|
152
|
+
version: '3.4'
|
153
|
+
- !ruby/object:Gem::Dependency
|
154
|
+
name: pry
|
155
|
+
requirement: !ruby/object:Gem::Requirement
|
156
|
+
requirements:
|
157
|
+
- - "~>"
|
158
|
+
- !ruby/object:Gem::Version
|
159
|
+
version: '0.10'
|
160
|
+
type: :development
|
161
|
+
prerelease: false
|
162
|
+
version_requirements: !ruby/object:Gem::Requirement
|
163
|
+
requirements:
|
164
|
+
- - "~>"
|
165
|
+
- !ruby/object:Gem::Version
|
166
|
+
version: '0.10'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: pry-byebug
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '2.0'
|
174
|
+
type: :development
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '2.0'
|
181
|
+
- !ruby/object:Gem::Dependency
|
182
|
+
name: yard
|
183
|
+
requirement: !ruby/object:Gem::Requirement
|
184
|
+
requirements:
|
185
|
+
- - "~>"
|
186
|
+
- !ruby/object:Gem::Version
|
187
|
+
version: '0'
|
188
|
+
type: :development
|
189
|
+
prerelease: false
|
190
|
+
version_requirements: !ruby/object:Gem::Requirement
|
191
|
+
requirements:
|
192
|
+
- - "~>"
|
193
|
+
- !ruby/object:Gem::Version
|
194
|
+
version: '0'
|
195
|
+
- !ruby/object:Gem::Dependency
|
196
|
+
name: simplecov
|
197
|
+
requirement: !ruby/object:Gem::Requirement
|
198
|
+
requirements:
|
199
|
+
- - "~>"
|
200
|
+
- !ruby/object:Gem::Version
|
201
|
+
version: 0.7.1
|
202
|
+
type: :development
|
203
|
+
prerelease: false
|
204
|
+
version_requirements: !ruby/object:Gem::Requirement
|
205
|
+
requirements:
|
206
|
+
- - "~>"
|
207
|
+
- !ruby/object:Gem::Version
|
208
|
+
version: 0.7.1
|
209
|
+
- !ruby/object:Gem::Dependency
|
210
|
+
name: rubocop
|
211
|
+
requirement: !ruby/object:Gem::Requirement
|
212
|
+
requirements:
|
213
|
+
- - "~>"
|
214
|
+
- !ruby/object:Gem::Version
|
215
|
+
version: 0.37.2
|
216
|
+
type: :development
|
217
|
+
prerelease: false
|
218
|
+
version_requirements: !ruby/object:Gem::Requirement
|
219
|
+
requirements:
|
220
|
+
- - "~>"
|
221
|
+
- !ruby/object:Gem::Version
|
222
|
+
version: 0.37.2
|
223
|
+
- !ruby/object:Gem::Dependency
|
224
|
+
name: database_cleaner
|
225
|
+
requirement: !ruby/object:Gem::Requirement
|
226
|
+
requirements:
|
227
|
+
- - "~>"
|
228
|
+
- !ruby/object:Gem::Version
|
229
|
+
version: 1.5.3
|
230
|
+
type: :development
|
231
|
+
prerelease: false
|
232
|
+
version_requirements: !ruby/object:Gem::Requirement
|
233
|
+
requirements:
|
234
|
+
- - "~>"
|
235
|
+
- !ruby/object:Gem::Version
|
236
|
+
version: 1.5.3
|
237
|
+
- !ruby/object:Gem::Dependency
|
238
|
+
name: factory_girl
|
239
|
+
requirement: !ruby/object:Gem::Requirement
|
240
|
+
requirements:
|
241
|
+
- - "~>"
|
242
|
+
- !ruby/object:Gem::Version
|
243
|
+
version: 4.7.0
|
244
|
+
type: :development
|
245
|
+
prerelease: false
|
246
|
+
version_requirements: !ruby/object:Gem::Requirement
|
247
|
+
requirements:
|
248
|
+
- - "~>"
|
249
|
+
- !ruby/object:Gem::Version
|
250
|
+
version: 4.7.0
|
251
|
+
- !ruby/object:Gem::Dependency
|
252
|
+
name: ruby-progressbar
|
253
|
+
requirement: !ruby/object:Gem::Requirement
|
254
|
+
requirements:
|
255
|
+
- - "~>"
|
256
|
+
- !ruby/object:Gem::Version
|
257
|
+
version: '1.7'
|
258
|
+
type: :development
|
259
|
+
prerelease: false
|
260
|
+
version_requirements: !ruby/object:Gem::Requirement
|
261
|
+
requirements:
|
262
|
+
- - "~>"
|
263
|
+
- !ruby/object:Gem::Version
|
264
|
+
version: '1.7'
|
265
|
+
- !ruby/object:Gem::Dependency
|
266
|
+
name: ffaker
|
267
|
+
requirement: !ruby/object:Gem::Requirement
|
268
|
+
requirements:
|
269
|
+
- - ">="
|
270
|
+
- !ruby/object:Gem::Version
|
271
|
+
version: '0'
|
272
|
+
type: :development
|
273
|
+
prerelease: false
|
274
|
+
version_requirements: !ruby/object:Gem::Requirement
|
275
|
+
requirements:
|
276
|
+
- - ">="
|
277
|
+
- !ruby/object:Gem::Version
|
278
|
+
version: '0'
|
279
|
+
- !ruby/object:Gem::Dependency
|
280
|
+
name: awesome_print
|
281
|
+
requirement: !ruby/object:Gem::Requirement
|
282
|
+
requirements:
|
283
|
+
- - ">="
|
284
|
+
- !ruby/object:Gem::Version
|
285
|
+
version: '0'
|
286
|
+
type: :development
|
287
|
+
prerelease: false
|
288
|
+
version_requirements: !ruby/object:Gem::Requirement
|
289
|
+
requirements:
|
290
|
+
- - ">="
|
291
|
+
- !ruby/object:Gem::Version
|
292
|
+
version: '0'
|
293
|
+
description: library to cache (memoize) method return values in database
|
294
|
+
email:
|
295
|
+
- goetzinger@mediapeers.com
|
296
|
+
executables: []
|
297
|
+
extensions: []
|
298
|
+
extra_rdoc_files: []
|
299
|
+
files:
|
300
|
+
- ".gitignore"
|
301
|
+
- ".rspec"
|
302
|
+
- ".rubocop.yml"
|
303
|
+
- ".travis.yml"
|
304
|
+
- Gemfile
|
305
|
+
- LICENSE
|
306
|
+
- README.md
|
307
|
+
- Rakefile
|
308
|
+
- bin/console
|
309
|
+
- bin/setup
|
310
|
+
- db_memoize.gemspec
|
311
|
+
- lib/db_memoize.rb
|
312
|
+
- lib/db_memoize/migrations.rb
|
313
|
+
- lib/db_memoize/model.rb
|
314
|
+
- lib/db_memoize/railtie.rb
|
315
|
+
- lib/db_memoize/value.rb
|
316
|
+
- lib/db_memoize/version.rb
|
317
|
+
- lib/tasks/clear.rake
|
318
|
+
- lib/tasks/warmup.rake
|
319
|
+
homepage: https://github.com/mediapeers/db_memoize
|
320
|
+
licenses:
|
321
|
+
- MIT
|
322
|
+
metadata: {}
|
323
|
+
post_install_message:
|
324
|
+
rdoc_options: []
|
325
|
+
require_paths:
|
326
|
+
- lib
|
327
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
328
|
+
requirements:
|
329
|
+
- - ">="
|
330
|
+
- !ruby/object:Gem::Version
|
331
|
+
version: '0'
|
332
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
333
|
+
requirements:
|
334
|
+
- - ">="
|
335
|
+
- !ruby/object:Gem::Version
|
336
|
+
version: '0'
|
337
|
+
requirements: []
|
338
|
+
rubyforge_project:
|
339
|
+
rubygems_version: 2.5.1
|
340
|
+
signing_key:
|
341
|
+
specification_version: 4
|
342
|
+
summary: library to cache (memoize) method return values in database
|
343
|
+
test_files: []
|