varnish-wrapper 0.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/Gemfile +13 -0
- data/Gemfile.lock +60 -0
- data/LICENSE.txt +20 -0
- data/README.md +52 -0
- data/Rakefile +52 -0
- data/VERSION +1 -0
- data/examples/log.rb +30 -0
- data/examples/log_tail.rb +21 -0
- data/examples/request_stream.rb +27 -0
- data/examples/request_tail.rb +17 -0
- data/lib/em/buffered_channel.rb +68 -0
- data/lib/em/varnish_log/connection.rb +59 -0
- data/lib/varnish.rb +9 -0
- data/lib/varnish/vsl.rb +17 -0
- data/lib/varnish/vsl/enum.rb +81 -0
- data/lib/varnish/vsm.rb +12 -0
- data/varnish-wrapper.gemspec +61 -0
- metadata +120 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 7f39f15451d49bf3bd52d18a46f0fc1db87fb85b
|
4
|
+
data.tar.gz: 9db14522b103152f5e7512935494d46be721b066
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: adde792d596bc76295fe30f90f053f1a1dbfc8b32d28f38fd48c070ddd1f62722eb18f76fbf3ed033ae0c083e1262be8f8d89661c75ec0cfaed3ffc49ed97052
|
7
|
+
data.tar.gz: a9aa15f929424e1b2c2f18a2b4c919e786e602944ec3dd33d58aaf872cf948747a8ed796aa4d1e18d6a0069716c6f144f164859415ee7c9abe0bd45ebdeccaf8
|
data/Gemfile
ADDED
data/Gemfile.lock
ADDED
@@ -0,0 +1,60 @@
|
|
1
|
+
GEM
|
2
|
+
remote: https://rubygems.org/
|
3
|
+
specs:
|
4
|
+
addressable (2.3.6)
|
5
|
+
builder (3.2.2)
|
6
|
+
descendants_tracker (0.0.4)
|
7
|
+
thread_safe (~> 0.3, >= 0.3.1)
|
8
|
+
eventmachine (1.0.3)
|
9
|
+
faraday (0.9.0)
|
10
|
+
multipart-post (>= 1.2, < 3)
|
11
|
+
ffi (1.9.3)
|
12
|
+
git (1.2.8)
|
13
|
+
github_api (0.12.1)
|
14
|
+
addressable (~> 2.3)
|
15
|
+
descendants_tracker (~> 0.0.4)
|
16
|
+
faraday (~> 0.8, < 0.10)
|
17
|
+
hashie (>= 3.2)
|
18
|
+
multi_json (>= 1.7.5, < 2.0)
|
19
|
+
nokogiri (~> 1.6.3)
|
20
|
+
oauth2
|
21
|
+
hashie (3.3.1)
|
22
|
+
highline (1.6.21)
|
23
|
+
jeweler (2.0.1)
|
24
|
+
builder
|
25
|
+
bundler (>= 1.0)
|
26
|
+
git (>= 1.2.5)
|
27
|
+
github_api
|
28
|
+
highline (>= 1.6.15)
|
29
|
+
nokogiri (>= 1.5.10)
|
30
|
+
rake
|
31
|
+
rdoc
|
32
|
+
json (1.8.1)
|
33
|
+
jwt (1.0.0)
|
34
|
+
mini_portile (0.6.0)
|
35
|
+
multi_json (1.10.1)
|
36
|
+
multi_xml (0.5.5)
|
37
|
+
multipart-post (2.0.0)
|
38
|
+
nokogiri (1.6.3.1)
|
39
|
+
mini_portile (= 0.6.0)
|
40
|
+
oauth2 (1.0.0)
|
41
|
+
faraday (>= 0.8, < 0.10)
|
42
|
+
jwt (~> 1.0)
|
43
|
+
multi_json (~> 1.3)
|
44
|
+
multi_xml (~> 0.5)
|
45
|
+
rack (~> 1.2)
|
46
|
+
rack (1.5.2)
|
47
|
+
rake (0.9.6)
|
48
|
+
rdoc (4.1.1)
|
49
|
+
json (~> 1.4)
|
50
|
+
thread_safe (0.3.4)
|
51
|
+
|
52
|
+
PLATFORMS
|
53
|
+
ruby
|
54
|
+
|
55
|
+
DEPENDENCIES
|
56
|
+
bundler
|
57
|
+
eventmachine
|
58
|
+
ffi
|
59
|
+
jeweler
|
60
|
+
rake (~> 0.9.2)
|
data/LICENSE.txt
ADDED
@@ -0,0 +1,20 @@
|
|
1
|
+
Copyright (c) 2011 ZephirWorks
|
2
|
+
|
3
|
+
Permission is hereby granted, free of charge, to any person obtaining
|
4
|
+
a copy of this software and associated documentation files (the
|
5
|
+
"Software"), to deal in the Software without restriction, including
|
6
|
+
without limitation the rights to use, copy, modify, merge, publish,
|
7
|
+
distribute, sublicense, and/or sell copies of the Software, and to
|
8
|
+
permit persons to whom the Software is furnished to do so, subject to
|
9
|
+
the following conditions:
|
10
|
+
|
11
|
+
The above copyright notice and this permission notice shall be
|
12
|
+
included in all copies or substantial portions of the Software.
|
13
|
+
|
14
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
|
15
|
+
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
|
16
|
+
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND
|
17
|
+
NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE
|
18
|
+
LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION
|
19
|
+
OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
|
20
|
+
WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
|
data/README.md
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
varnish-wrapper
|
2
|
+
==========
|
3
|
+
|
4
|
+
varnish-rb provides a bridge between Ruby and [Varnish 3](http://varnish-cache.org/).
|
5
|
+
|
6
|
+
|
7
|
+
Low-level access to Varnishlog
|
8
|
+
------------------------------
|
9
|
+
|
10
|
+
Low-level access to the varnishlog SHM is provided via Varnish::VSL and the underlying class Varnish::VSM.
|
11
|
+
Ruby methods are mapped to the corresponding C APIs through FFI. This guarantees extremely high performance
|
12
|
+
(around 200k entries per second) at the cost.
|
13
|
+
|
14
|
+
This API is currently undocumented, because the underlying varnishlog API is not officially supported and
|
15
|
+
subject to changes. See examples/log.rb for an example.
|
16
|
+
|
17
|
+
|
18
|
+
Varnishlog EventMachine connection
|
19
|
+
----------------------------------
|
20
|
+
|
21
|
+
EM::VarnishLog::Connection is a subclass of EM::Connection that provides a stream of log entries. It processes
|
22
|
+
log entries in a background thread outside the reactor and pushes them onto an EM::Channel. Channel subscribers
|
23
|
+
within the reactor thread can receive these entries and process them further.
|
24
|
+
|
25
|
+
Due to the complexity of using threads with EventMachine, and the need for very high performance, this API is
|
26
|
+
currently tested only on JRuby (1.6.2 as of this writing).
|
27
|
+
|
28
|
+
Pushing one log entry at a time will incur a very high overhead that limits the number of entries that can be
|
29
|
+
processed per second. This gem provides an EM::BufferedChannel that implements double buffering. Using this channel
|
30
|
+
it is possible to process about 150k entries per second, corresponding to 3-4k HTTP requests per second. This
|
31
|
+
makes it possible to process moderate traffic in a development or preproduction environment, but you would have to
|
32
|
+
be out of your mind to use it in production.
|
33
|
+
|
34
|
+
See examples/log\_tail.rb and especially examples/request\_tail.rb for a taste of how to use this API.
|
35
|
+
|
36
|
+
Contributing to varnish-wrapper
|
37
|
+
==========================
|
38
|
+
|
39
|
+
* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet
|
40
|
+
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it
|
41
|
+
* Fork the project
|
42
|
+
* Start a feature/bugfix branch
|
43
|
+
* Commit and push until you are happy with your contribution
|
44
|
+
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
|
45
|
+
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.
|
46
|
+
|
47
|
+
Copyright
|
48
|
+
=========
|
49
|
+
|
50
|
+
Copyright (c) 2011 ZephirWorks. See LICENSE.txt for
|
51
|
+
further details.
|
52
|
+
|
data/Rakefile
ADDED
@@ -0,0 +1,52 @@
|
|
1
|
+
# encoding: utf-8
|
2
|
+
|
3
|
+
require 'rubygems'
|
4
|
+
require 'bundler'
|
5
|
+
begin
|
6
|
+
Bundler.setup(:default, :development)
|
7
|
+
rescue Bundler::BundlerError => e
|
8
|
+
$stderr.puts e.message
|
9
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
10
|
+
exit e.status_code
|
11
|
+
end
|
12
|
+
require 'rake'
|
13
|
+
|
14
|
+
require 'jeweler'
|
15
|
+
Jeweler::Tasks.new do |gem|
|
16
|
+
# gem is a Gem::Specification... see http://docs.rubygems.org/read/chapter/20 for more options
|
17
|
+
gem.name = "varnish-rb"
|
18
|
+
gem.homepage = "http://github.com/andreacampi/varnish-rb"
|
19
|
+
gem.license = "MIT"
|
20
|
+
gem.summary = %Q{A bridge between Ruby and Varnish 3}
|
21
|
+
gem.description = %Q{varnish-rb provides a bridge between Ruby and [Varnish 3](http://varnish-cache.org/)}
|
22
|
+
gem.email = "andrea.campi@zephirworks.com"
|
23
|
+
gem.authors = ["Andrea Campi"]
|
24
|
+
end
|
25
|
+
Jeweler::RubygemsDotOrgTasks.new
|
26
|
+
|
27
|
+
# require 'rake/testtask'
|
28
|
+
# Rake::TestTask.new(:test) do |test|
|
29
|
+
# test.libs << 'lib' << 'test'
|
30
|
+
# test.pattern = 'test/**/test_*.rb'
|
31
|
+
# test.verbose = true
|
32
|
+
# end
|
33
|
+
#
|
34
|
+
# require 'rcov/rcovtask'
|
35
|
+
# Rcov::RcovTask.new do |test|
|
36
|
+
# test.libs << 'test'
|
37
|
+
# test.pattern = 'test/**/test_*.rb'
|
38
|
+
# test.verbose = true
|
39
|
+
# test.rcov_opts << '--exclude "gems/*"'
|
40
|
+
# end
|
41
|
+
#
|
42
|
+
# task :default => :test
|
43
|
+
|
44
|
+
require 'rdoc/task'
|
45
|
+
Rake::RDocTask.new do |rdoc|
|
46
|
+
version = File.exist?('VERSION') ? File.read('VERSION') : ""
|
47
|
+
|
48
|
+
rdoc.rdoc_dir = 'rdoc'
|
49
|
+
rdoc.title = "varnish-rb #{version}"
|
50
|
+
rdoc.rdoc_files.include('README*')
|
51
|
+
rdoc.rdoc_files.include('lib/**/*.rb')
|
52
|
+
end
|
data/VERSION
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
0.2.1
|
data/examples/log.rb
ADDED
@@ -0,0 +1,30 @@
|
|
1
|
+
require 'varnish'
|
2
|
+
|
3
|
+
class Log
|
4
|
+
def initialize
|
5
|
+
@vd = Varnish::VSM.VSM_New
|
6
|
+
Varnish::VSL.VSL_Setup(@vd)
|
7
|
+
Varnish::VSL.VSL_Open(@vd, 1)
|
8
|
+
|
9
|
+
@count = 0
|
10
|
+
@t = nil
|
11
|
+
end
|
12
|
+
|
13
|
+
def run
|
14
|
+
Varnish::VSL.VSL_Dispatch(@vd, self.method(:callback).to_proc, FFI::MemoryPointer.new(:pointer))
|
15
|
+
end
|
16
|
+
|
17
|
+
private
|
18
|
+
def callback(*args)
|
19
|
+
@t = Time.now if @count == 0
|
20
|
+
@count += 1
|
21
|
+
|
22
|
+
if (@count % 100000) == 0
|
23
|
+
puts "received #{@count} messages in #{(Time.now - @t).to_s} seconds"
|
24
|
+
@t = Time.now
|
25
|
+
end
|
26
|
+
return 0
|
27
|
+
end
|
28
|
+
end
|
29
|
+
|
30
|
+
Log.new.run
|
@@ -0,0 +1,21 @@
|
|
1
|
+
require 'eventmachine'
|
2
|
+
require 'em/varnish_log/connection'
|
3
|
+
require 'em/buffered_channel'
|
4
|
+
|
5
|
+
EM.run do
|
6
|
+
count = 0
|
7
|
+
t = nil
|
8
|
+
|
9
|
+
channel = EM::BufferedChannel.new
|
10
|
+
stream = EM::VarnishLog::Connection.new(channel)
|
11
|
+
stream.run
|
12
|
+
|
13
|
+
channel.subscribe do |msg|
|
14
|
+
t = Time.now if count == 0
|
15
|
+
count += 1
|
16
|
+
if (count % 100000) == 0
|
17
|
+
puts "received #{count} messages in #{(Time.now - t).to_s} seconds"
|
18
|
+
t = Time.now
|
19
|
+
end
|
20
|
+
end
|
21
|
+
end
|
@@ -0,0 +1,27 @@
|
|
1
|
+
require 'em/varnish_log/connection'
|
2
|
+
require 'em/buffered_channel'
|
3
|
+
|
4
|
+
class RequestStream
|
5
|
+
def initialize
|
6
|
+
@channel = EM::BufferedChannel.new
|
7
|
+
@callbacks = []
|
8
|
+
|
9
|
+
listen
|
10
|
+
end
|
11
|
+
|
12
|
+
def onrequest(&block)
|
13
|
+
@callbacks << block
|
14
|
+
end
|
15
|
+
|
16
|
+
private
|
17
|
+
|
18
|
+
def listen
|
19
|
+
EM::VarnishLog::Connection.new(@channel).run
|
20
|
+
|
21
|
+
@channel.subscribe do |msg|
|
22
|
+
if msg[:tag] == :reqend
|
23
|
+
@callbacks.each { |c| c.call(msg) }
|
24
|
+
end
|
25
|
+
end
|
26
|
+
end
|
27
|
+
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'eventmachine'
|
2
|
+
require File.expand_path('request_stream', File.dirname(__FILE__))
|
3
|
+
|
4
|
+
EM.run do
|
5
|
+
count = 0
|
6
|
+
t = nil
|
7
|
+
|
8
|
+
stream = RequestStream.new
|
9
|
+
stream.onrequest do |data|
|
10
|
+
t = Time.now if count == 0
|
11
|
+
count += 1
|
12
|
+
if (count % 1000) == 0
|
13
|
+
puts "received #{count} requests in #{(Time.now - t).to_s} seconds"
|
14
|
+
t = Time.now
|
15
|
+
end
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,68 @@
|
|
1
|
+
require 'eventmachine'
|
2
|
+
|
3
|
+
module EM
|
4
|
+
#
|
5
|
+
# A subclass of EM::Channel that implements double buffering (using a
|
6
|
+
# circular array of arrays) to achieve higher packet rate.
|
7
|
+
#
|
8
|
+
# The buffer size and the number of buffers are critical to achieving good
|
9
|
+
# performance, you may need to tune them.
|
10
|
+
#
|
11
|
+
class BufferedChannel < EM::Channel
|
12
|
+
def initialize
|
13
|
+
super
|
14
|
+
@buffer = BufferSet.new(2000, 200)
|
15
|
+
end
|
16
|
+
|
17
|
+
def push(*items)
|
18
|
+
@buffer.push(*items) do |buf|
|
19
|
+
EM.schedule do
|
20
|
+
@subs.values.each do |s|
|
21
|
+
begin
|
22
|
+
buf.each do |i|
|
23
|
+
s.call i
|
24
|
+
end
|
25
|
+
ensure
|
26
|
+
buf.clear
|
27
|
+
end
|
28
|
+
end
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
class BufferSet
|
34
|
+
def initialize(size, nbufs)
|
35
|
+
@size = size
|
36
|
+
@nbufs = nbufs
|
37
|
+
|
38
|
+
@buffers = []
|
39
|
+
|
40
|
+
setup
|
41
|
+
end
|
42
|
+
|
43
|
+
def push(data)
|
44
|
+
raise "WTF #{@buffers.length}" unless @buffers.length == @nbufs
|
45
|
+
|
46
|
+
if @buffers[0].length > @size
|
47
|
+
if @buffers[1].length > 0
|
48
|
+
raise "panic! the next buffer is still full!"
|
49
|
+
end
|
50
|
+
|
51
|
+
buf = @buffers.shift
|
52
|
+
@buffers << buf
|
53
|
+
|
54
|
+
yield buf
|
55
|
+
end
|
56
|
+
|
57
|
+
@buffers.first << data
|
58
|
+
end
|
59
|
+
|
60
|
+
private
|
61
|
+
def setup
|
62
|
+
(0..@nbufs-1).each do |n|
|
63
|
+
@buffers[n] = []
|
64
|
+
end
|
65
|
+
end
|
66
|
+
end
|
67
|
+
end
|
68
|
+
end
|
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'eventmachine'
|
2
|
+
require 'varnish'
|
3
|
+
|
4
|
+
module EM
|
5
|
+
module VarnishLog
|
6
|
+
#
|
7
|
+
# A subclass of EM::Connection that reads from the Varnish log SHM and
|
8
|
+
# pushes single log entries on the channel passed to its constructor.
|
9
|
+
#
|
10
|
+
# Note that simply using an EM::Channel pretty much guarantees awful
|
11
|
+
# performance, suitable only for extremely low workloads in a development
|
12
|
+
# environment. The provided EM::BufferedChannel improves things quite a
|
13
|
+
# bit: it has proved able to push about 150k entries per second
|
14
|
+
# (corresponding to about 4k HTTP req/s), using a full CPU on a modern
|
15
|
+
# MBP.
|
16
|
+
#
|
17
|
+
class Connection
|
18
|
+
class << self
|
19
|
+
attr_reader :channel
|
20
|
+
end
|
21
|
+
|
22
|
+
def initialize(channel)
|
23
|
+
@channel = channel
|
24
|
+
end
|
25
|
+
|
26
|
+
def run(options = {})
|
27
|
+
vd = Varnish::VSM.VSM_New
|
28
|
+
Varnish::VSL.VSL_Setup(vd)
|
29
|
+
if Varnish::VSM.VSM_n_Arg(vd, options[:instance]) != 1
|
30
|
+
raise 'unknown instance'
|
31
|
+
end
|
32
|
+
Varnish::VSL.VSL_Open(vd, 1)
|
33
|
+
|
34
|
+
callback = Proc.new { |*args| cb(*args) }
|
35
|
+
|
36
|
+
Thread.new do
|
37
|
+
begin
|
38
|
+
Varnish::VSL.VSL_Dispatch(vd, callback, FFI::MemoryPointer.new(:pointer))
|
39
|
+
rescue => e
|
40
|
+
puts "exception in thread: #{e.inspect}"
|
41
|
+
ensure
|
42
|
+
EM.stop
|
43
|
+
end
|
44
|
+
end
|
45
|
+
rescue => e
|
46
|
+
puts "exception in post_init: #{e.inspect}"
|
47
|
+
end
|
48
|
+
|
49
|
+
private
|
50
|
+
def cb(priv, tag, fd, len, spec, ptr, bitmap)
|
51
|
+
str = ptr.read_string(len)
|
52
|
+
@channel.push(:tag => tag, :fd => fd, :data => str, :spec => spec, :bitmap => bitmap)
|
53
|
+
0 # ok
|
54
|
+
rescue => e
|
55
|
+
puts "exception in cb: #{e.inspect}"
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/varnish.rb
ADDED
data/lib/varnish/vsl.rb
ADDED
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'varnish'
|
2
|
+
require 'ffi'
|
3
|
+
require 'varnish/vsl/enum'
|
4
|
+
|
5
|
+
module Varnish
|
6
|
+
module VSL
|
7
|
+
extend FFI::Library
|
8
|
+
ffi_lib Varnish::LIBVARNISHAPI
|
9
|
+
include Enum
|
10
|
+
|
11
|
+
callback :VSL_handler_f, [:pointer, VslTag, :int, :int, VslSpec, :pointer, :int64], :int
|
12
|
+
|
13
|
+
attach_function 'VSL_Setup', [ :pointer ], :void
|
14
|
+
attach_function 'VSL_Open', [ :pointer, :int ], :int
|
15
|
+
attach_function 'VSL_Dispatch', [ :pointer, :VSL_handler_f, :pointer ], :int
|
16
|
+
end
|
17
|
+
end
|
@@ -0,0 +1,81 @@
|
|
1
|
+
require 'varnish'
|
2
|
+
require 'ffi'
|
3
|
+
|
4
|
+
module Varnish
|
5
|
+
module VSL
|
6
|
+
module Enum
|
7
|
+
extend FFI::Library
|
8
|
+
|
9
|
+
VslTag = enum(
|
10
|
+
:debug,
|
11
|
+
:error,
|
12
|
+
:cli,
|
13
|
+
:statsess,
|
14
|
+
:reqend,
|
15
|
+
:sessionopen,
|
16
|
+
:sessionclose,
|
17
|
+
:backendopen,
|
18
|
+
:backendxid,
|
19
|
+
:backendreuse,
|
20
|
+
:backendclose,
|
21
|
+
:httpgarbage,
|
22
|
+
:backend,
|
23
|
+
:length,
|
24
|
+
|
25
|
+
:fetcherror,
|
26
|
+
|
27
|
+
:rxrequest,
|
28
|
+
:rxresponse,
|
29
|
+
:rxstatus,
|
30
|
+
:rxurl,
|
31
|
+
:rxprotocol,
|
32
|
+
:rxheader,
|
33
|
+
|
34
|
+
:txrequest,
|
35
|
+
:txresponse,
|
36
|
+
:txstatus,
|
37
|
+
:txurl,
|
38
|
+
:txprotocol,
|
39
|
+
:txheader,
|
40
|
+
|
41
|
+
:objrequest,
|
42
|
+
:objresponse,
|
43
|
+
:objstatus,
|
44
|
+
:objurl,
|
45
|
+
:objprotocol,
|
46
|
+
:objheader,
|
47
|
+
|
48
|
+
:lostheader,
|
49
|
+
|
50
|
+
:ttl,
|
51
|
+
:fetch_body,
|
52
|
+
:vcl_acl,
|
53
|
+
:vcl_call,
|
54
|
+
:vcl_trace,
|
55
|
+
:vcl_return,
|
56
|
+
:vcl_error,
|
57
|
+
:reqstart,
|
58
|
+
:hit,
|
59
|
+
:hitpass,
|
60
|
+
:expban,
|
61
|
+
:expkill,
|
62
|
+
:workthread,
|
63
|
+
|
64
|
+
:esi_xmlerror,
|
65
|
+
|
66
|
+
:hash,
|
67
|
+
|
68
|
+
:backend_health,
|
69
|
+
:vcl_log,
|
70
|
+
|
71
|
+
:gzip
|
72
|
+
)
|
73
|
+
|
74
|
+
VslSpec = enum(
|
75
|
+
:spec_unknown,
|
76
|
+
:spec_client,
|
77
|
+
:spec_backend
|
78
|
+
)
|
79
|
+
end
|
80
|
+
end
|
81
|
+
end
|
data/lib/varnish/vsm.rb
ADDED
@@ -0,0 +1,61 @@
|
|
1
|
+
# -*- encoding: utf-8 -*-
|
2
|
+
Gem::Specification.new do |s|
|
3
|
+
s.name = "varnish-wrapper"
|
4
|
+
s.version = "0.2.2"
|
5
|
+
|
6
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
7
|
+
s.authors = ["Andrea Campi", "hans.moulron@francetv.fr"]
|
8
|
+
s.date = "2015-12-01"
|
9
|
+
s.description = "varnish-wrapper provides a bridge between Ruby and [Varnish 3](http://varnish-cache.org/). A fork of Andrea Campi repo, because it does not support varnish instance name"
|
10
|
+
s.email = "hans.moulron@francetv.fr"
|
11
|
+
s.extra_rdoc_files = [
|
12
|
+
"LICENSE.txt",
|
13
|
+
"README.md"
|
14
|
+
]
|
15
|
+
s.files = [
|
16
|
+
"Gemfile",
|
17
|
+
"Gemfile.lock",
|
18
|
+
"LICENSE.txt",
|
19
|
+
"README.md",
|
20
|
+
"Rakefile",
|
21
|
+
"VERSION",
|
22
|
+
"examples/log.rb",
|
23
|
+
"examples/log_tail.rb",
|
24
|
+
"examples/request_stream.rb",
|
25
|
+
"examples/request_tail.rb",
|
26
|
+
"lib/em/buffered_channel.rb",
|
27
|
+
"lib/em/varnish_log/connection.rb",
|
28
|
+
"lib/varnish.rb",
|
29
|
+
"lib/varnish/vsl.rb",
|
30
|
+
"lib/varnish/vsl/enum.rb",
|
31
|
+
"lib/varnish/vsm.rb",
|
32
|
+
"varnish-wrapper.gemspec"
|
33
|
+
]
|
34
|
+
s.homepage = "https://github.com/francetv/varnish-wrapper"
|
35
|
+
s.licenses = ["MIT"]
|
36
|
+
s.require_paths = ["lib"]
|
37
|
+
s.rubygems_version = "1.8.23"
|
38
|
+
s.summary = "A bridge between Ruby and Varnish 3"
|
39
|
+
|
40
|
+
if s.respond_to? :specification_version then
|
41
|
+
s.specification_version = 3
|
42
|
+
|
43
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
44
|
+
s.add_runtime_dependency(%q<ffi>, [">= 0"])
|
45
|
+
s.add_development_dependency(%q<bundler>, [">= 0"])
|
46
|
+
s.add_development_dependency(%q<jeweler>, [">= 0"])
|
47
|
+
s.add_development_dependency(%q<rake>, ["~> 0.9.2"])
|
48
|
+
else
|
49
|
+
s.add_dependency(%q<ffi>, [">= 0"])
|
50
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
51
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
52
|
+
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
53
|
+
end
|
54
|
+
else
|
55
|
+
s.add_dependency(%q<ffi>, [">= 0"])
|
56
|
+
s.add_dependency(%q<bundler>, [">= 0"])
|
57
|
+
s.add_dependency(%q<jeweler>, [">= 0"])
|
58
|
+
s.add_dependency(%q<rake>, ["~> 0.9.2"])
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
metadata
ADDED
@@ -0,0 +1,120 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: varnish-wrapper
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.2
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Andrea Campi
|
8
|
+
- hans.moulron@francetv.fr
|
9
|
+
autorequire:
|
10
|
+
bindir: bin
|
11
|
+
cert_chain: []
|
12
|
+
date: 2015-12-01 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
15
|
+
name: ffi
|
16
|
+
requirement: !ruby/object:Gem::Requirement
|
17
|
+
requirements:
|
18
|
+
- - ">="
|
19
|
+
- !ruby/object:Gem::Version
|
20
|
+
version: '0'
|
21
|
+
type: :runtime
|
22
|
+
prerelease: false
|
23
|
+
version_requirements: !ruby/object:Gem::Requirement
|
24
|
+
requirements:
|
25
|
+
- - ">="
|
26
|
+
- !ruby/object:Gem::Version
|
27
|
+
version: '0'
|
28
|
+
- !ruby/object:Gem::Dependency
|
29
|
+
name: bundler
|
30
|
+
requirement: !ruby/object:Gem::Requirement
|
31
|
+
requirements:
|
32
|
+
- - ">="
|
33
|
+
- !ruby/object:Gem::Version
|
34
|
+
version: '0'
|
35
|
+
type: :development
|
36
|
+
prerelease: false
|
37
|
+
version_requirements: !ruby/object:Gem::Requirement
|
38
|
+
requirements:
|
39
|
+
- - ">="
|
40
|
+
- !ruby/object:Gem::Version
|
41
|
+
version: '0'
|
42
|
+
- !ruby/object:Gem::Dependency
|
43
|
+
name: jeweler
|
44
|
+
requirement: !ruby/object:Gem::Requirement
|
45
|
+
requirements:
|
46
|
+
- - ">="
|
47
|
+
- !ruby/object:Gem::Version
|
48
|
+
version: '0'
|
49
|
+
type: :development
|
50
|
+
prerelease: false
|
51
|
+
version_requirements: !ruby/object:Gem::Requirement
|
52
|
+
requirements:
|
53
|
+
- - ">="
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
- !ruby/object:Gem::Dependency
|
57
|
+
name: rake
|
58
|
+
requirement: !ruby/object:Gem::Requirement
|
59
|
+
requirements:
|
60
|
+
- - "~>"
|
61
|
+
- !ruby/object:Gem::Version
|
62
|
+
version: 0.9.2
|
63
|
+
type: :development
|
64
|
+
prerelease: false
|
65
|
+
version_requirements: !ruby/object:Gem::Requirement
|
66
|
+
requirements:
|
67
|
+
- - "~>"
|
68
|
+
- !ruby/object:Gem::Version
|
69
|
+
version: 0.9.2
|
70
|
+
description: varnish-wrapper provides a bridge between Ruby and [Varnish 3](http://varnish-cache.org/).
|
71
|
+
A fork of Andrea Campi repo, because it does not support varnish instance name
|
72
|
+
email: hans.moulron@francetv.fr
|
73
|
+
executables: []
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files:
|
76
|
+
- LICENSE.txt
|
77
|
+
- README.md
|
78
|
+
files:
|
79
|
+
- Gemfile
|
80
|
+
- Gemfile.lock
|
81
|
+
- LICENSE.txt
|
82
|
+
- README.md
|
83
|
+
- Rakefile
|
84
|
+
- VERSION
|
85
|
+
- examples/log.rb
|
86
|
+
- examples/log_tail.rb
|
87
|
+
- examples/request_stream.rb
|
88
|
+
- examples/request_tail.rb
|
89
|
+
- lib/em/buffered_channel.rb
|
90
|
+
- lib/em/varnish_log/connection.rb
|
91
|
+
- lib/varnish.rb
|
92
|
+
- lib/varnish/vsl.rb
|
93
|
+
- lib/varnish/vsl/enum.rb
|
94
|
+
- lib/varnish/vsm.rb
|
95
|
+
- varnish-wrapper.gemspec
|
96
|
+
homepage: https://github.com/francetv/varnish-wrapper
|
97
|
+
licenses:
|
98
|
+
- MIT
|
99
|
+
metadata: {}
|
100
|
+
post_install_message:
|
101
|
+
rdoc_options: []
|
102
|
+
require_paths:
|
103
|
+
- lib
|
104
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
105
|
+
requirements:
|
106
|
+
- - ">="
|
107
|
+
- !ruby/object:Gem::Version
|
108
|
+
version: '0'
|
109
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
110
|
+
requirements:
|
111
|
+
- - ">="
|
112
|
+
- !ruby/object:Gem::Version
|
113
|
+
version: '0'
|
114
|
+
requirements: []
|
115
|
+
rubyforge_project:
|
116
|
+
rubygems_version: 2.4.6
|
117
|
+
signing_key:
|
118
|
+
specification_version: 3
|
119
|
+
summary: A bridge between Ruby and Varnish 3
|
120
|
+
test_files: []
|