cache_driver 0.3.6 → 0.3.9
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +33 -21
- data/cache_driver.gemspec +2 -0
- data/lib/cache_driver.rb +10 -8
- data/lib/cache_driver/cache_record.rb +35 -10
- data/lib/cache_driver/version.rb +1 -1
- data/lib/tasks/cache.rake +220 -109
- metadata +39 -11
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 6f3f643df601890d16e5c1548a91ca05029bbeba
|
4
|
+
data.tar.gz: 9d095542cf68507aa194fda41dfd16040679e879
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 59eb1cec1457a54727f6523d2526e8edd0b87c47d04324b242c2f29d8141074b9107fa295610fc1925787be681ddff21453eb52ad476beb2d930158b7a47bbdc
|
7
|
+
data.tar.gz: 7da2b27da62c36dbcfdc2c26d3dc344f408a752053a09173a428a96ca5227c14d263df53d3a5028c86b9caf58d41801403dcf9d90444695770682ada57f64eab
|
data/README.md
CHANGED
@@ -7,7 +7,7 @@ This gem makes rails model act as ActiveRecord, but not save data into database
|
|
7
7
|
Add this line to your application's Gemfile:
|
8
8
|
|
9
9
|
```ruby
|
10
|
-
gem 'cache_driver'
|
10
|
+
gem 'cache_driver', '~> 0.3'
|
11
11
|
```
|
12
12
|
|
13
13
|
And then execute:
|
@@ -24,13 +24,13 @@ Add following code to environments/development.rb or environments/production.rb
|
|
24
24
|
|
25
25
|
```ruby
|
26
26
|
CacheDriver.setup do |config|
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
27
|
+
# set cache store type, :file or :redis
|
28
|
+
config.store = :file
|
29
|
+
config.file_dir = Rails.root.join('tmp', 'cache')
|
30
|
+
#config.store = :redis
|
31
|
+
#config.redis_host = "127.0.0.1"
|
32
|
+
#config.redis_port = 6379
|
33
|
+
#config.redis_namespace = "namespace"
|
34
34
|
end
|
35
35
|
```
|
36
36
|
|
@@ -42,10 +42,10 @@ Just define model like below
|
|
42
42
|
|
43
43
|
```ruby
|
44
44
|
class CacheModel < CacheRecord
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
45
|
+
# attribute name which is made as key to cache data
|
46
|
+
def self.key_attr
|
47
|
+
"attr_name"
|
48
|
+
end
|
49
49
|
end
|
50
50
|
```
|
51
51
|
|
@@ -54,23 +54,34 @@ So you can use this model just like other ActiveRecord instance in controllers l
|
|
54
54
|
```ruby
|
55
55
|
cache_models = CacheModel.find_all # get all instance in cache
|
56
56
|
|
57
|
-
cache_model = CacheModel.find_by_key key # get instance
|
57
|
+
cache_model = CacheModel.find_by_key key # get instance which has key_attr
|
58
58
|
|
59
|
-
cache_model.
|
59
|
+
cache_model = CacheModel.find_current # get instance which has no key_attr
|
60
|
+
|
61
|
+
CacheModel.clear # remove all cache
|
62
|
+
|
63
|
+
cache_model.save # save this instance to cache
|
60
64
|
|
61
65
|
cache_model.destroy # delete this instance
|
62
66
|
```
|
63
67
|
|
64
|
-
|
65
|
-
|
68
|
+
By default, the attribute `Fixnum`, `String`, `Array`, `Hash` will be serialized to cache. But you should declare how to process other object such as Symbol or Class you creates
|
69
|
+
So you can customize the serialization method to change data which you want to cache by overriding the two methods below
|
66
70
|
|
67
71
|
```ruby
|
68
72
|
def to_cache
|
73
|
+
# super will process Fixnum, String, Array, Hash and return a new HashMap to use for serialization
|
74
|
+
# do other work with this hash to customize way of serialization
|
69
75
|
# return a hashmap which you want to cache for this model
|
76
|
+
hash = super
|
70
77
|
end
|
71
78
|
|
72
79
|
def self.from_cache(obj)
|
73
|
-
# return
|
80
|
+
# super will return a new instance for this class from a HashMap named `obj` which unserialized from cache, and the key of HashMap is String not Symbol.
|
81
|
+
# Only Fixnum, String, Array, Hash can be unserialized into HashMapexactly
|
82
|
+
# do other work with this new instance to customize way of unserialization
|
83
|
+
# return a instance of this Class which is unserialized from cache
|
84
|
+
ins = super obj
|
74
85
|
end
|
75
86
|
```
|
76
87
|
|
@@ -87,11 +98,12 @@ Use the the command above to go to cache inspector and you will see the informat
|
|
87
98
|
After this you can use the following six commands to do something with the cache set by current project
|
88
99
|
|
89
100
|
```sql
|
101
|
+
CacheDriver > ? # show all commands and descriptions
|
90
102
|
CacheDriver > show models
|
91
|
-
CacheDriver >
|
92
|
-
CacheDriver >
|
93
|
-
CacheDriver >
|
94
|
-
CacheDriver > delete
|
103
|
+
CacheDriver > show keys <model>
|
104
|
+
CacheDriver > find <model> in <key>
|
105
|
+
CacheDriver > save <model> to <key> withs <attr1>=<val1>,<attr2>=<val2>,...
|
106
|
+
CacheDriver > delete <model> in <key>
|
95
107
|
```
|
96
108
|
|
97
109
|
## Contributing
|
data/cache_driver.gemspec
CHANGED
data/lib/cache_driver.rb
CHANGED
@@ -1,4 +1,6 @@
|
|
1
1
|
require "redis"
|
2
|
+
require 'tty-prompt'
|
3
|
+
require 'colorize'
|
2
4
|
|
3
5
|
require "cache_driver/version"
|
4
6
|
require "cache_driver/config"
|
@@ -9,15 +11,15 @@ require "cache_driver/redis_cache_util"
|
|
9
11
|
|
10
12
|
|
11
13
|
module CacheDriver
|
12
|
-
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
14
|
+
class Railtie < ::Rails::Railtie
|
15
|
+
rake_tasks do
|
16
|
+
load 'tasks/cache.rake'
|
17
|
+
end
|
18
|
+
end
|
17
19
|
end
|
18
20
|
|
19
21
|
unless CacheDriver.configed?
|
20
|
-
|
21
|
-
|
22
|
-
|
22
|
+
CacheDriver.setup do |config|
|
23
|
+
config.store = :file
|
24
|
+
end
|
23
25
|
end
|
@@ -1,33 +1,53 @@
|
|
1
1
|
class CacheRecord
|
2
|
+
def self.key_attr
|
3
|
+
nil
|
4
|
+
end
|
2
5
|
|
3
6
|
def self.find_all
|
4
7
|
CacheRecord.cache_util.read_all CacheUtil.class_to_type(self)
|
5
8
|
end
|
6
9
|
|
7
|
-
def self.find_by_key(key
|
10
|
+
def self.find_by_key(key)
|
8
11
|
CacheRecord.cache_util.read CacheUtil.class_to_type(self), key
|
9
12
|
end
|
10
13
|
|
11
|
-
def
|
12
|
-
|
14
|
+
def self.find_current
|
15
|
+
if self.key_attr
|
16
|
+
raise "#{self} is not a unique class, use method find_by_key instead"
|
17
|
+
else
|
18
|
+
self.find_by_key "current"
|
19
|
+
end
|
13
20
|
end
|
14
21
|
|
15
|
-
def
|
16
|
-
|
22
|
+
def self.clear
|
23
|
+
self.find_all.each(&:destroy)
|
17
24
|
end
|
18
25
|
|
19
|
-
def
|
20
|
-
|
26
|
+
def save
|
27
|
+
raise "attr key :#{self.class.key_attr} is missing" if self.key_attr_missing?
|
28
|
+
|
29
|
+
CacheRecord.cache_util.write CacheUtil.class_to_type(self.class), self.class.key_attr ? self.send(self.class.key_attr) : "current", self
|
30
|
+
end
|
31
|
+
|
32
|
+
def destroy
|
33
|
+
raise "attr key :#{self.class.key_attr} is missing" if self.key_attr_missing?
|
34
|
+
|
35
|
+
CacheRecord.cache_util.delete CacheUtil.class_to_type(self.class), self.class.key_attr ? self.send(self.class.key_attr) : "current"
|
21
36
|
end
|
22
37
|
|
23
38
|
def to_cache
|
24
|
-
|
39
|
+
res = {}
|
40
|
+
self.instance_variables.each do |var|
|
41
|
+
var_name = var.to_s.delete('@')
|
42
|
+
res[var_name.to_sym] = self.instance_variable_get("@#{var_name}")
|
43
|
+
end
|
44
|
+
res
|
25
45
|
end
|
26
46
|
|
27
47
|
def self.from_cache(obj)
|
28
|
-
ins = self.
|
48
|
+
ins = self.allocate
|
29
49
|
obj.each do |key, value|
|
30
|
-
ins.
|
50
|
+
ins.instance_variable_set "@#{key}", value
|
31
51
|
end
|
32
52
|
ins
|
33
53
|
end
|
@@ -36,4 +56,9 @@ class CacheRecord
|
|
36
56
|
def self.cache_util
|
37
57
|
CacheDriver.store_file? ? FileCacheUtil : CacheDriver.store_redis? ? RedisCacheUtil : nil
|
38
58
|
end
|
59
|
+
|
60
|
+
protected
|
61
|
+
def key_attr_missing?
|
62
|
+
self.class.key_attr && self.instance_variable_get("@#{self.class.key_attr}").nil?
|
63
|
+
end
|
39
64
|
end
|
data/lib/cache_driver/version.rb
CHANGED
data/lib/tasks/cache.rake
CHANGED
@@ -1,119 +1,230 @@
|
|
1
|
+
class CacheDriverClient
|
2
|
+
def initialize
|
3
|
+
if CacheDriver.config.store == :file
|
4
|
+
@cli = CacheDriver.config.file_dir
|
5
|
+
elsif CacheDriver.config.store == :redis
|
6
|
+
@cli = Redis.new :host => CacheDriver.config.redis_host, :port => CacheDriver.config.redis_port
|
7
|
+
end
|
8
|
+
end
|
9
|
+
|
10
|
+
def show_models
|
11
|
+
models = []
|
12
|
+
if @cli.class == Pathname
|
13
|
+
@cli.each_child do |file|
|
14
|
+
filename = file.basename.to_s
|
15
|
+
if filename =~ /.+s/i
|
16
|
+
models << filename[0..-2]
|
17
|
+
end
|
18
|
+
end
|
19
|
+
elsif @cli.class == Redis
|
20
|
+
models = @cli.keys.map do |key|
|
21
|
+
key.gsub("#{CacheDriver.config.redis_namespace}:", '').gsub(/#.+/, '')
|
22
|
+
end.uniq
|
23
|
+
end
|
24
|
+
models.sort
|
25
|
+
end
|
26
|
+
|
27
|
+
def show_keys(model)
|
28
|
+
model = "#{model}s"
|
29
|
+
keys = []
|
30
|
+
if @cli.class == Pathname
|
31
|
+
@cli.join(model).each_child do |file|
|
32
|
+
filename = file.basename.to_s
|
33
|
+
if filename =~ /\.cache/i
|
34
|
+
keys << filename.gsub(/\.cache/, '')
|
35
|
+
end
|
36
|
+
end
|
37
|
+
elsif @cli.class == Redis
|
38
|
+
keys = @cli.keys("#{CacheDriver.config.redis_namespace}:#{model}*").map do |key|
|
39
|
+
key.gsub("#{CacheDriver.config.redis_namespace}:", '').gsub(/.+#/, '')
|
40
|
+
end
|
41
|
+
end
|
42
|
+
keys.sort
|
43
|
+
end
|
44
|
+
|
45
|
+
def find(model, key)
|
46
|
+
model = "#{model}s"
|
47
|
+
if @cli.class == Pathname
|
48
|
+
file = @cli.join(model, "#{key}.cache")
|
49
|
+
return nil unless file.exist? && file.file?
|
50
|
+
json = File.read file
|
51
|
+
elsif @cli.class == Redis
|
52
|
+
json = @cli.get("#{CacheDriver.config.redis_namespace}:#{model}##{key}")
|
53
|
+
end
|
54
|
+
|
55
|
+
return nil unless json
|
56
|
+
|
57
|
+
res = json.split ' --> '
|
58
|
+
res[1] = JSON.parse res[1]
|
59
|
+
res
|
60
|
+
end
|
61
|
+
|
62
|
+
def save(model, key, assignments)
|
63
|
+
rec = self.find model, key
|
64
|
+
rec = ['', {}] unless rec
|
65
|
+
rec[0] = Time.now
|
66
|
+
rec[1] = rec[1].merge(assignments).to_json
|
67
|
+
|
68
|
+
model = "#{model}s"
|
69
|
+
if @cli.class == Pathname
|
70
|
+
dir = @cli.join(model)
|
71
|
+
Dir.mkdir dir unless Dir.exist? dir
|
72
|
+
file = File.new dir.join("#{key}.cache"), 'w'
|
73
|
+
file.puts rec.join(' --> ')
|
74
|
+
file.close
|
75
|
+
res = "OK"
|
76
|
+
elsif @cli.class == Redis
|
77
|
+
res = @cli.set "#{CacheDriver.config.redis_namespace}:#{model}##{key}", rec.join(' --> ')
|
78
|
+
end
|
79
|
+
|
80
|
+
res = "OK"
|
81
|
+
end
|
82
|
+
|
83
|
+
def delete(model, key)
|
84
|
+
model = "#{model}s"
|
85
|
+
if @cli.class == Pathname
|
86
|
+
file = @cli.join(model, "#{key}.cache")
|
87
|
+
if file.exist? && file.file?
|
88
|
+
file.delete
|
89
|
+
res = 1
|
90
|
+
else
|
91
|
+
res = 0
|
92
|
+
end
|
93
|
+
elsif @cli.class == Redis
|
94
|
+
res = @cli.del("#{CacheDriver.config.redis_namespace}:#{model}##{key}")
|
95
|
+
end
|
96
|
+
res == 1
|
97
|
+
end
|
98
|
+
|
99
|
+
def clear(model)
|
100
|
+
res = self.show_keys(model).map do |key|
|
101
|
+
[key, self.delete(model, key)]
|
102
|
+
end
|
103
|
+
Hash[res]
|
104
|
+
end
|
105
|
+
end
|
106
|
+
|
107
|
+
|
108
|
+
|
1
109
|
namespace :cache do
|
2
|
-
desc "inspect cache content"
|
110
|
+
desc "inspect cache content with CacheDriver"
|
3
111
|
task :inspect => :environment do
|
112
|
+
quit = /exit/
|
113
|
+
help = /\?/
|
4
114
|
show_models = /show models/i
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
delete = /delete
|
115
|
+
show_keys = /show keys (\S+)/i
|
116
|
+
find = /find (\S+) in (\S+)/i
|
117
|
+
save = /save (\S+) to (\S+) with (.*)/i
|
118
|
+
delete = /delete (\S+) in (\S+)/i
|
119
|
+
clear = /clear (\S+)/i
|
9
120
|
|
121
|
+
prompt = TTY::Prompt.new interrupt: :exit
|
122
|
+
client = CacheDriverClient.new
|
10
123
|
|
11
|
-
|
12
|
-
|
13
|
-
|
124
|
+
unless CacheDriver.configed?
|
125
|
+
prompt.erro "CacheDriver configure not found, setup config in environments first"
|
126
|
+
exit 1
|
127
|
+
end
|
14
128
|
|
15
129
|
while true
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
96
|
-
|
97
|
-
|
98
|
-
|
99
|
-
|
100
|
-
|
101
|
-
|
102
|
-
|
103
|
-
|
104
|
-
|
105
|
-
|
106
|
-
|
107
|
-
|
108
|
-
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
STDOUT.puts "error: unknow command '#{cmd}'"
|
115
|
-
end
|
116
|
-
end
|
130
|
+
begin
|
131
|
+
cmd = prompt.ask "CacheDriver >", active_color: :cyan do |q|
|
132
|
+
q.modify :down, :trim
|
133
|
+
q.convert -> (input) do
|
134
|
+
if input =~ quit
|
135
|
+
{action: :exit}
|
136
|
+
elsif input =~ help
|
137
|
+
{action: :help}
|
138
|
+
elsif input =~ show_models
|
139
|
+
{action: :show_models}
|
140
|
+
elsif input =~ show_keys
|
141
|
+
res = input.match show_keys
|
142
|
+
{action: :show_keys, model: res[1].downcase}
|
143
|
+
elsif input =~ find
|
144
|
+
res = input.match find
|
145
|
+
{action: :find, model: res[1].downcase, key: res[2]}
|
146
|
+
elsif input =~ save
|
147
|
+
res = input.match save
|
148
|
+
assignments = JSON.parse "{#{res[3].gsub("'", "\"").gsub(/([^,=\s]+)\s?=\s?/, '"\1"=').gsub('=', ':')}}"
|
149
|
+
{action: :save, model: res[1].downcase, key: res[2], assignments: assignments}
|
150
|
+
elsif input =~ delete
|
151
|
+
res = input.match delete
|
152
|
+
{action: :delete, model: res[1].downcase, key: res[2]}
|
153
|
+
elsif input =~ clear
|
154
|
+
res = input.match clear
|
155
|
+
{action: :clear, model: res[1].downcase}
|
156
|
+
else
|
157
|
+
{action: :unknown}
|
158
|
+
end
|
159
|
+
end
|
160
|
+
end
|
161
|
+
|
162
|
+
next if cmd.nil?
|
163
|
+
|
164
|
+
case cmd[:action]
|
165
|
+
when :exit
|
166
|
+
prompt.say "Bye!".green.bold
|
167
|
+
exit
|
168
|
+
when :help
|
169
|
+
prompt.say "Commands: \r".on_green.bold
|
170
|
+
prompt.say "'?' | show all commands and descriptions\n"
|
171
|
+
prompt.say "show models | list all models\n"
|
172
|
+
prompt.say "show keys <model> | list all keys of model in cache\n"
|
173
|
+
prompt.say "find <model> in <key> | fetch data of model\n"
|
174
|
+
prompt.say "save <model> to <key> withs <attr1>=<val1>,... | update data of model, create one if not existed\n"
|
175
|
+
prompt.say "delete <model> in <key> | delete data of model\n"
|
176
|
+
prompt.say "clear <model> | delete data of model\n"
|
177
|
+
prompt.say "------------------------------------------------------------------------------------------------\r"
|
178
|
+
when :show_models
|
179
|
+
prompt.say "Models: \r".on_green.bold
|
180
|
+
client.show_models.each do |model|
|
181
|
+
prompt.say model
|
182
|
+
end
|
183
|
+
prompt.say "----------------------------------------------\r"
|
184
|
+
when :show_keys
|
185
|
+
prompt.say "Keys of #{cmd[:model]}: \r".on_green.bold
|
186
|
+
client.show_keys(cmd[:model]).each do |key|
|
187
|
+
prompt.say key
|
188
|
+
end
|
189
|
+
prompt.say "-----------------------------------------------\r"
|
190
|
+
when :find
|
191
|
+
prompt.say "Cache of #{cmd[:model]}##{cmd[:key]}: \r".on_green.bold
|
192
|
+
res = client.find cmd[:model], cmd[:key]
|
193
|
+
if res && res.count >= 2
|
194
|
+
prompt.say "Last Modified Time: #{res[0]}".yellow
|
195
|
+
res[1].each do |key, val|
|
196
|
+
prompt.say "@#{key} => #{val.inspect}"
|
197
|
+
end
|
198
|
+
else
|
199
|
+
prompt.error "no records found"
|
200
|
+
end
|
201
|
+
prompt.say "-----------------------------------------------\r"
|
202
|
+
when :save
|
203
|
+
res = client.save cmd[:model], cmd[:key], cmd[:assignments]
|
204
|
+
if res
|
205
|
+
prompt.ok "save #{cmd[:model]}##{cmd[:key]} successed"
|
206
|
+
else
|
207
|
+
prompt.error "save #{cmd[:model]}##{cmd[:key]} failed"
|
208
|
+
end
|
209
|
+
when :delete
|
210
|
+
res = client.delete cmd[:model], cmd[:key]
|
211
|
+
if res
|
212
|
+
prompt.ok "delete #{cmd[:model]}##{cmd[:key]} successed"
|
213
|
+
else
|
214
|
+
prompt.error "delete #{cmd[:model]}##{cmd[:key]} failed"
|
215
|
+
end
|
216
|
+
when :clear
|
217
|
+
res = client.clear cmd[:model]
|
218
|
+
prompt.say "#{cmd[:model]}#(#{res.map { |k, v| v ? k.green : k.red}.join(',')}) was deleted"
|
219
|
+
else
|
220
|
+
prompt.error "error: unknow command"
|
221
|
+
next
|
222
|
+
end
|
223
|
+
prompt.say "\r"
|
224
|
+
rescue => e
|
225
|
+
prompt.error "error: #{e.message}"
|
226
|
+
end
|
227
|
+
end
|
117
228
|
|
118
229
|
|
119
230
|
end
|
metadata
CHANGED
@@ -1,57 +1,85 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cache_driver
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.9
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goshan
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2019-02-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- - ~>
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
19
|
version: '1.10'
|
20
20
|
type: :development
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- - ~>
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
26
|
version: '1.10'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: rake
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
|
-
- - ~>
|
31
|
+
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
33
|
version: '10.0'
|
34
34
|
type: :development
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
|
-
- - ~>
|
38
|
+
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '10.0'
|
41
41
|
- !ruby/object:Gem::Dependency
|
42
42
|
name: redis
|
43
43
|
requirement: !ruby/object:Gem::Requirement
|
44
44
|
requirements:
|
45
|
-
- - ~>
|
45
|
+
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
47
|
version: '3.3'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
|
-
- - ~>
|
52
|
+
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '3.3'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: tty-prompt
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '0.18'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '0.18'
|
69
|
+
- !ruby/object:Gem::Dependency
|
70
|
+
name: colorize
|
71
|
+
requirement: !ruby/object:Gem::Requirement
|
72
|
+
requirements:
|
73
|
+
- - "~>"
|
74
|
+
- !ruby/object:Gem::Version
|
75
|
+
version: '0.8'
|
76
|
+
type: :runtime
|
77
|
+
prerelease: false
|
78
|
+
version_requirements: !ruby/object:Gem::Requirement
|
79
|
+
requirements:
|
80
|
+
- - "~>"
|
81
|
+
- !ruby/object:Gem::Version
|
82
|
+
version: '0.8'
|
55
83
|
description: make rails model act as ActiveRecord, but not save data into database
|
56
84
|
but cache system, file or redis
|
57
85
|
email:
|
@@ -85,17 +113,17 @@ require_paths:
|
|
85
113
|
- lib
|
86
114
|
required_ruby_version: !ruby/object:Gem::Requirement
|
87
115
|
requirements:
|
88
|
-
- -
|
116
|
+
- - ">="
|
89
117
|
- !ruby/object:Gem::Version
|
90
118
|
version: '0'
|
91
119
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
92
120
|
requirements:
|
93
|
-
- -
|
121
|
+
- - ">="
|
94
122
|
- !ruby/object:Gem::Version
|
95
123
|
version: '0'
|
96
124
|
requirements: []
|
97
125
|
rubyforge_project:
|
98
|
-
rubygems_version: 2.
|
126
|
+
rubygems_version: 2.5.2.3
|
99
127
|
signing_key:
|
100
128
|
specification_version: 4
|
101
129
|
summary: A cache adapter for model accepting file or redis
|