refinerycms-varnish-pages 0.0.2.1 → 0.0.2.2

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile.lock CHANGED
@@ -7,10 +7,10 @@ GEM
7
7
  git (>= 1.2.5)
8
8
  rake
9
9
  klarlack (0.0.6)
10
- rake (0.8.7)
10
+ rake (0.9.2)
11
11
  rcov (0.9.9)
12
- shellac (0.0.1)
13
- klarlack (~> 0.0.6)
12
+ shellac (0.0.2.4)
13
+ bundler (~> 1.0)
14
14
  klarlack (~> 0.0.6)
15
15
  shoulda (2.11.3)
16
16
 
data/Rakefile CHANGED
@@ -42,7 +42,7 @@ end
42
42
 
43
43
  task :default => :test
44
44
 
45
- require 'rake/rdoctask'
45
+ require 'rdoc/task'
46
46
  Rake::RDocTask.new do |rdoc|
47
47
  version = File.exist?('VERSION') ? File.read('VERSION') : ""
48
48
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.0.2
1
+ 0.0.2.2
@@ -5,7 +5,7 @@ module Refinery
5
5
  module VarnishPages
6
6
  class Engine < Rails::Engine
7
7
 
8
- config.before_initialize do
8
+ config.before_initialize do
9
9
  require File.expand_path('../refinerycms_varnish/pages_controller_extension', __FILE__)
10
10
  require File.expand_path('../refinerycms_varnish/page_extension', __FILE__)
11
11
  end
@@ -28,6 +28,11 @@ module RefinerycmsVarnish
28
28
  ActionController::Base.purge "/#{self.slug.name}"
29
29
 
30
30
  end
31
+
32
+ if (path = RefinerySetting.find_or_set(:always_purge_path, '')).size > 0
33
+ ActionController::Base.purge path
34
+ end
35
+
31
36
  end
32
37
 
33
38
  end
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{refinerycms-varnish-pages}
8
- s.version = "0.0.2.1"
8
+ s.version = "0.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 = ["Marian"]
12
- s.date = %q{2011-05-27}
12
+ s.date = %q{2011-06-27}
13
13
  s.description = %q{Makes use of the shellac gem to purge caches on varnish servers of your refinerycms pages on create, update, destroy and reorder}
14
14
  s.email = %q{marian@bitflut.com}
15
15
  s.extra_rdoc_files = [
@@ -27,36 +27,45 @@ Gem::Specification.new do |s|
27
27
  "lib/refinerycms-varnish-pages.rb",
28
28
  "lib/refinerycms_varnish/page_extension.rb",
29
29
  "lib/refinerycms_varnish/pages_controller_extension.rb",
30
- "refinerycms-varnish-pages.gemspec"
30
+ "refinerycms-varnish-pages.gemspec",
31
+ "spec/controllers/admin/pages_controller_spec.rb",
32
+ "spec/sweepers/page_sweeper_spec.rb"
31
33
  ]
32
34
  s.homepage = %q{http://github.com/bitflut/refinerycms-varnish-pages}
33
35
  s.licenses = ["MIT"]
34
36
  s.require_paths = ["lib"]
35
- s.rubygems_version = %q{1.5.2}
37
+ s.rubygems_version = %q{1.6.2}
36
38
  s.summary = %q{Purges refinerycms-pages from varnish}
39
+ s.test_files = [
40
+ "spec/controllers/admin/pages_controller_spec.rb",
41
+ "spec/sweepers/page_sweeper_spec.rb"
42
+ ]
37
43
 
38
44
  if s.respond_to? :specification_version then
39
45
  s.specification_version = 3
40
46
 
41
47
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
42
- s.add_runtime_dependency(%q<shellac>, ["~> 0.0.2"])
43
- s.add_development_dependency(%q<rspec-rails>, ["~> 2.5"])
48
+ s.add_runtime_dependency(%q<shellac>, ["~> 0.0.1"])
49
+ s.add_development_dependency(%q<shoulda>, [">= 0"])
50
+ s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
44
51
  s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
45
52
  s.add_development_dependency(%q<rcov>, [">= 0"])
46
- s.add_runtime_dependency(%q<shellac>, ["~> 0.0.2"])
53
+ s.add_runtime_dependency(%q<shellac>, ["~> 0.0.1"])
47
54
  else
48
- s.add_dependency(%q<shellac>, ["~> 0.0.2"])
49
- s.add_dependency(%q<rspec-rails>, ["~> 2.5"])
55
+ s.add_dependency(%q<shellac>, ["~> 0.0.1"])
56
+ s.add_dependency(%q<shoulda>, [">= 0"])
57
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
50
58
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
51
59
  s.add_dependency(%q<rcov>, [">= 0"])
52
- s.add_dependency(%q<shellac>, ["~> 0.0.2"])
60
+ s.add_dependency(%q<shellac>, ["~> 0.0.1"])
53
61
  end
54
62
  else
55
- s.add_dependency(%q<shellac>, ["~> 0.0.2"])
56
- s.add_dependency(%q<rspec-rails>, ["~> 2.5"])
63
+ s.add_dependency(%q<shellac>, ["~> 0.0.1"])
64
+ s.add_dependency(%q<shoulda>, [">= 0"])
65
+ s.add_dependency(%q<bundler>, ["~> 1.0.0"])
57
66
  s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
58
67
  s.add_dependency(%q<rcov>, [">= 0"])
59
- s.add_dependency(%q<shellac>, ["~> 0.0.2"])
68
+ s.add_dependency(%q<shellac>, ["~> 0.0.1"])
60
69
  end
61
70
  end
62
71
 
@@ -0,0 +1,39 @@
1
+ require 'spec_helper'
2
+
3
+ describe Admin::PagesController, :type => :request do
4
+
5
+ def reset
6
+ @page.destroy! if @page
7
+ @page = Page.create!({
8
+ :title => "RSpec is great for testing too",
9
+ :deletable => true
10
+ })
11
+ end
12
+
13
+ before(:each) do
14
+ reset
15
+ end
16
+
17
+ login_refinery_user
18
+
19
+ it "should be able to access admin area" do
20
+ ActionController::Base.should_receive(:purge).with('/rspec-is-great-for-testing-too')
21
+ get :update, :id => '1'
22
+ end
23
+
24
+ context "with 'always_purge_path' set" do
25
+
26
+ before(:each) do
27
+ RefinerySetting.delete_all
28
+ RefinerySetting.set(:always_purge_path, '/preview')
29
+ end
30
+
31
+ it "should purge page url and always_purge_path" do
32
+ ActionController::Base.should_receive(:purge).with("/rspec-is-great-for-testing-too")
33
+ ActionController::Base.should_receive(:purge).with("/preview")
34
+ get :update, :id => '1'
35
+ end
36
+
37
+ end
38
+
39
+ end
@@ -0,0 +1,51 @@
1
+ require 'spec_helper'
2
+
3
+ describe Page do
4
+
5
+ def reset(options = {})
6
+ @valid_attributes = {
7
+ :id => 1,
8
+ :title => "Page one"
9
+ }
10
+
11
+ @page.destroy! if @page
12
+ @page = Page.create!(@valid_attributes.update(options))
13
+
14
+ RefinerySetting.delete_all
15
+ RefinerySetting.set(:always_purge_path, '')
16
+ end
17
+
18
+ before(:each) do
19
+ reset
20
+ end
21
+
22
+ context "sweeper" do
23
+
24
+ it "should trigger callback for model" do
25
+ @page.should_receive(:purge_page)
26
+ @page.update_attribute(:title, 'Page one still')
27
+ end
28
+
29
+ it "should purge page url" do
30
+ ActionController::Base.should_receive(:purge).once.with("/page-one-still")
31
+ @page.update_attribute(:title, 'Page one still')
32
+ end
33
+
34
+ context "with 'always_purge_path' set" do
35
+
36
+ before(:each) do
37
+ RefinerySetting.delete_all
38
+ RefinerySetting.set(:always_purge_path, '/preview')
39
+ end
40
+
41
+ it "should purge page url and always_purge_path" do
42
+ ActionController::Base.should_receive(:purge).with("/page-one-still")
43
+ ActionController::Base.should_receive(:purge).with("/preview")
44
+ @page.update_attribute(:title, 'Page one still')
45
+ end
46
+
47
+ end
48
+
49
+ end
50
+
51
+ end
metadata CHANGED
@@ -1,83 +1,92 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: refinerycms-varnish-pages
3
- version: !ruby/object:Gem::Version
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.2.2
4
5
  prerelease:
5
- version: 0.0.2.1
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Marian
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
-
13
- date: 2011-05-27 00:00:00 +02:00
12
+ date: 2011-06-27 00:00:00.000000000 +02:00
14
13
  default_executable:
15
- dependencies:
16
- - !ruby/object:Gem::Dependency
14
+ dependencies:
15
+ - !ruby/object:Gem::Dependency
17
16
  name: shellac
18
- requirement: &id001 !ruby/object:Gem::Requirement
17
+ requirement: &2152732620 !ruby/object:Gem::Requirement
19
18
  none: false
20
- requirements:
19
+ requirements:
21
20
  - - ~>
22
- - !ruby/object:Gem::Version
23
- version: 0.0.2
21
+ - !ruby/object:Gem::Version
22
+ version: 0.0.1
24
23
  type: :runtime
25
24
  prerelease: false
26
- version_requirements: *id001
27
- - !ruby/object:Gem::Dependency
28
- name: rspec-rails
29
- requirement: &id002 !ruby/object:Gem::Requirement
25
+ version_requirements: *2152732620
26
+ - !ruby/object:Gem::Dependency
27
+ name: shoulda
28
+ requirement: &2152731800 !ruby/object:Gem::Requirement
30
29
  none: false
31
- requirements:
30
+ requirements:
31
+ - - ! '>='
32
+ - !ruby/object:Gem::Version
33
+ version: '0'
34
+ type: :development
35
+ prerelease: false
36
+ version_requirements: *2152731800
37
+ - !ruby/object:Gem::Dependency
38
+ name: bundler
39
+ requirement: &2152730840 !ruby/object:Gem::Requirement
40
+ none: false
41
+ requirements:
32
42
  - - ~>
33
- - !ruby/object:Gem::Version
34
- version: "2.5"
43
+ - !ruby/object:Gem::Version
44
+ version: 1.0.0
35
45
  type: :development
36
46
  prerelease: false
37
- version_requirements: *id002
38
- - !ruby/object:Gem::Dependency
47
+ version_requirements: *2152730840
48
+ - !ruby/object:Gem::Dependency
39
49
  name: jeweler
40
- requirement: &id003 !ruby/object:Gem::Requirement
50
+ requirement: &2152729940 !ruby/object:Gem::Requirement
41
51
  none: false
42
- requirements:
52
+ requirements:
43
53
  - - ~>
44
- - !ruby/object:Gem::Version
54
+ - !ruby/object:Gem::Version
45
55
  version: 1.5.2
46
56
  type: :development
47
57
  prerelease: false
48
- version_requirements: *id003
49
- - !ruby/object:Gem::Dependency
58
+ version_requirements: *2152729940
59
+ - !ruby/object:Gem::Dependency
50
60
  name: rcov
51
- requirement: &id004 !ruby/object:Gem::Requirement
61
+ requirement: &2152728580 !ruby/object:Gem::Requirement
52
62
  none: false
53
- requirements:
54
- - - ">="
55
- - !ruby/object:Gem::Version
56
- version: "0"
63
+ requirements:
64
+ - - ! '>='
65
+ - !ruby/object:Gem::Version
66
+ version: '0'
57
67
  type: :development
58
68
  prerelease: false
59
- version_requirements: *id004
60
- - !ruby/object:Gem::Dependency
69
+ version_requirements: *2152728580
70
+ - !ruby/object:Gem::Dependency
61
71
  name: shellac
62
- requirement: &id005 !ruby/object:Gem::Requirement
72
+ requirement: &2152727660 !ruby/object:Gem::Requirement
63
73
  none: false
64
- requirements:
74
+ requirements:
65
75
  - - ~>
66
- - !ruby/object:Gem::Version
67
- version: 0.0.2
76
+ - !ruby/object:Gem::Version
77
+ version: 0.0.1
68
78
  type: :runtime
69
79
  prerelease: false
70
- version_requirements: *id005
71
- description: Makes use of the shellac gem to purge caches on varnish servers of your refinerycms pages on create, update, destroy and reorder
80
+ version_requirements: *2152727660
81
+ description: Makes use of the shellac gem to purge caches on varnish servers of your
82
+ refinerycms pages on create, update, destroy and reorder
72
83
  email: marian@bitflut.com
73
84
  executables: []
74
-
75
85
  extensions: []
76
-
77
- extra_rdoc_files:
86
+ extra_rdoc_files:
78
87
  - LICENSE.txt
79
88
  - README.rdoc
80
- files:
89
+ files:
81
90
  - .document
82
91
  - Gemfile
83
92
  - Gemfile.lock
@@ -89,36 +98,37 @@ files:
89
98
  - lib/refinerycms_varnish/page_extension.rb
90
99
  - lib/refinerycms_varnish/pages_controller_extension.rb
91
100
  - refinerycms-varnish-pages.gemspec
101
+ - spec/controllers/admin/pages_controller_spec.rb
102
+ - spec/sweepers/page_sweeper_spec.rb
92
103
  has_rdoc: true
93
104
  homepage: http://github.com/bitflut/refinerycms-varnish-pages
94
- licenses:
105
+ licenses:
95
106
  - MIT
96
107
  post_install_message:
97
108
  rdoc_options: []
98
-
99
- require_paths:
109
+ require_paths:
100
110
  - lib
101
- required_ruby_version: !ruby/object:Gem::Requirement
111
+ required_ruby_version: !ruby/object:Gem::Requirement
102
112
  none: false
103
- requirements:
104
- - - ">="
105
- - !ruby/object:Gem::Version
106
- hash: 2549311379250070320
107
- segments:
113
+ requirements:
114
+ - - ! '>='
115
+ - !ruby/object:Gem::Version
116
+ version: '0'
117
+ segments:
108
118
  - 0
109
- version: "0"
110
- required_rubygems_version: !ruby/object:Gem::Requirement
119
+ hash: 4597464585482214852
120
+ required_rubygems_version: !ruby/object:Gem::Requirement
111
121
  none: false
112
- requirements:
113
- - - ">="
114
- - !ruby/object:Gem::Version
115
- version: "0"
122
+ requirements:
123
+ - - ! '>='
124
+ - !ruby/object:Gem::Version
125
+ version: '0'
116
126
  requirements: []
117
-
118
127
  rubyforge_project:
119
- rubygems_version: 1.5.2
128
+ rubygems_version: 1.6.2
120
129
  signing_key:
121
130
  specification_version: 3
122
131
  summary: Purges refinerycms-pages from varnish
123
- test_files: []
124
-
132
+ test_files:
133
+ - spec/controllers/admin/pages_controller_spec.rb
134
+ - spec/sweepers/page_sweeper_spec.rb