klarlack 0.0.2 → 0.0.3
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.
- data/README.rdoc +2 -2
- data/VERSION.yml +2 -2
- data/lib/klarlack.rb +1 -2
- data/lib/varnish/client.rb +2 -1
- data/spec/klarlack_spec.rb +11 -0
- metadata +2 -2
data/README.rdoc
CHANGED
@@ -6,9 +6,9 @@ See also: http://www.varnish-cache.org
|
|
6
6
|
|
7
7
|
Please note: You need at least version 2.0.3 of varnish for purging to work.
|
8
8
|
|
9
|
-
=== Installation
|
9
|
+
=== Installation (from gemcutter.org)
|
10
10
|
|
11
|
-
sudo gem install
|
11
|
+
sudo gem install klarlack
|
12
12
|
|
13
13
|
=== Example
|
14
14
|
|
data/VERSION.yml
CHANGED
data/lib/klarlack.rb
CHANGED
data/lib/varnish/client.rb
CHANGED
@@ -1,4 +1,5 @@
|
|
1
1
|
module Varnish
|
2
|
+
class Error < StandardError; end
|
2
3
|
class Client
|
3
4
|
# Default management port of varnishd
|
4
5
|
DEFAULT_PORT = 6082
|
@@ -219,7 +220,7 @@ module Varnish
|
|
219
220
|
def cmd(name, *params)
|
220
221
|
@mutex.synchronize do
|
221
222
|
connect unless connected?
|
222
|
-
@conn.write "#{name} #{params.join(' ')}\n"
|
223
|
+
@conn.write "#{name} #{params.join(' ').gsub('\\', '\\\\\\')}\n"
|
223
224
|
status, length = @conn.gets.split # <status> <content_length>\n
|
224
225
|
content = @conn.read(length.to_i + 1) # +1 = \n
|
225
226
|
content.chomp!
|
data/spec/klarlack_spec.rb
CHANGED
@@ -117,6 +117,17 @@ describe Varnish::Client do
|
|
117
117
|
end
|
118
118
|
|
119
119
|
end
|
120
|
+
|
121
|
+
describe '(regression)' do
|
122
|
+
|
123
|
+
it '#purge.hash with regex containing backslashes should be escaped properly' do
|
124
|
+
test_regex = '/home\?x=1'
|
125
|
+
@varnish.purge :hash, test_regex
|
126
|
+
list = @varnish.purge :list
|
127
|
+
list.flatten.join.should include(test_regex)
|
128
|
+
end
|
129
|
+
|
130
|
+
end
|
120
131
|
|
121
132
|
describe '(daemon lifecycle)' do
|
122
133
|
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: klarlack
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- "Max Sch\xC3\xB6fmann"
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-12-08 00:00:00 +01:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|