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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 829cd43eff521ca5544bae10210be7891ea5fa7c
4
- data.tar.gz: fc86c370316a288f0046df7a0858e10da2a10187
3
+ metadata.gz: 6f3f643df601890d16e5c1548a91ca05029bbeba
4
+ data.tar.gz: 9d095542cf68507aa194fda41dfd16040679e879
5
5
  SHA512:
6
- metadata.gz: 4217e017330f42414f9199a93abb34effd1c79019d227a9397f6dd74e59a4b108a703bcb0d918d8d9c315978bad6c05a09f1c9f3fd6faab9b660ac7f334b1995
7
- data.tar.gz: 17d0bbcd58b314ec0394e8c45b3c07700fa0978933051df96667fa1c361e2b615e65404cf9fb06b438a7b27bb347842a5f71d72d050804db5e07af60630a96f6
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
- # 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"
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
- # attribute name which is made as key to cache data
46
- def self.key_attr
47
- "attr_name"
48
- end
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 with key
57
+ cache_model = CacheModel.find_by_key key # get instance which has key_attr
58
58
 
59
- cache_model.save! # save this instance to cache
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
- Also you can customize the data which you want to cache.
65
- Just override the two methods below
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 this model instance from a hashmap obj include data you cached
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 > desc <model>
92
- CacheDriver > select from <model> (where id=<id>)
93
- CacheDriver > insert to <model> values {'id' => 1, ...}
94
- CacheDriver > delete from <model> where id=<id>
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
@@ -29,4 +29,6 @@ Gem::Specification.new do |spec|
29
29
  spec.add_development_dependency "rake", "~> 10.0"
30
30
 
31
31
  spec.add_runtime_dependency 'redis', '~> 3.3'
32
+ spec.add_runtime_dependency "tty-prompt", "~> 0.18"
33
+ spec.add_runtime_dependency "colorize", "~> 0.8"
32
34
  end
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
- class Railtie < ::Rails::Railtie
13
- rake_tasks do
14
- load 'tasks/cache.rake'
15
- end
16
- end
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
- CacheDriver.setup do |config|
21
- config.store = :file
22
- end
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=0)
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 save!
12
- CacheRecord.cache_util.write CacheUtil.class_to_type(self.class), self.class.key_attr ? self.send(self.class.key_attr) : 0, self
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 destroy
16
- CacheRecord.cache_util.delete CacheUtil.class_to_type(self.class), self.class.key_attr ? self.send(self.class.key_attr) : 0
22
+ def self.clear
23
+ self.find_all.each(&:destroy)
17
24
  end
18
25
 
19
- def self.key_attr
20
- nil
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
- self
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.new
48
+ ins = self.allocate
29
49
  obj.each do |key, value|
30
- ins.send "#{key}=", value
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
@@ -1,3 +1,3 @@
1
1
  module CacheDriver
2
- VERSION = "0.3.6"
2
+ VERSION = "0.3.9"
3
3
  end
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
- desc_model = /desc (\S+)/i
6
- select = /select from (\S+)( where id\s?=\s?(\d+))?/i
7
- insert = /insert into (\S+) values ({.*})/i
8
- delete = /delete from (\S+) where id\s?=\s?(\d+)/i
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
- # forbidden stdout info in CacheRecord
12
- cache_out = StringIO.new
13
- $stdout = cache_out
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
- $stdout.truncate 0
17
- STDOUT.print "CacheDriver > "
18
- cmd = STDIN.gets
19
- cmd.chomp!
20
-
21
- if cmd == ""
22
- next
23
- elsif cmd == "exit"
24
- break
25
- end
26
-
27
- if cmd =~ show_models
28
- dir = Dir.new File.expand_path("../../../tmp/cache", __FILE__)
29
- STDOUT.puts "-------------------------------"
30
- STDOUT.puts "models: "
31
- STDOUT.puts "-------------------------------"
32
- dir.each do |file|
33
- if file =~ /.+s/i
34
- STDOUT.puts file[0..-2]
35
- end
36
- end
37
- STDOUT.puts "-------------------------------"
38
- STDOUT.puts ""
39
- elsif cmd =~ desc_model
40
- res = cmd.match desc_model
41
- clazz = CacheUtil.type_to_class res[1].downcase.to_sym
42
- ins = clazz.find_all.first
43
- unless ins
44
- STDOUT.puts "error: can not find model #{res[1]}"
45
- next
46
- end
47
- STDOUT.puts "-------------------------------"
48
- STDOUT.puts "attributes: "
49
- STDOUT.puts "-------------------------------"
50
- ins.instance_variables.each do |var|
51
- STDOUT.puts var
52
- end
53
- STDOUT.puts "-------------------------------"
54
- STDOUT.puts ""
55
- elsif cmd =~ select
56
- res = cmd.match select
57
- clazz = CacheUtil.type_to_class res[1].downcase.to_sym
58
- STDOUT.puts "-------------------------------"
59
- STDOUT.puts "#{clazz} records: "
60
- STDOUT.puts "-------------------------------"
61
- if res[2] # where id = x
62
- ins = clazz.find_by_id res[3].to_i
63
- if ins
64
- STDOUT.print "{"
65
- ins.instance_variables.each_with_index do |var, index|
66
- STDOUT.print "#{var} => #{ins.instance_variable_get var}#{index == ins.instance_variables.count ? "" : ", "}"
67
- end
68
- STDOUT.print "}\n"
69
- STDOUT.puts "-------------------------------"
70
- STDOUT.puts "1 records"
71
- else
72
- STDOUT.puts "0 records"
73
- end
74
- else # no where
75
- all_ins = clazz.find_all
76
- all_ins.each do |ins|
77
- STDOUT.print "{"
78
- ins.instance_variables.each_with_index do |var, index|
79
- STDOUT.print "#{var} => #{ins.instance_variable_get var}#{index == ins.instance_variables.count-1 ? "" : ", "}"
80
- end
81
- STDOUT.print "}\n"
82
- end
83
- STDOUT.puts "-------------------------------"
84
- STDOUT.puts "#{all_ins.count} records"
85
- end
86
- STDOUT.puts ""
87
- elsif cmd =~ insert
88
- res = cmd.match insert
89
- clazz = CacheUtil.type_to_class res[1].downcase.to_sym
90
- STDOUT.puts "-------------------------------"
91
- STDOUT.puts "insert #{clazz} record: "
92
- STDOUT.puts "-------------------------------"
93
- ins = clazz.new
94
- res[2].split(',').each do |assign|
95
- ele = assign.match /(\S+)\s?=\s?(\S+)/i
96
- ins.send "#{ele[1]}=", ele[2]
97
- end
98
- ins.save!
99
- STDOUT.puts "inserted record"
100
- STDOUT.puts "-------------------------------"
101
- STDOUT.puts ""
102
- elsif cmd =~ delete
103
- res = cmd.match delete
104
- clazz = CacheUtil.type_to_class res[1].downcase.to_sym
105
- STDOUT.puts "-------------------------------"
106
- STDOUT.puts "delete #{clazz} record: "
107
- STDOUT.puts "-------------------------------"
108
- ins = clazz.find_by_id res[2].to_i
109
- ins.destroy
110
- STDOUT.puts "deleted record"
111
- STDOUT.puts "-------------------------------"
112
- STDOUT.puts ""
113
- else
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.6
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: 2017-12-22 00:00:00.000000000 Z
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.0.14.1
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