supercache 0.1.0 → 0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/controllers/supercache/dashboard_controller.rb +18 -0
- data/app/views/layouts/supercache/application.html.erb +1 -0
- data/app/views/supercache/dashboard/index.html.erb +5 -0
- data/config/routes.rb +9 -0
- data/lib/supercache/engine.rb +5 -0
- data/lib/supercache/super_query_cache.rb +13 -0
- data/lib/supercache/version.rb +1 -1
- data/lib/supercache.rb +3 -1
- data/supercache.gemspec +4 -4
- metadata +8 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 40f7c6b4073a57fe2a01c1f341a542f70991c90b
|
4
|
+
data.tar.gz: bef0b523d04d534f4ddb581d40f984282e93a5df
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f580d3c3a77a7cfc0ee09cfe5e9cc20d9b8f631a4cb55aaa4407a943934a29200cd5fd99ef6654dc00f2f983ae313bf39e2aa4a3c8e92f6a0b29d75df0469652
|
7
|
+
data.tar.gz: 28515ecb1c75581dd0141c2f9148586df203d187fc0292d51321ffdd57aa8ce792a6f66d5200a79d6a7b19995ec51db12c3e97c8089f11b4cbcd818d77303466
|
@@ -0,0 +1,18 @@
|
|
1
|
+
module Supercache
|
2
|
+
class DashboardController < ActionController::Base
|
3
|
+
def flip
|
4
|
+
if cache.read(:supercache)
|
5
|
+
cache.clear #Deliberately Clear all the cache available
|
6
|
+
else
|
7
|
+
cache.write(:supercache, true)
|
8
|
+
end
|
9
|
+
redirect_to :root
|
10
|
+
end
|
11
|
+
|
12
|
+
private
|
13
|
+
|
14
|
+
def cache
|
15
|
+
Rails.cache
|
16
|
+
end
|
17
|
+
end
|
18
|
+
end
|
@@ -0,0 +1 @@
|
|
1
|
+
<%= yield %>
|
data/config/routes.rb
ADDED
@@ -0,0 +1,13 @@
|
|
1
|
+
module SuperQueryCache
|
2
|
+
def cache_sql(sql, binds)
|
3
|
+
if Rails.cache.read(:supercache)
|
4
|
+
Rails.cache.fetch("supercache_#{sql}_#{binds.to_s}".hash) do
|
5
|
+
super(sql, binds)
|
6
|
+
end
|
7
|
+
else
|
8
|
+
super(sql, binds)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
|
13
|
+
ActiveRecord::ConnectionAdapters::AbstractAdapter.prepend(SuperQueryCache)
|
data/lib/supercache/version.rb
CHANGED
data/lib/supercache.rb
CHANGED
data/supercache.gemspec
CHANGED
@@ -6,13 +6,13 @@ require 'supercache/version'
|
|
6
6
|
Gem::Specification.new do |spec|
|
7
7
|
spec.name = "supercache"
|
8
8
|
spec.version = Supercache::VERSION
|
9
|
-
spec.authors = [
|
10
|
-
spec.email = [
|
9
|
+
spec.authors = ['Bragadeesh J']
|
10
|
+
spec.email = ['bragboy@gmail.com']
|
11
11
|
|
12
12
|
spec.summary = %q{Speed up Development time}
|
13
13
|
spec.description = %q{SuperCache speeds up development time by caching recurring requests and lets you concentrate only on the objects you are changing/playing around with in a complete un-obtrusive manner}
|
14
|
-
spec.homepage =
|
15
|
-
spec.license =
|
14
|
+
spec.homepage = 'https://github.com/bragboy/supercache'
|
15
|
+
spec.license = 'MIT'
|
16
16
|
|
17
17
|
spec.files = `git ls-files -z`.split("\x0").reject { |f| f.match(%r{^(test|spec|features)/}) }
|
18
18
|
spec.bindir = "exe"
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: supercache
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Bragadeesh J
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-08-
|
11
|
+
date: 2016-08-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -69,9 +69,15 @@ files:
|
|
69
69
|
- LICENSE.txt
|
70
70
|
- README.md
|
71
71
|
- Rakefile
|
72
|
+
- app/controllers/supercache/dashboard_controller.rb
|
73
|
+
- app/views/layouts/supercache/application.html.erb
|
74
|
+
- app/views/supercache/dashboard/index.html.erb
|
72
75
|
- bin/console
|
73
76
|
- bin/setup
|
77
|
+
- config/routes.rb
|
74
78
|
- lib/supercache.rb
|
79
|
+
- lib/supercache/engine.rb
|
80
|
+
- lib/supercache/super_query_cache.rb
|
75
81
|
- lib/supercache/version.rb
|
76
82
|
- supercache.gemspec
|
77
83
|
homepage: https://github.com/bragboy/supercache
|