rails-cache_control 0.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 872663c0fc17161f2f2fa878cc9653dad67d652f
4
+ data.tar.gz: 0acae56cb3faddf8f5391ceb82e4a3b9b5144192
5
+ SHA512:
6
+ metadata.gz: 79b0b7eb52498ef1f501fc7fb7e25dffbc1f218be290650f482f591c855435cf54e3f48f80de7c416178350610e99a8897e8ac4dae45e2ef4fcdabc9d8d329ef
7
+ data.tar.gz: bfaddd521286f69108cfce715e86ce17c082f27e7edbec919d9dc73c98fda23ecb2c55c72f22d78543bc96ca5c0e8f15e86fb7fdc59fbf6eee97377e65deaa67
data/LICENSE ADDED
@@ -0,0 +1,23 @@
1
+ LICENSE
2
+
3
+ The MIT License
4
+
5
+ Copyright (c) 2014 Jianqiu Xiao
6
+
7
+ Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ of this software and associated documentation files (the "Software"), to deal
9
+ in the Software without restriction, including without limitation the rights
10
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
11
+ copies of the Software, and to permit persons to whom the Software is
12
+ furnished to do so, subject to the following conditions:
13
+
14
+ The above copyright notice and this permission notice shall be included in
15
+ all copies or substantial portions of the Software.
16
+
17
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
20
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
22
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
23
+ THE SOFTWARE.
data/README.md ADDED
@@ -0,0 +1,32 @@
1
+ rails-cache_control
2
+ ===================
3
+
4
+ [![Build Status](https://secure.travis-ci.org/swordray/rails-cache_control.png?branch=master)](http://travis-ci.org/thoughtbot/paperclip) [![Dependency Status](https://gemnasium.com/swordray/rails-cache_control.png?travis)](https://gemnasium.com/thoughtbot/paperclip) [![Code Climate](https://codeclimate.com/github/swordray/rails-cache_control.png)](https://codeclimate.com/github/thoughtbot/paperclip)
5
+
6
+ Automatically set Cache-control header when [caches_action expires_in](https://github.com/rails/actionpack-action_caching) specified.
7
+
8
+ Requirements
9
+ ============
10
+
11
+ Ruby >= 2.0.0
12
+ Rails >= 4.0.0
13
+
14
+ Installation
15
+ ============
16
+
17
+ Include the gem in your Gemfile:
18
+
19
+ ```ruby
20
+ gem 'rails-cache_control'
21
+
22
+ Usage
23
+ =====
24
+
25
+ Do nothing.
26
+
27
+ License
28
+ =======
29
+
30
+ Copyright © 2014 swordray@gmail.com under [The MIT License](http://opensource.org/licenses/MIT).
31
+
32
+ Special thanks to http://www.shuhai.org/ team.
@@ -0,0 +1,14 @@
1
+ module ActionController
2
+ module Caching
3
+ module Actions
4
+ class ActionCacheFilter
5
+ def around_with_expires_in(controller, &block)
6
+ expires_in = @store_options[:expires_in]
7
+ controller.expires_in(expires_in, @store_options) if expires_in
8
+ around_without_expires_in(controller, &block)
9
+ end
10
+ alias_method_chain :around, :expires_in
11
+ end
12
+ end
13
+ end
14
+ end
@@ -0,0 +1,3 @@
1
+ module RailsCacheControl
2
+ VERSION = '0.0.1'
3
+ end
@@ -0,0 +1,5 @@
1
+ require 'active_support'
2
+ require 'active_support/core_ext/module/aliasing'
3
+ # require 'actionpack-action_caching'
4
+ require 'action_controller/caching/actions'
5
+ require 'rails-cache_control/action_controller/caching/actions'
@@ -0,0 +1,30 @@
1
+ $LOAD_PATH.push File.expand_path("../lib", __FILE__)
2
+ require 'rails-cache_control/version'
3
+ # require 'rails-cache_control'
4
+
5
+ Gem::Specification.new do |s|
6
+ s.name = "rails-cache_control"
7
+ s.version = RailsCacheControl::VERSION
8
+ s.platform = Gem::Platform::RUBY
9
+ s.author = "Jianqiu Xiao"
10
+ s.email = ["swordray@gmail.com"]
11
+ s.homepage = "https://github.com/swordray/rails-cache-control"
12
+ s.summary = "Automatically set Cache-control header when caches_action expires_in specified"
13
+ s.description = "Thanks to ihaveu.com team"
14
+ s.license = "MIT"
15
+
16
+ # s.rubyforge_project = ""
17
+
18
+ s.files = `git ls-files`.split("\n")
19
+ s.test_files = `git ls-files -- {test,spec,features}/*`.split("\n")
20
+ s.executables = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
21
+ s.require_paths = ["lib"]
22
+
23
+ # s.requirements << ""
24
+ s.required_ruby_version = ">= 2.0.0"
25
+
26
+ s.add_dependency 'rails', '~> 4.0'
27
+ s.add_dependency 'actionpack-action_caching', '~> 1.1'
28
+
29
+ # s.add_development_dependency('', '')
30
+ end
metadata ADDED
@@ -0,0 +1,78 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: rails-cache_control
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Jianqiu Xiao
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2014-02-25 00:00:00.000000000 Z
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: rails
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - "~>"
18
+ - !ruby/object:Gem::Version
19
+ version: '4.0'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '4.0'
27
+ - !ruby/object:Gem::Dependency
28
+ name: actionpack-action_caching
29
+ requirement: !ruby/object:Gem::Requirement
30
+ requirements:
31
+ - - "~>"
32
+ - !ruby/object:Gem::Version
33
+ version: '1.1'
34
+ type: :runtime
35
+ prerelease: false
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.1'
41
+ description: Thanks to ihaveu.com team
42
+ email:
43
+ - swordray@gmail.com
44
+ executables: []
45
+ extensions: []
46
+ extra_rdoc_files: []
47
+ files:
48
+ - LICENSE
49
+ - README.md
50
+ - lib/rails-cache_control.rb
51
+ - lib/rails-cache_control/action_controller/caching/actions.rb
52
+ - lib/rails-cache_control/version.rb
53
+ - rails-cache_control.gemspec
54
+ homepage: https://github.com/swordray/rails-cache-control
55
+ licenses:
56
+ - MIT
57
+ metadata: {}
58
+ post_install_message:
59
+ rdoc_options: []
60
+ require_paths:
61
+ - lib
62
+ required_ruby_version: !ruby/object:Gem::Requirement
63
+ requirements:
64
+ - - ">="
65
+ - !ruby/object:Gem::Version
66
+ version: 2.0.0
67
+ required_rubygems_version: !ruby/object:Gem::Requirement
68
+ requirements:
69
+ - - ">="
70
+ - !ruby/object:Gem::Version
71
+ version: '0'
72
+ requirements: []
73
+ rubyforge_project:
74
+ rubygems_version: 2.2.0
75
+ signing_key:
76
+ specification_version: 4
77
+ summary: Automatically set Cache-control header when caches_action expires_in specified
78
+ test_files: []