dalli 2.7.0 → 2.7.11

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


This version of dalli might be problematic. Click here for more details.

data/lib/dalli/socket.rb CHANGED
@@ -1,3 +1,15 @@
1
+ # frozen_string_literal: true
2
+ require 'rbconfig'
3
+
4
+ module Dalli::Server::TCPSocketOptions
5
+ def setsockopts(sock, options)
6
+ sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
7
+ sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true) if options[:keepalive]
8
+ sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_RCVBUF, options[:rcvbuf]) if options[:rcvbuf]
9
+ sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_SNDBUF, options[:sndbuf]) if options[:sndbuf]
10
+ end
11
+ end
12
+
1
13
  begin
2
14
  require 'kgio'
3
15
  puts "Using kgio socket IO" if defined?($TESTING) && $TESTING
@@ -13,22 +25,11 @@ begin
13
25
  IO.select(nil, [self], nil, options[:socket_timeout]) || raise(Timeout::Error, "IO timeout")
14
26
  end
15
27
 
16
- def self.open(host, port, server, options = {})
17
- addr = Socket.pack_sockaddr_in(port, host)
18
- sock = start(addr)
19
- sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
20
- sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true) if options[:keepalive]
21
- sock.options = options
22
- sock.server = server
23
- sock.kgio_wait_writable
24
- sock
25
- end
26
-
27
28
  alias :write :kgio_write
28
29
 
29
30
  def readfull(count)
30
- value = ''
31
- loop do
31
+ value = String.new('')
32
+ while true
32
33
  value << kgio_read!(count - value.bytesize)
33
34
  break if value.bytesize == count
34
35
  end
@@ -36,8 +37,8 @@ begin
36
37
  end
37
38
 
38
39
  def read_available
39
- value = ''
40
- loop do
40
+ value = String.new('')
41
+ while true
41
42
  ret = kgio_tryread(8196)
42
43
  case ret
43
44
  when nil
@@ -50,7 +51,37 @@ begin
50
51
  end
51
52
  value
52
53
  end
54
+ end
53
55
 
56
+ class Dalli::Server::KSocket::TCP < Dalli::Server::KSocket
57
+ extend Dalli::Server::TCPSocketOptions
58
+
59
+ def self.open(host, port, server, options = {})
60
+ addr = Socket.pack_sockaddr_in(port, host)
61
+ sock = start(addr)
62
+ setsockopts(sock, options)
63
+ sock.options = options
64
+ sock.server = server
65
+ sock.kgio_wait_writable
66
+ sock
67
+ rescue Timeout::Error
68
+ sock.close if sock
69
+ raise
70
+ end
71
+ end
72
+
73
+ class Dalli::Server::KSocket::UNIX < Dalli::Server::KSocket
74
+ def self.open(path, server, options = {})
75
+ addr = Socket.pack_sockaddr_un(path)
76
+ sock = start(addr)
77
+ sock.options = options
78
+ sock.server = server
79
+ sock.kgio_wait_writable
80
+ sock
81
+ rescue Timeout::Error
82
+ sock.close if sock
83
+ raise
84
+ end
54
85
  end
55
86
 
56
87
  if ::Kgio.respond_to?(:wait_readable=)
@@ -61,47 +92,78 @@ begin
61
92
  rescue LoadError
62
93
 
63
94
  puts "Using standard socket IO (#{RUBY_DESCRIPTION})" if defined?($TESTING) && $TESTING
64
- class Dalli::Server::KSocket < TCPSocket
65
- attr_accessor :options, :server
95
+ module Dalli::Server::KSocket
96
+ module InstanceMethods
97
+ def readfull(count)
98
+ value = String.new('')
99
+ begin
100
+ while true
101
+ value << read_nonblock(count - value.bytesize)
102
+ break if value.bytesize == count
103
+ end
104
+ rescue Errno::EAGAIN, Errno::EWOULDBLOCK
105
+ if IO.select([self], nil, nil, options[:socket_timeout])
106
+ retry
107
+ else
108
+ safe_options = options.reject{|k,v| [:username, :password].include? k}
109
+ raise Timeout::Error, "IO timeout: #{safe_options.inspect}"
110
+ end
111
+ end
112
+ value
113
+ end
114
+
115
+ def read_available
116
+ value = String.new('')
117
+ while true
118
+ begin
119
+ value << read_nonblock(8196)
120
+ rescue Errno::EAGAIN, Errno::EWOULDBLOCK
121
+ break
122
+ end
123
+ end
124
+ value
125
+ end
126
+ end
127
+
128
+ def self.included(receiver)
129
+ receiver.send(:attr_accessor, :options, :server)
130
+ receiver.send(:include, InstanceMethods)
131
+ end
132
+ end
133
+
134
+ class Dalli::Server::KSocket::TCP < TCPSocket
135
+ extend Dalli::Server::TCPSocketOptions
136
+ include Dalli::Server::KSocket
66
137
 
67
138
  def self.open(host, port, server, options = {})
68
139
  Timeout.timeout(options[:socket_timeout]) do
69
140
  sock = new(host, port)
70
- sock.setsockopt(Socket::IPPROTO_TCP, Socket::TCP_NODELAY, true)
71
- sock.setsockopt(Socket::SOL_SOCKET, Socket::SO_KEEPALIVE, true) if options[:keepalive]
72
- sock.options = { :host => host, :port => port }.merge(options)
141
+ setsockopts(sock, options)
142
+ sock.options = {:host => host, :port => port}.merge(options)
73
143
  sock.server = server
74
144
  sock
75
145
  end
76
146
  end
147
+ end
77
148
 
78
- def readfull(count)
79
- value = ''
80
- begin
81
- loop do
82
- value << read_nonblock(count - value.bytesize)
83
- break if value.bytesize == count
84
- end
85
- rescue Errno::EAGAIN, Errno::EWOULDBLOCK
86
- if IO.select([self], nil, nil, options[:socket_timeout])
87
- retry
88
- else
89
- raise Timeout::Error, "IO timeout: #{options.inspect}"
90
- end
149
+ if RbConfig::CONFIG['host_os'] =~ /mingw|mswin/
150
+ class Dalli::Server::KSocket::UNIX
151
+ def initialize(*args)
152
+ raise Dalli::DalliError, "Unix sockets are not supported on Windows platform."
91
153
  end
92
- value
93
154
  end
155
+ else
156
+ class Dalli::Server::KSocket::UNIX < UNIXSocket
157
+ include Dalli::Server::KSocket
94
158
 
95
- def read_available
96
- value = ''
97
- loop do
98
- begin
99
- value << read_nonblock(8196)
100
- rescue Errno::EAGAIN, Errno::EWOULDBLOCK
101
- break
159
+ def self.open(path, server, options = {})
160
+ Timeout.timeout(options[:socket_timeout]) do
161
+ sock = new(path)
162
+ sock.options = {:path => path}.merge(options)
163
+ sock.server = server
164
+ sock
102
165
  end
103
166
  end
104
- value
105
167
  end
106
168
 
107
169
  end
data/lib/dalli/version.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  module Dalli
2
- VERSION = '2.7.0'
3
+ VERSION = '2.7.11'
3
4
  end
data/lib/dalli.rb CHANGED
@@ -1,3 +1,4 @@
1
+ # frozen_string_literal: true
1
2
  require 'dalli/compressor'
2
3
  require 'dalli/client'
3
4
  require 'dalli/ring'
@@ -18,6 +19,8 @@ module Dalli
18
19
  class MarshalError < DalliError; end
19
20
  # application error in marshalling deserialization or decompression
20
21
  class UnmarshalError < DalliError; end
22
+ # payload too big for memcached
23
+ class ValueOverMaxSize < DalliError; end
21
24
 
22
25
  def self.logger
23
26
  @logger ||= (rails_logger || default_logger)
@@ -1,36 +1,104 @@
1
+ # frozen_string_literal: true
1
2
  require 'rack/session/abstract/id'
2
3
  require 'dalli'
3
4
 
4
5
  module Rack
5
6
  module Session
6
- class Dalli < Abstract::ID
7
+ class Dalli < defined?(Abstract::Persisted) ? Abstract::Persisted : Abstract::ID
7
8
  attr_reader :pool, :mutex
8
9
 
9
- DEFAULT_OPTIONS = Abstract::ID::DEFAULT_OPTIONS.merge \
10
+ DEFAULT_DALLI_OPTIONS = {
10
11
  :namespace => 'rack:session',
11
12
  :memcache_server => 'localhost:11211'
13
+ }
12
14
 
15
+ # Brings in a new Rack::Session::Dalli middleware with the given
16
+ # `:memcache_server`. The server is either a hostname, or a
17
+ # host-with-port string in the form of "host_name:port", or an array of
18
+ # such strings. For example:
19
+ #
20
+ # use Rack::Session::Dalli,
21
+ # :memcache_server => "mc.example.com:1234"
22
+ #
23
+ # If no `:memcache_server` option is specified, Rack::Session::Dalli will
24
+ # connect to localhost, port 11211 (the default memcached port). If
25
+ # `:memcache_server` is set to nil, Dalli::Client will look for
26
+ # ENV['MEMCACHE_SERVERS'] and use that value if it is available, or fall
27
+ # back to the same default behavior described above.
28
+ #
29
+ # Rack::Session::Dalli is intended to be a drop-in replacement for
30
+ # Rack::Session::Memcache. It accepts additional options that control the
31
+ # behavior of Rack::Session, Dalli::Client, and an optional
32
+ # ConnectionPool. First and foremost, if you wish to instantiate your own
33
+ # Dalli::Client (or ConnectionPool) and use that instead of letting
34
+ # Rack::Session::Dalli instantiate it on your behalf, simply pass it in
35
+ # as the `:cache` option. Please note that you will be responsible for
36
+ # setting the namespace and any other options on Dalli::Client.
37
+ #
38
+ # Secondly, if you're not using the `:cache` option, Rack::Session::Dalli
39
+ # accepts the same options as Dalli::Client, so it's worth reviewing its
40
+ # documentation. Perhaps most importantly, if you don't specify a
41
+ # `:namespace` option, Rack::Session::Dalli will default to using
42
+ # "rack:session".
43
+ #
44
+ # Whether you are using the `:cache` option or not, it is not recommend
45
+ # to set `:expires_in`. Instead, use `:expire_after`, which will control
46
+ # both the expiration of the client cookie as well as the expiration of
47
+ # the corresponding entry in memcached.
48
+ #
49
+ # Rack::Session::Dalli also accepts a host of options that control how
50
+ # the sessions and session cookies are managed, including the
51
+ # aforementioned `:expire_after` option. Please see the documentation for
52
+ # Rack::Session::Abstract::Persisted for a detailed explanation of these
53
+ # options and their default values.
54
+ #
55
+ # Finally, if your web application is multithreaded, the
56
+ # Rack::Session::Dalli middleware can become a source of contention. You
57
+ # can use a connection pool of Dalli clients by passing in the
58
+ # `:pool_size` and/or `:pool_timeout` options. For example:
59
+ #
60
+ # use Rack::Session::Dalli,
61
+ # :memcache_server => "mc.example.com:1234",
62
+ # :pool_size => 10
63
+ #
64
+ # You must include the `connection_pool` gem in your project if you wish
65
+ # to use pool support. Please see the documentation for ConnectionPool
66
+ # for more information about it and its default options (which would only
67
+ # be applicable if you supplied one of the two options, but not both).
68
+ #
13
69
  def initialize(app, options={})
70
+ # Parent uses DEFAULT_OPTIONS to build @default_options for Rack::Session
14
71
  super
15
- @mutex = Mutex.new
16
- mserv = @default_options[:memcache_server]
17
- mopts = @default_options.reject{|k,v| !DEFAULT_OPTIONS.include? k }
18
- @pool = options[:cache] || ::Dalli::Client.new(mserv, mopts)
19
- end
20
72
 
21
- def generate_sid
22
- loop do
23
- sid = super
24
- break sid unless @pool.get(sid)
73
+ # Determine the default TTL for newly-created sessions
74
+ @default_ttl = ttl @default_options[:expire_after]
75
+
76
+ # Normalize and validate passed options
77
+ cache, mserv, mopts, popts = extract_dalli_options options
78
+
79
+ @pool =
80
+ if cache # caller passed a Dalli::Client or ConnectionPool instance
81
+ cache
82
+ elsif popts # caller passed ConnectionPool options
83
+ ConnectionPool.new(popts) { ::Dalli::Client.new(mserv, mopts) }
84
+ else
85
+ ::Dalli::Client.new(mserv, mopts)
86
+ end
87
+
88
+ if @pool.respond_to?(:alive!) # is a Dalli::Client
89
+ @mutex = Mutex.new
90
+
91
+ @pool.alive!
25
92
  end
26
93
  end
27
94
 
28
95
  def get_session(env, sid)
29
- with_lock(env, [nil, {}]) do
30
- unless sid and session = @pool.get(sid)
31
- sid, session = generate_sid, {}
32
- unless @pool.add(sid, session)
33
- raise "Session collision on '#{sid.inspect}'"
96
+ with_block(env, [nil, {}]) do |dc|
97
+ unless sid and !sid.empty? and session = dc.get(sid)
98
+ old_sid, sid, session = sid, generate_sid_with(dc), {}
99
+ unless dc.add(sid, session, @default_ttl)
100
+ sid = old_sid
101
+ redo # generate a new sid and try again
34
102
  end
35
103
  end
36
104
  [sid, session]
@@ -38,25 +106,67 @@ module Rack
38
106
  end
39
107
 
40
108
  def set_session(env, session_id, new_session, options)
41
- expiry = options[:expire_after]
42
- expiry = expiry.nil? ? 0 : expiry + 1
109
+ return false unless session_id
43
110
 
44
- with_lock(env, false) do
45
- @pool.set session_id, new_session, expiry
111
+ with_block(env, false) do |dc|
112
+ dc.set(session_id, new_session, ttl(options[:expire_after]))
46
113
  session_id
47
114
  end
48
115
  end
49
116
 
50
117
  def destroy_session(env, session_id, options)
51
- with_lock(env) do
52
- @pool.delete(session_id)
53
- generate_sid unless options[:drop]
118
+ with_block(env) do |dc|
119
+ dc.delete(session_id)
120
+ generate_sid_with(dc) unless options[:drop]
121
+ end
122
+ end
123
+
124
+ if defined?(Abstract::Persisted)
125
+ def find_session(req, sid)
126
+ get_session req.env, sid
127
+ end
128
+
129
+ def write_session(req, sid, session, options)
130
+ set_session req.env, sid, session, options
131
+ end
132
+
133
+ def delete_session(req, sid, options)
134
+ destroy_session req.env, sid, options
54
135
  end
55
136
  end
56
137
 
57
- def with_lock(env, default=nil)
58
- @mutex.lock if env['rack.multithread']
59
- yield
138
+ private
139
+
140
+ def extract_dalli_options(options)
141
+ return [options[:cache]] if options[:cache]
142
+
143
+ # Filter out Rack::Session-specific options and apply our defaults
144
+ mopts = DEFAULT_DALLI_OPTIONS.merge \
145
+ options.reject {|k, _| DEFAULT_OPTIONS.key? k }
146
+ mserv = mopts.delete :memcache_server
147
+
148
+ if mopts[:pool_size] || mopts[:pool_timeout]
149
+ popts = {}
150
+ popts[:size] = mopts.delete :pool_size if mopts[:pool_size]
151
+ popts[:timeout] = mopts.delete :pool_timeout if mopts[:pool_timeout]
152
+
153
+ # For a connection pool, locking is handled at the pool level
154
+ mopts[:threadsafe] = false unless mopts.key? :threadsafe
155
+ end
156
+
157
+ [nil, mserv, mopts, popts]
158
+ end
159
+
160
+ def generate_sid_with(dc)
161
+ while true
162
+ sid = generate_sid
163
+ break sid unless dc.get(sid)
164
+ end
165
+ end
166
+
167
+ def with_block(env, default=nil, &block)
168
+ @mutex.lock if @mutex and env['rack.multithread']
169
+ @pool.with(&block)
60
170
  rescue ::Dalli::DalliError, Errno::ECONNREFUSED
61
171
  raise if $!.message =~ /undefined class/
62
172
  if $VERBOSE
@@ -65,9 +175,12 @@ module Rack
65
175
  end
66
176
  default
67
177
  ensure
68
- @mutex.unlock if @mutex.locked?
178
+ @mutex.unlock if @mutex and @mutex.locked?
69
179
  end
70
180
 
181
+ def ttl(expire_after)
182
+ expire_after.nil? ? 0 : expire_after + 1
183
+ end
71
184
  end
72
185
  end
73
186
  end
metadata CHANGED
@@ -1,65 +1,31 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: dalli
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.7.0
4
+ version: 2.7.11
5
5
  platform: ruby
6
6
  authors:
7
+ - Peter M. Goldstein
7
8
  - Mike Perham
8
- autorequire:
9
+ autorequire:
9
10
  bindir: bin
10
11
  cert_chain: []
11
- date: 2014-01-07 00:00:00.000000000 Z
12
- dependencies:
13
- - !ruby/object:Gem::Dependency
14
- name: minitest
15
- requirement: !ruby/object:Gem::Requirement
16
- requirements:
17
- - - '>='
18
- - !ruby/object:Gem::Version
19
- version: 4.2.0
20
- type: :development
21
- prerelease: false
22
- version_requirements: !ruby/object:Gem::Requirement
23
- requirements:
24
- - - '>='
25
- - !ruby/object:Gem::Version
26
- version: 4.2.0
27
- - !ruby/object:Gem::Dependency
28
- name: mocha
29
- requirement: !ruby/object:Gem::Requirement
30
- requirements:
31
- - - '>='
32
- - !ruby/object:Gem::Version
33
- version: '0'
34
- type: :development
35
- prerelease: false
36
- version_requirements: !ruby/object:Gem::Requirement
37
- requirements:
38
- - - '>='
39
- - !ruby/object:Gem::Version
40
- version: '0'
41
- - !ruby/object:Gem::Dependency
42
- name: rails
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - ~>
46
- - !ruby/object:Gem::Version
47
- version: '3'
48
- type: :development
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - ~>
53
- - !ruby/object:Gem::Version
54
- version: '3'
12
+ date: 2020-09-26 00:00:00.000000000 Z
13
+ dependencies: []
55
14
  description: High performance memcached client for Ruby
56
- email: mperham@gmail.com
15
+ email:
16
+ - peter.m.goldstein@gmail.com
17
+ - mperham@gmail.com
57
18
  executables: []
58
19
  extensions: []
59
20
  extra_rdoc_files: []
60
21
  files:
22
+ - Gemfile
23
+ - History.md
24
+ - LICENSE
25
+ - README.md
61
26
  - lib/action_dispatch/middleware/session/dalli_store.rb
62
27
  - lib/active_support/cache/dalli_store.rb
28
+ - lib/dalli.rb
63
29
  - lib/dalli/cas/client.rb
64
30
  - lib/dalli/client.rb
65
31
  - lib/dalli/compressor.rb
@@ -69,68 +35,29 @@ files:
69
35
  - lib/dalli/server.rb
70
36
  - lib/dalli/socket.rb
71
37
  - lib/dalli/version.rb
72
- - lib/dalli.rb
73
38
  - lib/rack/session/dalli.rb
74
- - LICENSE
75
- - README.md
76
- - History.md
77
- - Rakefile
78
- - Gemfile
79
- - dalli.gemspec
80
- - Performance.md
81
- - test/benchmark_test.rb
82
- - test/helper.rb
83
- - test/memcached_mock.rb
84
- - test/sasldb
85
- - test/test_active_support.rb
86
- - test/test_cas_client.rb
87
- - test/test_compressor.rb
88
- - test/test_dalli.rb
89
- - test/test_encoding.rb
90
- - test/test_failover.rb
91
- - test/test_network.rb
92
- - test/test_rack_session.rb
93
- - test/test_ring.rb
94
- - test/test_sasl.rb
95
- - test/test_serializer.rb
96
- homepage: http://github.com/mperham/dalli
39
+ homepage: https://github.com/petergoldstein/dalli
97
40
  licenses:
98
41
  - MIT
99
42
  metadata: {}
100
- post_install_message:
101
- rdoc_options:
102
- - --charset=UTF-8
43
+ post_install_message:
44
+ rdoc_options: []
103
45
  require_paths:
104
46
  - lib
105
47
  required_ruby_version: !ruby/object:Gem::Requirement
106
48
  requirements:
107
- - - '>='
49
+ - - ">="
108
50
  - !ruby/object:Gem::Version
109
51
  version: '0'
110
52
  required_rubygems_version: !ruby/object:Gem::Requirement
111
53
  requirements:
112
- - - '>='
54
+ - - ">="
113
55
  - !ruby/object:Gem::Version
114
56
  version: '0'
115
57
  requirements: []
116
- rubyforge_project:
117
- rubygems_version: 2.0.14
118
- signing_key:
58
+ rubyforge_project:
59
+ rubygems_version: 2.7.6.2
60
+ signing_key:
119
61
  specification_version: 4
120
62
  summary: High performance memcached client for Ruby
121
- test_files:
122
- - test/benchmark_test.rb
123
- - test/helper.rb
124
- - test/memcached_mock.rb
125
- - test/sasldb
126
- - test/test_active_support.rb
127
- - test/test_cas_client.rb
128
- - test/test_compressor.rb
129
- - test/test_dalli.rb
130
- - test/test_encoding.rb
131
- - test/test_failover.rb
132
- - test/test_network.rb
133
- - test/test_rack_session.rb
134
- - test/test_ring.rb
135
- - test/test_sasl.rb
136
- - test/test_serializer.rb
63
+ test_files: []
data/Performance.md DELETED
@@ -1,42 +0,0 @@
1
- Performance
2
- ====================
3
-
4
- Caching is all about performance, so I carefully track Dalli performance to ensure no regressions.
5
- You can optionally use kgio to give Dalli a 10-20% performance boost: `gem install kgio`.
6
-
7
- Note I've added some benchmarks over time to Dalli that the other libraries don't necessarily have.
8
-
9
- memcache-client
10
- ---------------
11
-
12
- Testing 1.8.5 with ruby 1.9.3p0 (2011-10-30 revision 33570) [x86_64-darwin11.2.0]
13
-
14
- user system total real
15
- set:plain:memcache-client 1.860000 0.310000 2.170000 ( 2.188030)
16
- set:ruby:memcache-client 1.830000 0.290000 2.120000 ( 2.130212)
17
- get:plain:memcache-client 1.830000 0.340000 2.170000 ( 2.176156)
18
- get:ruby:memcache-client 1.900000 0.330000 2.230000 ( 2.235045)
19
- multiget:ruby:memcache-client 0.860000 0.120000 0.980000 ( 0.987348)
20
- missing:ruby:memcache-client 1.630000 0.320000 1.950000 ( 1.954867)
21
- mixed:ruby:memcache-client 3.690000 0.670000 4.360000 ( 4.364469)
22
-
23
-
24
- dalli
25
- -----
26
-
27
- Testing with Rails 3.2.1
28
- Using kgio socket IO
29
- Testing 2.0.0 with ruby 1.9.3p125 (2012-02-16 revision 34643) [x86_64-darwin11.3.0]
30
-
31
- user system total real
32
- mixed:rails:dalli 1.580000 0.570000 2.150000 ( 3.008839)
33
- set:plain:dalli 0.730000 0.300000 1.030000 ( 1.567098)
34
- setq:plain:dalli 0.520000 0.120000 0.640000 ( 0.634402)
35
- set:ruby:dalli 0.800000 0.300000 1.100000 ( 1.640348)
36
- get:plain:dalli 0.840000 0.330000 1.170000 ( 1.668425)
37
- get:ruby:dalli 0.850000 0.330000 1.180000 ( 1.665716)
38
- multiget:ruby:dalli 0.700000 0.260000 0.960000 ( 0.965423)
39
- missing:ruby:dalli 0.720000 0.320000 1.040000 ( 1.511720)
40
- mixed:ruby:dalli 1.660000 0.640000 2.300000 ( 3.320743)
41
- mixedq:ruby:dalli 1.630000 0.510000 2.140000 ( 2.629734)
42
- incr:ruby:dalli 0.270000 0.100000 0.370000 ( 0.547618)
data/Rakefile DELETED
@@ -1,42 +0,0 @@
1
- require 'appraisal'
2
- require 'rake/testtask'
3
- Rake::TestTask.new(:test) do |test|
4
- test.libs << 'test'
5
- test.pattern = 'test/**/test_*.rb'
6
- test.warning = true
7
- test.verbose = true
8
- end
9
-
10
- Rake::TestTask.new(:bench) do |test|
11
- test.libs << 'test'
12
- test.pattern = 'test/benchmark_test.rb'
13
- end
14
-
15
- begin
16
- require 'metric_fu'
17
- MetricFu::Configuration.run do |config|
18
- config.rcov[:rcov_opts] << "-Itest:lib"
19
- end
20
- rescue LoadError
21
- end
22
-
23
- task :default => :test
24
-
25
- task :test_all do
26
- system('rake test RAILS_VERSION="~> 3.0.0"')
27
- system('rake test RAILS_VERSION=">= 3.0.0"')
28
- end
29
-
30
- # 'gem install rdoc' to upgrade RDoc if this is giving you errors
31
- begin
32
- require 'rdoc/task'
33
- RDoc::Task.new do |rd|
34
- rd.rdoc_files.include("lib/**/*.rb")
35
- end
36
- rescue LoadError
37
- puts "Unable to load rdoc, run 'gem install rdoc' to fix this."
38
- end
39
-
40
- require 'rake/clean'
41
- CLEAN.include "**/*.rbc"
42
- CLEAN.include "**/.DS_Store"