qor_cache 0.0.1 → 0.0.2
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.
- data/Gemfile +3 -3
- data/README.md +5 -0
- data/lib/qor_cache.rb +1 -1
- data/lib/qor_cache/railtie.rb +4 -2
- data/lib/qor_cache/version.rb +1 -1
- data/test/test_helper.rb +2 -0
- metadata +3 -3
data/Gemfile
CHANGED
data/README.md
CHANGED
@@ -1,6 +1,11 @@
|
|
1
1
|
Qor Cache
|
2
2
|
=========
|
3
3
|
|
4
|
+
[][travis]
|
5
|
+
[][codeclimate]
|
6
|
+
[travis]: http://travis-ci.org/qor/qor_cache
|
7
|
+
[codeclimate]: https://codeclimate.com/github/qor/qor_cache
|
8
|
+
|
4
9
|
## Usage
|
5
10
|
|
6
11
|
# config/qor/cache.rb
|
data/lib/qor_cache.rb
CHANGED
@@ -55,7 +55,7 @@ module Qor
|
|
55
55
|
def self.#{method}(*args)
|
56
56
|
_cache_key = Digest::MD5.hexdigest([
|
57
57
|
:#{method},
|
58
|
-
#{node.data}.map {|x| qor_cache_key(x) },
|
58
|
+
#{node.data.inspect}.map {|x| qor_cache_key(x) },
|
59
59
|
cache_key,
|
60
60
|
args.map(&:inspect).join("-")
|
61
61
|
].map(&:to_s).join("-"))
|
data/lib/qor_cache/railtie.rb
CHANGED
@@ -9,8 +9,10 @@ module Qor
|
|
9
9
|
end
|
10
10
|
|
11
11
|
initializer "qor_cache_init_cache_method", :after => "insert_active_record_methods_for_qor_cache" do
|
12
|
-
|
13
|
-
|
12
|
+
ActiveSupport.on_load(:after_initialize) do
|
13
|
+
Qor::Cache::Base.init_cache_methods
|
14
|
+
Qor::Cache::Base.init_cache_class_methods
|
15
|
+
end
|
14
16
|
end
|
15
17
|
end
|
16
18
|
end
|
data/lib/qor_cache/version.rb
CHANGED
data/test/test_helper.rb
CHANGED
@@ -12,6 +12,8 @@ Rails.backtrace_cleaner.remove_silencers!
|
|
12
12
|
# Load support files
|
13
13
|
Dir["#{File.dirname(__FILE__)}/support/**/*.rb"].each { |f| require f }
|
14
14
|
|
15
|
+
ActiveRecord::Migrator.migrate File.expand_path("../dummy/db/migrate/", __FILE__)
|
16
|
+
|
15
17
|
# Load fixtures from the engine
|
16
18
|
if ActiveSupport::TestCase.method_defined?(:fixture_path=)
|
17
19
|
ActiveSupport::TestCase.fixture_path = File.expand_path("../fixtures", __FILE__)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: qor_cache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -9,7 +9,7 @@ authors:
|
|
9
9
|
autorequire:
|
10
10
|
bindir: bin
|
11
11
|
cert_chain: []
|
12
|
-
date: 2012-11-
|
12
|
+
date: 2012-11-27 00:00:00.000000000 Z
|
13
13
|
dependencies:
|
14
14
|
- !ruby/object:Gem::Dependency
|
15
15
|
name: qor_test
|
@@ -163,7 +163,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
163
163
|
version: '0'
|
164
164
|
requirements: []
|
165
165
|
rubyforge_project:
|
166
|
-
rubygems_version: 1.8.
|
166
|
+
rubygems_version: 1.8.24
|
167
167
|
signing_key:
|
168
168
|
specification_version: 3
|
169
169
|
summary: Qor Cache
|