pagelime-rails 0.2.1 → 0.2.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.
- checksums.yaml +6 -14
- data/VERSION +1 -1
- data/app/controllers/pagelime_receiver_controller.rb +1 -1
- data/config/routes.rb +8 -5
- data/lib/pagelime-rails.rb +1 -5
- data/lib/pagelime/rails.rb +9 -1
- data/lib/pagelime/rails/controller_extensions.rb +1 -1
- data/lib/pagelime/s3_rails_cache.rb +13 -5
- data/pagelime-rails.gemspec +2 -2
- metadata +10 -10
checksums.yaml
CHANGED
@@ -1,15 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
|
8
|
-
metadata.gz: !binary |-
|
9
|
-
MTRlNGQ0ODdjMjcxNTJmODRkNmUxYjFhN2VmZDhkY2Q3MGYxNjk2YjVhYzMy
|
10
|
-
NWUxYzIzMDNkMGEwNjAzOGVmOTg1YTViYzliZjIzNDg0NThmNWJhYTFlNGI1
|
11
|
-
MTU0MzBkMjZkMmE3YWI5MGJhZWNiZGM3MGMxNDc4YzAyMmQwN2M=
|
12
|
-
data.tar.gz: !binary |-
|
13
|
-
YTQ1ZGFlZGE2NTBhNzFhYTg4NWQ3YzQ4ODA1YTBlMGQ0NjRhNWJmNzczMjdi
|
14
|
-
OGUyZWNmYmFmOTdhZjM0YjRjZDU3NTQwY2ZhNWRlYzlhMTFkMTZmZGFjNjlm
|
15
|
-
NjEwNGI4NWFkZDkwZDExYTdhMWE0MWI4NGIzZjk5ZGE3MjEwNDY=
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: b6a600b851478397833e645e4a5861d381fe1e02
|
4
|
+
data.tar.gz: 26992234cd2cd7b30471b1f3cadec3a9267e90b8
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 1ad60030c4d9c480bc1ce274464336b9613c455339b4c0b76849a2a82cf2cdb82a586574a3c30449bf26251a5b5a1abad8f7c0587872b433268b85cf0b4fb1e2
|
7
|
+
data.tar.gz: ebd6d0d5138e8b5fc23892572a2c964c4ebb5061e7e41703ac1907e084caecc125ce475bb4665686e9b16c3b3124d4ed5951afb043adaa370fba4c1ff171501a
|
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.2.
|
1
|
+
0.2.2
|
@@ -7,7 +7,7 @@ class PagelimeReceiverController < ApplicationController
|
|
7
7
|
def after_publish_callback
|
8
8
|
|
9
9
|
Pagelime.client.clear params[:path]
|
10
|
-
Pagelime.
|
10
|
+
Pagelime.client.clear_shared
|
11
11
|
|
12
12
|
# don't do the prefetch below, as the page isn't done publishing (mySQL transaction hasn't completed) at the point when this gets called
|
13
13
|
=begin
|
data/config/routes.rb
CHANGED
@@ -2,27 +2,30 @@
|
|
2
2
|
if Rails::VERSION::MAJOR == 2
|
3
3
|
|
4
4
|
ActionController::Routing::Routes.draw do |map|
|
5
|
-
|
5
|
+
Rails.logger.debug "PAGELIME CMS RAILS PLUGIN: setting up rails 2 routes"
|
6
|
+
|
6
7
|
map.connect "pagelime/:action", :controller => :pagelime_receiver_controller
|
7
8
|
end
|
8
9
|
|
9
10
|
elsif Rails::VERSION::MAJOR == 3 && Rails::VERSION::MINOR == 0
|
10
11
|
|
11
|
-
puts "PAGELIME CMS PLUGIN: setting up rails 3 routes"
|
12
|
-
|
13
12
|
Rails.application.routes.draw do
|
13
|
+
Rails.logger.debug "PAGELIME CMS RAILS PLUGIN: setting up rails 3 routes"
|
14
|
+
|
14
15
|
match 'pagelime/:action' => 'pagelime_receiver'
|
15
16
|
end
|
16
17
|
|
17
18
|
elsif Rails::VERSION::MAJOR >= 3
|
18
19
|
|
19
|
-
puts "PAGELIME CMS PLUGIN: setting up rails 3.1 routes"
|
20
|
-
|
21
20
|
Pagelime::Rails::Engine.routes.draw do
|
21
|
+
Rails.logger.debug "PAGELIME CMS RAILS PLUGIN: setting up rails 3.1+ routes"
|
22
|
+
|
22
23
|
get 'pagelime/:action' => 'pagelime_receiver'
|
23
24
|
end
|
24
25
|
|
25
26
|
Rails.application.routes.draw do
|
27
|
+
Rails.logger.debug "PAGELIME CMS RAILS PLUGIN: mounting Pagelime in rails 3.1+ routes"
|
28
|
+
|
26
29
|
mount Pagelime::Rails::Engine => "/"
|
27
30
|
end
|
28
31
|
|
data/lib/pagelime-rails.rb
CHANGED
@@ -3,11 +3,7 @@ require 'pagelime'
|
|
3
3
|
require 'pagelime/rails'
|
4
4
|
require 'pagelime/s3_rails_cache'
|
5
5
|
|
6
|
-
|
7
|
-
|
8
|
-
Pagelime.configure do |config|
|
9
|
-
config.client_class = Pagelime::S3RailsCache
|
10
|
-
end
|
6
|
+
Pagelime.logger.debug "PAGELIME CMS RAILS PLUGIN: pagelime-rails gem loaded"
|
11
7
|
|
12
8
|
# start plugin
|
13
9
|
if Rails::VERSION::MAJOR == 2
|
data/lib/pagelime/rails.rb
CHANGED
@@ -3,7 +3,7 @@ module Pagelime
|
|
3
3
|
module ClassMethods
|
4
4
|
def initialize!
|
5
5
|
|
6
|
-
|
6
|
+
::Rails.logger.debug "PAGELIME CMS RAILS PLUGIN: initializing plugin"
|
7
7
|
|
8
8
|
app_path_relative = File.join('..', '..', 'app')
|
9
9
|
app_path = File.expand_path File.join(File.dirname(__FILE__), app_path_relative)
|
@@ -30,6 +30,14 @@ module Pagelime
|
|
30
30
|
require_relative File.join('.', app_path_relative, "helpers", "pagelime_helper")
|
31
31
|
ActionView::Base.send :include, PagelimeHelper
|
32
32
|
|
33
|
+
configure_pagelime!
|
34
|
+
end
|
35
|
+
|
36
|
+
def configure_pagelime!
|
37
|
+
::Pagelime.configure do |config|
|
38
|
+
config.client_class = ::Pagelime::S3RailsCache
|
39
|
+
config.logger = ::Rails.logger
|
40
|
+
end
|
33
41
|
end
|
34
42
|
end
|
35
43
|
|
@@ -9,7 +9,7 @@ module Pagelime
|
|
9
9
|
|
10
10
|
module InstanceMethods
|
11
11
|
def cms_process_rendered_body
|
12
|
-
|
12
|
+
::Rails.logger.debug "PAGELIME CMS RAILS PLUGIN: Processing response body in controller"
|
13
13
|
|
14
14
|
# parse response body, cache, and use result as response body
|
15
15
|
response.body = Pagelime.processor.process_document(response.body, request.path)
|
@@ -15,31 +15,39 @@ module Pagelime
|
|
15
15
|
def fetch(page_path, format = self.class.default_format)
|
16
16
|
cache_key = self.class.generate_cache_key(page_path, format)
|
17
17
|
|
18
|
-
::Rails.cache.fetch(cache_key, :expires_in => 1.year) do
|
18
|
+
value = ::Rails.cache.fetch(cache_key, :expires_in => 1.year) do
|
19
19
|
Pagelime.logger.debug "PAGELIME CMS RAILS PLUGIN: NO '#{page_path}' CACHE... loading #{format}"
|
20
20
|
super
|
21
21
|
end
|
22
|
+
|
23
|
+
Pagelime.logger.debug "PAGELIME CMS RAILS PLUGIN: fetch (#{page_path}) value: #{value.inspect}"
|
24
|
+
|
25
|
+
value
|
22
26
|
end
|
23
27
|
|
24
28
|
def fetch_shared(format = self.class.default_format)
|
25
29
|
cache_key = self.class.shared_cache_key(format)
|
26
30
|
|
27
|
-
::Rails.cache.fetch(cache_key, :expires_in => 1.year) do
|
31
|
+
value = ::Rails.cache.fetch(cache_key, :expires_in => 1.year) do
|
28
32
|
Pagelime.logger.debug "PAGELIME CMS RAILS PLUGIN: NO SHARED CACHE... loading #{format}"
|
29
33
|
super
|
30
34
|
end
|
35
|
+
|
36
|
+
Pagelime.logger.debug "PAGELIME CMS RAILS PLUGIN: fetch_shared value: #{value.inspect}"
|
37
|
+
|
38
|
+
value
|
31
39
|
end
|
32
40
|
|
33
41
|
def clear(page_path, format = self.class.default_format)
|
34
42
|
cache_key = self.class.generate_cache_key(page_path, format)
|
35
43
|
|
36
|
-
Rails.cache.delete cache_key
|
44
|
+
::Rails.cache.delete cache_key
|
37
45
|
end
|
38
46
|
|
39
|
-
def clear_shared(
|
47
|
+
def clear_shared(format = self.class.default_format)
|
40
48
|
cache_key = self.class.shared_cache_key(format)
|
41
49
|
|
42
|
-
Rails.cache.delete cache_key
|
50
|
+
::Rails.cache.delete cache_key
|
43
51
|
end
|
44
52
|
end
|
45
53
|
end
|
data/pagelime-rails.gemspec
CHANGED
@@ -5,7 +5,7 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = "pagelime-rails"
|
8
|
-
s.version = "0.2.
|
8
|
+
s.version = "0.2.2"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Emil Anticevic", "Joel Van Horn"]
|
@@ -40,7 +40,7 @@ Gem::Specification.new do |s|
|
|
40
40
|
s.homepage = "http://github.com/eanticev/pagelime_rails"
|
41
41
|
s.licenses = ["MIT"]
|
42
42
|
s.require_paths = ["lib"]
|
43
|
-
s.rubygems_version = "2.0.
|
43
|
+
s.rubygems_version = "2.0.6"
|
44
44
|
s.summary = "Pagelime Rails Plugin"
|
45
45
|
|
46
46
|
if s.respond_to? :specification_version then
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pagelime-rails
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Emil Anticevic
|
@@ -15,42 +15,42 @@ dependencies:
|
|
15
15
|
name: pagelime-rack
|
16
16
|
requirement: !ruby/object:Gem::Requirement
|
17
17
|
requirements:
|
18
|
-
- -
|
18
|
+
- - '>='
|
19
19
|
- !ruby/object:Gem::Version
|
20
20
|
version: 0.2.0
|
21
21
|
type: :runtime
|
22
22
|
prerelease: false
|
23
23
|
version_requirements: !ruby/object:Gem::Requirement
|
24
24
|
requirements:
|
25
|
-
- -
|
25
|
+
- - '>='
|
26
26
|
- !ruby/object:Gem::Version
|
27
27
|
version: 0.2.0
|
28
28
|
- !ruby/object:Gem::Dependency
|
29
29
|
name: bundler
|
30
30
|
requirement: !ruby/object:Gem::Requirement
|
31
31
|
requirements:
|
32
|
-
- -
|
32
|
+
- - '>='
|
33
33
|
- !ruby/object:Gem::Version
|
34
34
|
version: 1.0.0
|
35
35
|
type: :development
|
36
36
|
prerelease: false
|
37
37
|
version_requirements: !ruby/object:Gem::Requirement
|
38
38
|
requirements:
|
39
|
-
- -
|
39
|
+
- - '>='
|
40
40
|
- !ruby/object:Gem::Version
|
41
41
|
version: 1.0.0
|
42
42
|
- !ruby/object:Gem::Dependency
|
43
43
|
name: jeweler
|
44
44
|
requirement: !ruby/object:Gem::Requirement
|
45
45
|
requirements:
|
46
|
-
- -
|
46
|
+
- - '>='
|
47
47
|
- !ruby/object:Gem::Version
|
48
48
|
version: 1.6.4
|
49
49
|
type: :development
|
50
50
|
prerelease: false
|
51
51
|
version_requirements: !ruby/object:Gem::Requirement
|
52
52
|
requirements:
|
53
|
-
- -
|
53
|
+
- - '>='
|
54
54
|
- !ruby/object:Gem::Version
|
55
55
|
version: 1.6.4
|
56
56
|
description: ''
|
@@ -92,17 +92,17 @@ require_paths:
|
|
92
92
|
- lib
|
93
93
|
required_ruby_version: !ruby/object:Gem::Requirement
|
94
94
|
requirements:
|
95
|
-
- -
|
95
|
+
- - '>='
|
96
96
|
- !ruby/object:Gem::Version
|
97
97
|
version: '0'
|
98
98
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
99
99
|
requirements:
|
100
|
-
- -
|
100
|
+
- - '>='
|
101
101
|
- !ruby/object:Gem::Version
|
102
102
|
version: '0'
|
103
103
|
requirements: []
|
104
104
|
rubyforge_project:
|
105
|
-
rubygems_version: 2.0.
|
105
|
+
rubygems_version: 2.0.6
|
106
106
|
signing_key:
|
107
107
|
specification_version: 4
|
108
108
|
summary: Pagelime Rails Plugin
|