memcache-auth 0.17.7 → 1.0.0

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/Manifest CHANGED
@@ -10,6 +10,7 @@ ext/libmemcached-0.35+sasl.tar.gz
10
10
  ext/rlibmemcached.i
11
11
  ext/rlibmemcached_wrap.c
12
12
  lib/memcached.rb
13
+ lib/memcache-auth.rb
13
14
  lib/memcached/auth.rb
14
15
  lib/memcached/behaviors.rb
15
16
  lib/memcached/exceptions.rb
data/Rakefile CHANGED
@@ -1,13 +1,14 @@
1
1
  require 'echoe'
2
2
 
3
3
  Echoe.new("memcache-auth") do |p|
4
- p.author = "Evan Weaver - updated by NorthScale for auth support"
5
- p.project = "Memcache-Auth"
6
- p.summary = "An interface to the libmemcached C client + sasl auth support."
7
- p.url = "http://github.com/seanlynch/libmemcached-ruby"
4
+ p.author = "Evan Weaver"
5
+ p.project = "fauna"
6
+ p.summary = "An interface to the libmemcached C client."
7
+ p.url = "http://blog.evanweaver.com/files/doc/fauna/memcached/"
8
8
  p.docs_host = "blog.evanweaver.com:~/www/bax/public/files/doc/"
9
9
  p.rdoc_pattern = /README|TODO|LICENSE|CHANGELOG|BENCH|COMPAT|exceptions|behaviors|rails.rb|memcached.rb/
10
10
  p.clean_pattern += ["ext/lib", "ext/include", "ext/share", "ext/libmemcached-?.??", "ext/bin", "ext/conftest.dSYM"]
11
+ p.version = '1.0.0'
11
12
  end
12
13
 
13
14
  task :exceptions do
Binary file
@@ -0,0 +1,7 @@
1
+ require File.dirname(__FILE__) + 'memcached'
2
+
3
+ class MemcacheAuth < Memcached
4
+ end
5
+
6
+ class MemcacheAuth::Rails < Memcached::Rails
7
+ end
@@ -7,7 +7,6 @@ class Memcached
7
7
 
8
8
  def set_credentials
9
9
  # If credentials aren't provided, try to get them from the environment
10
- print options[:credentials]
11
10
  if options[:credentials] != nil
12
11
  username, password = options[:credentials]
13
12
  check_return_code(Lib.memcached_set_sasl_auth_data(@struct, username, password))
@@ -82,7 +82,7 @@ Please note that when pipelining is enabled, setter and deleter methods do not r
82
82
  # Track structs so we can free them
83
83
  @@structs = {}
84
84
 
85
- def initialize(servers = "localhost:11211", opts = {})
85
+ def initialize(servers = nil, opts = {})
86
86
  @struct = Lib::MemcachedSt.new
87
87
  Lib.memcached_create(@struct)
88
88
  @@structs[object_id] = @struct
@@ -92,6 +92,14 @@ Please note that when pipelining is enabled, setter and deleter methods do not r
92
92
  @options.delete_if { |k,v| not DEFAULTS.keys.include? k }
93
93
  @default_ttl = options[:default_ttl]
94
94
 
95
+ if servers == nil || servers == []
96
+ if ENV.key?("MEMCACHE_SERVERS")
97
+ servers = ENV["MEMCACHE_SERVERS"].split(",").map do | s | s.strip end
98
+ else
99
+ servers = "127.0.0.1:11211"
100
+ end
101
+ end
102
+
95
103
  if options[:credentials] == nil && ENV.key?("MEMCACHE_USERNAME") && ENV.key?("MEMCACHE_PASSWORD")
96
104
  options[:credentials] = [ENV["MEMCACHE_USERNAME"], ENV["MEMCACHE_PASSWORD"]]
97
105
  end
@@ -406,10 +414,10 @@ Please note that when pipelining is enabled, setter and deleter methods do not r
406
414
  end
407
415
 
408
416
  # Return a Hash of statistics responses from the set of servers. Each value is an array with one entry for each server, in the same order the servers were defined.
409
- def stats
417
+ def stats(subcommand=nil)
410
418
  stats = Hash.new([])
411
419
 
412
- stat_struct, ret = Lib.memcached_stat(@struct, "")
420
+ stat_struct, ret = Lib.memcached_stat(@struct, subcommand)
413
421
  check_return_code(ret)
414
422
 
415
423
  keys, ret = Lib.memcached_stat_get_keys(@struct, stat_struct)
@@ -2,22 +2,22 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = %q{memcache-auth}
5
- s.version = "0.17.7"
5
+ s.version = "1.0.0"
6
6
 
7
7
  s.required_rubygems_version = Gem::Requirement.new(">= 1.2") if s.respond_to? :required_rubygems_version=
8
- s.authors = ["Evan Weaver - updated by NorthScale for auth support"]
9
- s.date = %q{2010-01-19}
10
- s.description = %q{An interface to the libmemcached C client + sasl auth support.}
8
+ s.authors = ["Evan Weaver"]
9
+ s.date = %q{2010-01-25}
10
+ s.description = %q{An interface to the libmemcached C client.}
11
11
  s.email = %q{}
12
12
  s.extensions = ["ext/extconf.rb"]
13
13
  s.extra_rdoc_files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "README", "TODO", "lib/memcached.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb"]
14
- s.files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "TODO", "ext/extconf.rb", "ext/libmemcached-0.35+sasl.tar.gz", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "lib/memcached.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/integer.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "test/profile/benchmark.rb", "test/profile/profile.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb", "memcache-auth.gemspec"]
15
- s.homepage = %q{http://github.com/seanlynch/libmemcached-ruby}
14
+ s.files = ["BENCHMARKS", "CHANGELOG", "LICENSE", "Manifest", "README", "Rakefile", "TODO", "ext/extconf.rb", "ext/libmemcached-0.35+sasl.tar.gz", "ext/rlibmemcached.i", "ext/rlibmemcached_wrap.c", "lib/memcached.rb", "lib/memcache-auth.rb", "lib/memcached/auth.rb", "lib/memcached/behaviors.rb", "lib/memcached/exceptions.rb", "lib/memcached/integer.rb", "lib/memcached/memcached.rb", "lib/memcached/rails.rb", "test/profile/benchmark.rb", "test/profile/profile.rb", "test/profile/valgrind.rb", "test/setup.rb", "test/teardown.rb", "test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb", "memcache-auth.gemspec"]
15
+ s.homepage = %q{http://blog.evanweaver.com/files/doc/fauna/memcached/}
16
16
  s.rdoc_options = ["--line-numbers", "--inline-source", "--title", "Memcache-auth", "--main", "README"]
17
17
  s.require_paths = ["lib", "ext"]
18
- s.rubyforge_project = %q{Memcache-Auth}
18
+ s.rubyforge_project = %q{fauna}
19
19
  s.rubygems_version = %q{1.3.5}
20
- s.summary = %q{An interface to the libmemcached C client + sasl auth support.}
20
+ s.summary = %q{An interface to the libmemcached C client.}
21
21
  s.test_files = ["test/test_helper.rb", "test/unit/binding_test.rb", "test/unit/memcached_test.rb", "test/unit/rails_test.rb"]
22
22
 
23
23
  if s.respond_to? :specification_version then
metadata CHANGED
@@ -1,19 +1,19 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: memcache-auth
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.17.7
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
- - Evan Weaver - updated by NorthScale for auth support
7
+ - Evan Weaver
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
 
12
- date: 2010-01-19 00:00:00 -08:00
12
+ date: 2010-01-25 00:00:00 -08:00
13
13
  default_executable:
14
14
  dependencies: []
15
15
 
16
- description: An interface to the libmemcached C client + sasl auth support.
16
+ description: An interface to the libmemcached C client.
17
17
  email: ""
18
18
  executables: []
19
19
 
@@ -43,6 +43,7 @@ files:
43
43
  - ext/rlibmemcached.i
44
44
  - ext/rlibmemcached_wrap.c
45
45
  - lib/memcached.rb
46
+ - lib/memcache-auth.rb
46
47
  - lib/memcached/auth.rb
47
48
  - lib/memcached/behaviors.rb
48
49
  - lib/memcached/exceptions.rb
@@ -60,7 +61,7 @@ files:
60
61
  - test/unit/rails_test.rb
61
62
  - memcache-auth.gemspec
62
63
  has_rdoc: true
63
- homepage: http://github.com/seanlynch/libmemcached-ruby
64
+ homepage: http://blog.evanweaver.com/files/doc/fauna/memcached/
64
65
  licenses: []
65
66
 
66
67
  post_install_message:
@@ -88,11 +89,11 @@ required_rubygems_version: !ruby/object:Gem::Requirement
88
89
  version:
89
90
  requirements: []
90
91
 
91
- rubyforge_project: Memcache-Auth
92
+ rubyforge_project: fauna
92
93
  rubygems_version: 1.3.5
93
94
  signing_key:
94
95
  specification_version: 3
95
- summary: An interface to the libmemcached C client + sasl auth support.
96
+ summary: An interface to the libmemcached C client.
96
97
  test_files:
97
98
  - test/test_helper.rb
98
99
  - test/unit/binding_test.rb