redis-store 0.3.8 → 0.3.9

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

Potentially problematic release.


This version of redis-store might be problematic. Click here for more details.

data/Gemfile.lock ADDED
@@ -0,0 +1,181 @@
1
+ GEM
2
+ remote: http://rubygems.org/
3
+ specs:
4
+ ParseTree (3.0.5)
5
+ RubyInline (>= 3.7.0)
6
+ sexp_processor (>= 3.0.0)
7
+ RubyInline (3.8.4)
8
+ ZenTest
9
+ ZenTest (4.3.3)
10
+ abstract (1.0.0)
11
+ actionpack (2.3.5)
12
+ activesupport (= 2.3.5)
13
+ rack (~> 1.0.0)
14
+ activesupport (2.3.5)
15
+ addressable (2.1.2)
16
+ bcrypt-ruby (2.1.2)
17
+ columnize (0.3.1)
18
+ data_objects (0.10.2)
19
+ addressable (~> 2.1)
20
+ diff-lcs (1.1.2)
21
+ dm-aggregates (0.10.2)
22
+ dm-core (~> 0.10.2)
23
+ dm-constraints (0.10.2)
24
+ dm-core (~> 0.10.2)
25
+ dm-core (0.10.2)
26
+ addressable (~> 2.1)
27
+ extlib (~> 0.9.14)
28
+ dm-migrations (0.10.2)
29
+ dm-core (~> 0.10.2)
30
+ dm-serializer (0.10.2)
31
+ dm-core (~> 0.10.2)
32
+ fastercsv (~> 1.5.0)
33
+ json_pure (~> 1.2.0)
34
+ dm-sweatshop (0.10.2)
35
+ dm-core (~> 0.10.2)
36
+ randexp (~> 0.1.4)
37
+ dm-timestamps (0.10.2)
38
+ dm-core (~> 0.10.2)
39
+ dm-types (0.10.2)
40
+ bcrypt-ruby (~> 2.1.2)
41
+ dm-core (~> 0.10.2)
42
+ fastercsv (~> 1.5.0)
43
+ json_pure (~> 1.2.0)
44
+ stringex (~> 1.1.0)
45
+ uuidtools (~> 2.1.1)
46
+ dm-validations (0.10.2)
47
+ dm-core (~> 0.10.2)
48
+ do_sqlite3 (0.10.2)
49
+ data_objects (= 0.10.2)
50
+ erubis (2.6.6)
51
+ abstract (>= 1.0.0)
52
+ extlib (0.9.15)
53
+ fastercsv (1.5.3)
54
+ gemcutter (0.6.1)
55
+ git (1.2.5)
56
+ haml (3.0.15)
57
+ highline (1.6.1)
58
+ jeweler (1.4.0)
59
+ gemcutter (>= 0.1.0)
60
+ git (>= 1.2.5)
61
+ rubyforge (>= 2.0.0)
62
+ json_pure (1.2.4)
63
+ linecache (0.43)
64
+ mailfactory (1.4.0)
65
+ mime-types (>= 1.13.1)
66
+ merb (1.1.0)
67
+ dm-aggregates (~> 0.10)
68
+ dm-constraints (~> 0.10)
69
+ dm-serializer (~> 0.10)
70
+ dm-sweatshop (~> 0.10)
71
+ dm-timestamps (~> 0.10)
72
+ dm-types (~> 0.10)
73
+ dm-validations (~> 0.10)
74
+ do_sqlite3 (~> 0.10)
75
+ merb-action-args (= 1.1.0)
76
+ merb-assets (= 1.1.0)
77
+ merb-auth (= 1.1.0)
78
+ merb-cache (= 1.1.0)
79
+ merb-core (= 1.1.0)
80
+ merb-exceptions (= 1.1.0)
81
+ merb-gen (= 1.1.0)
82
+ merb-haml (= 1.1.0)
83
+ merb-helpers (= 1.1.0)
84
+ merb-mailer (= 1.1.0)
85
+ merb-param-protection (= 1.1.0)
86
+ merb-slices (= 1.1.0)
87
+ merb_datamapper (= 1.1.0)
88
+ merb-action-args (1.1.0)
89
+ ParseTree (>= 2.1.1)
90
+ merb-core (~> 1.1.0)
91
+ ruby2ruby (>= 1.1.9)
92
+ merb-assets (1.1.0)
93
+ merb-core (~> 1.1.0)
94
+ merb-auth (1.1.0)
95
+ merb-auth-core (~> 1.1.0)
96
+ merb-auth-more (~> 1.1.0)
97
+ merb-auth-slice-password (~> 1.1.0)
98
+ merb-core (~> 1.1.0)
99
+ merb-auth-core (1.1.1)
100
+ merb-core (~> 1.1)
101
+ merb-auth-more (1.1.1)
102
+ merb-auth-core (~> 1.1.1)
103
+ merb-auth-slice-password (1.1.1)
104
+ merb-auth-core (~> 1.1.1)
105
+ merb-auth-more (~> 1.1.1)
106
+ merb-slices (~> 1.1)
107
+ merb-cache (1.1.0)
108
+ merb-core (~> 1.1.0)
109
+ merb-core (1.1.0)
110
+ bundler (>= 0.9.3)
111
+ erubis (>= 2.6.2)
112
+ extlib (>= 0.9.13)
113
+ mime-types (>= 1.16)
114
+ rack
115
+ rake
116
+ rspec
117
+ merb-exceptions (1.1.0)
118
+ merb-core (~> 1.1.0)
119
+ merb-mailer (~> 1.1.0)
120
+ merb-gen (1.1.0)
121
+ merb-core (~> 1.1.0)
122
+ templater (>= 1.0.0)
123
+ merb-haml (1.1.0)
124
+ haml (>= 2.0.3)
125
+ merb-core (~> 1.1.0)
126
+ merb-helpers (1.1.0)
127
+ merb-core (~> 1.1.0)
128
+ merb-mailer (1.1.0)
129
+ mailfactory (>= 1.2.3)
130
+ merb-core (~> 1.1.0)
131
+ merb-param-protection (1.1.0)
132
+ merb-core (~> 1.1.0)
133
+ merb-slices (1.1.0)
134
+ merb-core (~> 1.1.0)
135
+ merb_datamapper (1.1.0)
136
+ dm-core (~> 0.10)
137
+ dm-migrations (~> 0.10)
138
+ merb-core (~> 1.1.0)
139
+ mime-types (1.16)
140
+ rack (1.0.0)
141
+ rack-cache (0.5.2)
142
+ rack (>= 0.4)
143
+ rake (0.8.7)
144
+ randexp (0.1.5)
145
+ ParseTree
146
+ redis (1.0.5)
147
+ rspec (1.3.0)
148
+ ruby-debug (0.10.3)
149
+ columnize (>= 0.1)
150
+ ruby-debug-base (~> 0.10.3.0)
151
+ ruby-debug-base (0.10.3)
152
+ linecache (>= 0.3)
153
+ ruby2ruby (1.2.4)
154
+ ruby_parser (~> 2.0)
155
+ sexp_processor (~> 3.0)
156
+ ruby_parser (2.0.4)
157
+ sexp_processor (~> 3.0)
158
+ rubyforge (2.0.4)
159
+ json_pure (>= 1.1.7)
160
+ sexp_processor (3.0.4)
161
+ stringex (1.1.0)
162
+ templater (1.0.0)
163
+ diff-lcs (>= 1.1.2)
164
+ extlib (>= 0.9.5)
165
+ highline (>= 1.4.0)
166
+ uuidtools (2.1.1)
167
+
168
+ PLATFORMS
169
+ ruby
170
+
171
+ DEPENDENCIES
172
+ actionpack (= 2.3.5)
173
+ activesupport (= 2.3.5)
174
+ git
175
+ jeweler
176
+ merb
177
+ rack (= 1.0.0)
178
+ rack-cache
179
+ redis (= 1.0.5)
180
+ rspec
181
+ ruby-debug
data/MIT-LICENSE CHANGED
@@ -1,4 +1,4 @@
1
- Copyright (c) 2009 Luca Guidi
1
+ Copyright (c) 2009-2010 Luca Guidi
2
2
 
3
3
  Permission is hereby granted, free of charge, to any person obtaining
4
4
  a copy of this software and associated documentation files (the
data/README.md CHANGED
@@ -4,15 +4,15 @@
4
4
 
5
5
  Download and install Redis from [http://code.google.com/p/redis/](http://code.google.com/p/redis/)
6
6
 
7
- curl -OL http://redis.googlecode.com/files/redis-1.02.tar.gz
8
- tar -zxvf redis-1.02.tar.gz
9
- mv redis-1.02 redis
7
+ curl -OL http://redis.googlecode.com/files/redis-1.2.5.tar.gz
8
+ tar -zxvf redis-1.2.5.tar.gz
9
+ mv redis-1.2.5 redis
10
10
  cd redis
11
11
  make
12
12
 
13
13
  Install the gems
14
14
 
15
- sudo gem install redis-rb redis-store
15
+ sudo gem install redis redis-store
16
16
 
17
17
  ## Cache store
18
18
 
@@ -26,7 +26,7 @@ Provides a cache store for your Ruby web framework of choice.
26
26
 
27
27
  ### Merb
28
28
 
29
- dependency "redis-store", "0.3.7"
29
+ dependency "redis-store", "0.3.9"
30
30
  dependency("merb-cache", merb_gems_version) do
31
31
  Merb::Cache.setup do
32
32
  register(:redis, Merb::Cache::RedisStore, :servers => ["127.0.0.1:6379"])
@@ -58,12 +58,12 @@ Provides a Redis store for Rack::Session. See [http://rack.rubyforge.org/doc/Rac
58
58
 
59
59
  ### Rails
60
60
 
61
- config.gem "redis-store", :source => "http://gemcutter.org", :lib => "redis-store"
62
- ActionController::Base.session_store = Rack::Session::Redis
61
+ config.gem "redis-store"
62
+ ActionController::Base.session_store = :redis_session_store
63
63
 
64
64
  ### Merb
65
65
 
66
- dependency "redis-store", "0.3.7"
66
+ dependency "redis-store", "0.3.9"
67
67
  Merb::Config.use do |c|
68
68
  c[:session_store] = "redis"
69
69
  end
@@ -103,13 +103,13 @@ Provides a Redis store for HTTP caching. See [http://github.com/rtomayko/rack-ca
103
103
  gem install jeweler bundler
104
104
  git clone git://github.com/jodosha/redis-store.git
105
105
  cd redis-store
106
- gem bundle
106
+ bundle install
107
107
  rake dtach:install
108
108
  rake redis:install
109
109
  rake
110
110
 
111
- If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" gem bundle`
111
+ If you are on **Snow Leopard** you have to run `env ARCHFLAGS="-arch x86_64" bundle install`
112
112
 
113
113
  ## Copyright
114
114
 
115
- (c) 2009 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license
115
+ (c) 2010 Luca Guidi - [http://lucaguidi.com](http://lucaguidi.com), released under the MIT license
data/VERSION CHANGED
@@ -1 +1 @@
1
- 0.3.8
1
+ 0.3.9
@@ -13,6 +13,6 @@ class Redis
13
13
  ring.nodes
14
14
  end
15
15
 
16
- alias_method :flushdb, :delete_cloud!
16
+ alias_method :flushdb, :delete_cloud! if respond_to?(:delete_cloud!)
17
17
  end
18
18
  end
data/redis-store.gemspec CHANGED
@@ -5,11 +5,11 @@
5
5
 
6
6
  Gem::Specification.new do |s|
7
7
  s.name = %q{redis-store}
8
- s.version = "0.3.8"
8
+ s.version = "0.3.9"
9
9
 
10
10
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
11
  s.authors = ["Luca Guidi"]
12
- s.date = %q{2010-05-21}
12
+ s.date = %q{2010-08-06}
13
13
  s.description = %q{Rack::Session, Rack::Cache and cache Redis stores for Ruby web frameworks.}
14
14
  s.email = %q{guidi.luca@gmail.com}
15
15
  s.extra_rdoc_files = [
@@ -18,6 +18,7 @@ Gem::Specification.new do |s|
18
18
  s.files = [
19
19
  ".gitignore",
20
20
  "Gemfile",
21
+ "Gemfile.lock",
21
22
  "MIT-LICENSE",
22
23
  "README.md",
23
24
  "Rakefile",
data/tasks/redis.tasks.rb CHANGED
@@ -1,25 +1,44 @@
1
- # steal the cool tasks from redis-rb
2
- require 'rbconfig'
3
- require "rubygems"
4
- require "bundler"
5
- Bundler.setup
6
- redis_path = $:.
7
- find {|path| path =~ /redis-/ }.
8
- split("/").
9
- tap do |array|
10
- array.replace(
11
- array[0..array.index(array.find {|segment| segment =~ /redis-/})]
12
- )
13
- end.
14
- join("/")
15
-
16
- load "#{redis_path}/tasks/redis.tasks.rb"
1
+ # inspired by old Rake tasks from redis-rb
2
+ require 'rake'
3
+ require 'fileutils'
4
+ require 'open-uri'
17
5
 
18
6
  class RedisRunner
19
7
  def self.port
20
8
  6379
21
9
  end
22
10
 
11
+ def self.redisdir
12
+ @@redisdir ||= File.expand_path File.join(File.dirname(__FILE__), '..', 'vendor', 'redis')
13
+ end
14
+
15
+ def self.redisconfdir
16
+ '/etc/redis.conf'
17
+ end
18
+
19
+ def self.dtach_socket
20
+ '/tmp/redis.dtach'
21
+ end
22
+
23
+ # Just check for existance of dtach socket
24
+ def self.running?
25
+ File.exists? dtach_socket
26
+ end
27
+
28
+ def self.start
29
+ puts 'Detach with Ctrl+\ Re-attach with rake redis:attach'
30
+ sleep 3
31
+ exec "dtach -A #{dtach_socket} redis-server #{redisconfdir}"
32
+ end
33
+
34
+ def self.start_detached
35
+ system "dtach -n #{dtach_socket} redis-server #{redisconfdir}"
36
+ end
37
+
38
+ def self.attach
39
+ exec "dtach -a #{dtach_socket}"
40
+ end
41
+
23
42
  def self.stop
24
43
  system %(echo "SHUTDOWN" | nc localhost #{port})
25
44
  end
@@ -76,3 +95,126 @@ class RedisClusterRunner
76
95
  end
77
96
  end
78
97
  end
98
+
99
+ namespace :redis do
100
+ desc 'About redis'
101
+ task :about do
102
+ puts "\nSee http://code.google.com/p/redis/ for information about redis.\n\n"
103
+ end
104
+
105
+ desc 'Start redis'
106
+ task :start do
107
+ RedisRunner.start
108
+ end
109
+
110
+ desc 'Stop redis'
111
+ task :stop do
112
+ RedisRunner.stop
113
+ end
114
+
115
+ desc 'Restart redis'
116
+ task :restart do
117
+ RedisRunner.stop
118
+ RedisRunner.start
119
+ end
120
+
121
+ desc 'Attach to redis dtach socket'
122
+ task :attach do
123
+ RedisRunner.attach
124
+ end
125
+
126
+ desc 'Install the lastest verison of Redis from Github (requires git, duh)'
127
+ task :install => [ :about, :download, :make ] do
128
+ %w(redis-benchmark redis-cli redis-server).each do |bin|
129
+ if File.exist?(path = "#{RedisRunner.redisdir}/src/#{bin}")
130
+ sh "sudo cp #{path} /usr/bin/"
131
+ else
132
+ sh "sudo cp #{RedisRunner.redisdir}/#{bin} /usr/bin/"
133
+ end
134
+ end
135
+
136
+ puts "Installed redis-benchmark, redis-cli and redis-server to /usr/bin/"
137
+
138
+ sh "sudo cp #{RedisRunner.redisdir}/redis.conf /etc/"
139
+ puts "Installed redis.conf to /etc/ \n You should look at this file!"
140
+ end
141
+
142
+ task :make do
143
+ sh "cd #{RedisRunner.redisdir} && make clean"
144
+ sh "cd #{RedisRunner.redisdir} && make"
145
+ end
146
+
147
+ desc "Download package"
148
+ task :download do
149
+ require 'git'
150
+
151
+ sh "rm -rf #{RedisRunner.redisdir} && mkdir -p vendor && rm -rf redis"
152
+ Git.clone("git://github.com/antirez/redis.git", "redis")
153
+ sh "mv redis vendor"
154
+
155
+ commit = case ENV['VERSION']
156
+ when "1.2.6": "570e43c8285a4e5e3f31"
157
+ end
158
+
159
+ arguments = commit.nil? ? "pull origin master" : "reset --hard #{commit}"
160
+ sh "cd #{RedisRunner.redisdir} && git #{arguments}"
161
+ end
162
+
163
+ desc "Open an IRb session"
164
+ task :console do
165
+ RedisRunner.start_detached
166
+ system "bundle exec irb -I lib -I extra -r redis-store.rb"
167
+ RedisRunner.stop
168
+ end
169
+
170
+ namespace :cluster do
171
+ desc "Starts the redis_cluster"
172
+ task :start do
173
+ result = RedisClusterRunner.start_detached
174
+ raise("Could not start redis-server, aborting.") unless result
175
+ end
176
+
177
+ desc "Stops the redis_cluster"
178
+ task :stop do
179
+ RedisClusterRunner.stop
180
+ end
181
+ end
182
+ end
183
+
184
+ namespace :dtach do
185
+ desc 'About dtach'
186
+ task :about do
187
+ puts "\nSee http://dtach.sourceforge.net/ for information about dtach.\n\n"
188
+ end
189
+
190
+ desc 'Install dtach 0.8 from source'
191
+ task :install => [:about] do
192
+
193
+ Dir.chdir('/tmp/')
194
+ unless File.exists?('/tmp/dtach-0.8.tar.gz')
195
+ require 'net/http'
196
+
197
+ url = 'http://downloads.sourceforge.net/project/dtach/dtach/0.8/dtach-0.8.tar.gz'
198
+ open('/tmp/dtach-0.8.tar.gz', 'wb') do |file| file.write(open(url).read) end
199
+ end
200
+
201
+ unless File.directory?('/tmp/dtach-0.8')
202
+ system('tar xzf dtach-0.8.tar.gz')
203
+ end
204
+
205
+ Dir.chdir('/tmp/dtach-0.8/')
206
+ sh 'cd /tmp/dtach-0.8/ && ./configure && make'
207
+ sh 'sudo cp /tmp/dtach-0.8/dtach /usr/bin/'
208
+
209
+ puts 'Dtach successfully installed to /usr/bin.'
210
+ end
211
+ end
212
+
213
+ def invoke_with_redis_cluster(task_name)
214
+ begin
215
+ Rake::Task["redis:cluster:start"].invoke
216
+ Rake::Task[task_name].invoke
217
+ ensure
218
+ Rake::Task["redis:cluster:stop"].invoke
219
+ end
220
+ end
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis-store
3
3
  version: !ruby/object:Gem::Version
4
- hash: 3
4
+ hash: 1
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 3
9
- - 8
10
- version: 0.3.8
9
+ - 9
10
+ version: 0.3.9
11
11
  platform: ruby
12
12
  authors:
13
13
  - Luca Guidi
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2010-05-21 00:00:00 +02:00
18
+ date: 2010-08-06 00:00:00 +02:00
19
19
  default_executable:
20
20
  dependencies: []
21
21
 
@@ -30,6 +30,7 @@ extra_rdoc_files:
30
30
  files:
31
31
  - .gitignore
32
32
  - Gemfile
33
+ - Gemfile.lock
33
34
  - MIT-LICENSE
34
35
  - README.md
35
36
  - Rakefile