lacquer 0.5.0.beta4 → 0.5.1

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile CHANGED
@@ -1,6 +1,6 @@
1
1
  source 'http://rubygems.org'
2
2
 
3
- gem "activesupport", "~> 3.0"
3
+ gem "activesupport", ">= 2.3"
4
4
  gem "i18n", "~> 0.4"
5
5
  gem "jeweler"
6
6
  gem "rake"
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.5.0.beta4
1
+ 0.5.1
data/lacquer.gemspec CHANGED
@@ -4,14 +4,14 @@
4
4
  # -*- encoding: utf-8 -*-
5
5
 
6
6
  Gem::Specification.new do |s|
7
- s.name = %q{lacquer}
8
- s.version = "0.5.0.beta4"
7
+ s.name = "lacquer"
8
+ s.version = "0.5.1"
9
9
 
10
- s.required_rubygems_version = Gem::Requirement.new("> 1.3.1") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Russ Smith (russ@bashme.org)", "Ryan Johns", "Garry Tan (garry@posterous.com), Gabe da Silveira (gabe@websaviour.com)", "Håkon Lerring"]
12
- s.date = %q{2011-06-01}
13
- s.description = %q{Rails drop in for Varnish support.}
14
- s.email = %q{russ@bashme.org}
10
+ s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
+ s.authors = ["Russ Smith (russ@bashme.org)", "Ryan Johns", "Garry Tan (garry@posterous.com), Gabe da Silveira (gabe@websaviour.com)", "H\u{e5}kon Lerring"]
12
+ s.date = "2011-12-01"
13
+ s.description = "Rails drop in for Varnish support."
14
+ s.email = "russ@bashme.org"
15
15
  s.extra_rdoc_files = [
16
16
  "LICENSE",
17
17
  "README.rdoc"
@@ -57,10 +57,10 @@ Gem::Specification.new do |s|
57
57
  "spec/spec_helper.rb",
58
58
  "tasks/lacquer.rake"
59
59
  ]
60
- s.homepage = %q{http://github.com/russ/lacquer}
60
+ s.homepage = "http://github.com/russ/lacquer"
61
61
  s.require_paths = ["lib"]
62
- s.rubygems_version = %q{1.6.2}
63
- s.summary = %q{Rails drop in for Varnish support.}
62
+ s.rubygems_version = "1.8.10"
63
+ s.summary = "Rails drop in for Varnish support."
64
64
  s.test_files = [
65
65
  "spec/lacquer/cache_control_spec.rb",
66
66
  "spec/lacquer/cache_utils_spec.rb",
@@ -75,14 +75,14 @@ Gem::Specification.new do |s|
75
75
  s.specification_version = 3
76
76
 
77
77
  if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
78
- s.add_runtime_dependency(%q<activesupport>, ["~> 3.0"])
78
+ s.add_runtime_dependency(%q<activesupport>, [">= 2.3"])
79
79
  s.add_runtime_dependency(%q<i18n>, ["~> 0.4"])
80
80
  s.add_runtime_dependency(%q<jeweler>, [">= 0"])
81
81
  s.add_runtime_dependency(%q<rake>, [">= 0"])
82
82
  s.add_runtime_dependency(%q<yard>, [">= 0"])
83
83
  s.add_runtime_dependency(%q<erubis>, [">= 0"])
84
84
  else
85
- s.add_dependency(%q<activesupport>, ["~> 3.0"])
85
+ s.add_dependency(%q<activesupport>, [">= 2.3"])
86
86
  s.add_dependency(%q<i18n>, ["~> 0.4"])
87
87
  s.add_dependency(%q<jeweler>, [">= 0"])
88
88
  s.add_dependency(%q<rake>, [">= 0"])
@@ -90,7 +90,7 @@ Gem::Specification.new do |s|
90
90
  s.add_dependency(%q<erubis>, [">= 0"])
91
91
  end
92
92
  else
93
- s.add_dependency(%q<activesupport>, ["~> 3.0"])
93
+ s.add_dependency(%q<activesupport>, [">= 2.3"])
94
94
  s.add_dependency(%q<i18n>, ["~> 0.4"])
95
95
  s.add_dependency(%q<jeweler>, [">= 0"])
96
96
  s.add_dependency(%q<rake>, [">= 0"])
@@ -37,7 +37,7 @@ module Lacquer
37
37
 
38
38
  def to_vcl_override_ttl_urls
39
39
  urls_grouped_by_expires.map do |expires_in, list|
40
- <<-CODE.strip_heredoc
40
+ <<-CODE.gsub(/^[ \t]{4}*/, '')
41
41
  if(#{to_vcl_conditions(list)}) {
42
42
  unset beresp.http.Set-Cookie;
43
43
  set beresp.ttl = #{expires_in};
@@ -48,7 +48,7 @@ module Lacquer
48
48
  end
49
49
 
50
50
  def to_vcl_pass_urls
51
- <<-CODE.strip_heredoc
51
+ <<-CODE.gsub(/^[ \t]{4}*/, '')
52
52
  if(#{to_vcl_conditions(urls_by(:pass))}) {
53
53
  return(pass);
54
54
  }
@@ -56,7 +56,7 @@ module Lacquer
56
56
  end
57
57
 
58
58
  def to_vcl_pipe_urls
59
- <<-CODE.strip_heredoc
59
+ <<-CODE.gsub(/^[ \t]{4}*/, '')
60
60
  if(#{to_vcl_conditions(urls_by(:pipe))}) {
61
61
  return(pipe);
62
62
  }
@@ -20,6 +20,9 @@ module Lacquer
20
20
  # Error handler
21
21
  attr_accessor :command_error_handler
22
22
 
23
+ # Purge Command
24
+ attr_accessor :purge_command
25
+
23
26
  def initialize
24
27
  @enable_cache = true
25
28
  @varnish_servers = []
@@ -27,6 +30,7 @@ module Lacquer
27
30
  @job_backend = :none
28
31
  @retries = 5
29
32
  @command_error_handler = nil
33
+ @purge_command = "url.purge"
30
34
  end
31
35
 
32
36
  # Returns a hash of all configurable options
@@ -14,7 +14,7 @@ module Lacquer
14
14
  # Sends the command 'url.purge *path*'
15
15
  def purge(*paths)
16
16
  paths.all? do |path|
17
- send_command('url.purge ' << path.gsub('\\', '\\\\\\')).all? do |result|
17
+ send_command(Lacquer.configuration.purge_command + " " + << path.gsub('\\', '\\\\\\')).all? do |result|
18
18
  result =~ /200/
19
19
  end
20
20
  end
metadata CHANGED
@@ -1,97 +1,93 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: lacquer
3
- version: !ruby/object:Gem::Version
4
- prerelease: 6
5
- version: 0.5.0.beta4
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.5.1
5
+ prerelease:
6
6
  platform: ruby
7
- authors:
7
+ authors:
8
8
  - Russ Smith (russ@bashme.org)
9
9
  - Ryan Johns
10
10
  - Garry Tan (garry@posterous.com), Gabe da Silveira (gabe@websaviour.com)
11
- - "H\xC3\xA5kon Lerring"
11
+ - Håkon Lerring
12
12
  autorequire:
13
13
  bindir: bin
14
14
  cert_chain: []
15
-
16
- date: 2011-06-01 00:00:00 -07:00
17
- default_executable:
18
- dependencies:
19
- - !ruby/object:Gem::Dependency
15
+ date: 2011-12-01 00:00:00.000000000 Z
16
+ dependencies:
17
+ - !ruby/object:Gem::Dependency
20
18
  name: activesupport
21
- requirement: &id001 !ruby/object:Gem::Requirement
19
+ requirement: &70292607203680 !ruby/object:Gem::Requirement
22
20
  none: false
23
- requirements:
24
- - - ~>
25
- - !ruby/object:Gem::Version
26
- version: "3.0"
21
+ requirements:
22
+ - - ! '>='
23
+ - !ruby/object:Gem::Version
24
+ version: '2.3'
27
25
  type: :runtime
28
26
  prerelease: false
29
- version_requirements: *id001
30
- - !ruby/object:Gem::Dependency
27
+ version_requirements: *70292607203680
28
+ - !ruby/object:Gem::Dependency
31
29
  name: i18n
32
- requirement: &id002 !ruby/object:Gem::Requirement
30
+ requirement: &70292607202560 !ruby/object:Gem::Requirement
33
31
  none: false
34
- requirements:
32
+ requirements:
35
33
  - - ~>
36
- - !ruby/object:Gem::Version
37
- version: "0.4"
34
+ - !ruby/object:Gem::Version
35
+ version: '0.4'
38
36
  type: :runtime
39
37
  prerelease: false
40
- version_requirements: *id002
41
- - !ruby/object:Gem::Dependency
38
+ version_requirements: *70292607202560
39
+ - !ruby/object:Gem::Dependency
42
40
  name: jeweler
43
- requirement: &id003 !ruby/object:Gem::Requirement
41
+ requirement: &70292607271120 !ruby/object:Gem::Requirement
44
42
  none: false
45
- requirements:
46
- - - ">="
47
- - !ruby/object:Gem::Version
48
- version: "0"
43
+ requirements:
44
+ - - ! '>='
45
+ - !ruby/object:Gem::Version
46
+ version: '0'
49
47
  type: :runtime
50
48
  prerelease: false
51
- version_requirements: *id003
52
- - !ruby/object:Gem::Dependency
49
+ version_requirements: *70292607271120
50
+ - !ruby/object:Gem::Dependency
53
51
  name: rake
54
- requirement: &id004 !ruby/object:Gem::Requirement
52
+ requirement: &70292607270560 !ruby/object:Gem::Requirement
55
53
  none: false
56
- requirements:
57
- - - ">="
58
- - !ruby/object:Gem::Version
59
- version: "0"
54
+ requirements:
55
+ - - ! '>='
56
+ - !ruby/object:Gem::Version
57
+ version: '0'
60
58
  type: :runtime
61
59
  prerelease: false
62
- version_requirements: *id004
63
- - !ruby/object:Gem::Dependency
60
+ version_requirements: *70292607270560
61
+ - !ruby/object:Gem::Dependency
64
62
  name: yard
65
- requirement: &id005 !ruby/object:Gem::Requirement
63
+ requirement: &70292607269820 !ruby/object:Gem::Requirement
66
64
  none: false
67
- requirements:
68
- - - ">="
69
- - !ruby/object:Gem::Version
70
- version: "0"
65
+ requirements:
66
+ - - ! '>='
67
+ - !ruby/object:Gem::Version
68
+ version: '0'
71
69
  type: :runtime
72
70
  prerelease: false
73
- version_requirements: *id005
74
- - !ruby/object:Gem::Dependency
71
+ version_requirements: *70292607269820
72
+ - !ruby/object:Gem::Dependency
75
73
  name: erubis
76
- requirement: &id006 !ruby/object:Gem::Requirement
74
+ requirement: &70292607269300 !ruby/object:Gem::Requirement
77
75
  none: false
78
- requirements:
79
- - - ">="
80
- - !ruby/object:Gem::Version
81
- version: "0"
76
+ requirements:
77
+ - - ! '>='
78
+ - !ruby/object:Gem::Version
79
+ version: '0'
82
80
  type: :runtime
83
81
  prerelease: false
84
- version_requirements: *id006
82
+ version_requirements: *70292607269300
85
83
  description: Rails drop in for Varnish support.
86
84
  email: russ@bashme.org
87
85
  executables: []
88
-
89
86
  extensions: []
90
-
91
- extra_rdoc_files:
87
+ extra_rdoc_files:
92
88
  - LICENSE
93
89
  - README.rdoc
94
- files:
90
+ files:
95
91
  - .bundle/config
96
92
  - .document
97
93
  - Gemfile
@@ -131,38 +127,34 @@ files:
131
127
  - spec/lacquer/varnishd_spec.rb
132
128
  - spec/spec_helper.rb
133
129
  - tasks/lacquer.rake
134
- has_rdoc: true
135
130
  homepage: http://github.com/russ/lacquer
136
131
  licenses: []
137
-
138
132
  post_install_message:
139
133
  rdoc_options: []
140
-
141
- require_paths:
134
+ require_paths:
142
135
  - lib
143
- required_ruby_version: !ruby/object:Gem::Requirement
136
+ required_ruby_version: !ruby/object:Gem::Requirement
144
137
  none: false
145
- requirements:
146
- - - ">="
147
- - !ruby/object:Gem::Version
148
- hash: -447822799593533696
149
- segments:
138
+ requirements:
139
+ - - ! '>='
140
+ - !ruby/object:Gem::Version
141
+ version: '0'
142
+ segments:
150
143
  - 0
151
- version: "0"
152
- required_rubygems_version: !ruby/object:Gem::Requirement
144
+ hash: -2845705992647388617
145
+ required_rubygems_version: !ruby/object:Gem::Requirement
153
146
  none: false
154
- requirements:
155
- - - ">"
156
- - !ruby/object:Gem::Version
157
- version: 1.3.1
147
+ requirements:
148
+ - - ! '>='
149
+ - !ruby/object:Gem::Version
150
+ version: '0'
158
151
  requirements: []
159
-
160
152
  rubyforge_project:
161
- rubygems_version: 1.6.2
153
+ rubygems_version: 1.8.10
162
154
  signing_key:
163
155
  specification_version: 3
164
156
  summary: Rails drop in for Varnish support.
165
- test_files:
157
+ test_files:
166
158
  - spec/lacquer/cache_control_spec.rb
167
159
  - spec/lacquer/cache_utils_spec.rb
168
160
  - spec/lacquer/delayed_job_job_spec.rb