klarlack 0.0.2 → 0.0.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -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 schoefmax-klarlack --source=http://gems.github.com
11
+ sudo gem install klarlack
12
12
 
13
13
  === Example
14
14
 
@@ -1,4 +1,4 @@
1
1
  ---
2
- :major: 0
3
2
  :minor: 0
4
- :patch: 2
3
+ :patch: 0
4
+ :major: 0
@@ -3,6 +3,5 @@ require 'varnish/socket_factory'
3
3
  require 'varnish/client'
4
4
 
5
5
  module Varnish
6
- class Error < StandardError; end
7
- VERSION = '0.0.1'
6
+ VERSION = '0.0.3'
8
7
  end
@@ -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!
@@ -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.2
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-04-24 00:00:00 +02:00
12
+ date: 2009-12-08 00:00:00 +01:00
13
13
  default_executable:
14
14
  dependencies: []
15
15