redis 0.0.1 → 0.1

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,4 @@
1
+ require 'rubygems'
2
+ $TESTING=true
3
+ $:.unshift File.join(File.dirname(__FILE__), '..', 'lib')
4
+ require 'redis'
@@ -0,0 +1,136 @@
1
+ # Inspired by rabbitmq.rake the Redbox project at http://github.com/rick/redbox/tree/master
2
+ require 'rake'
3
+ require 'fileutils'
4
+ require 'open-uri'
5
+
6
+ class RedisRunner
7
+
8
+ def self.redisdir
9
+ "/tmp/redis/"
10
+ end
11
+
12
+ def self.redisconfdir
13
+ '/etc/redis.conf'
14
+ end
15
+
16
+ def self.dtach_socket
17
+ '/tmp/redis.dtach'
18
+ end
19
+
20
+ # Just check for existance of dtach socket
21
+ def self.running?
22
+ File.exists? dtach_socket
23
+ end
24
+
25
+ def self.start
26
+ puts 'Detach with Ctrl+\ Re-attach with rake redis:attach'
27
+ sleep 3
28
+ exec "dtach -A #{dtach_socket} redis-server #{redisconfdir}"
29
+ end
30
+
31
+ def self.start_detached
32
+ system "dtach -n #{dtach_socket} redis-server #{redisconfdir}"
33
+ end
34
+
35
+ def self.attach
36
+ exec "dtach -a #{dtach_socket}"
37
+ end
38
+
39
+ def self.stop
40
+ system 'echo "SHUTDOWN" | nc localhost 6379'
41
+ end
42
+
43
+ end
44
+
45
+ namespace :redis do
46
+
47
+ desc 'About redis'
48
+ task :about do
49
+ puts "\nSee http://code.google.com/p/redis/ for information about redis.\n\n"
50
+ end
51
+
52
+ desc 'Start redis'
53
+ task :start do
54
+ RedisRunner.start
55
+ end
56
+
57
+ desc 'Stop redis'
58
+ task :stop do
59
+ RedisRunner.stop
60
+ end
61
+
62
+ desc 'Restart redis'
63
+ task :restart do
64
+ RedisRunner.stop
65
+ RedisRunner.start
66
+ end
67
+
68
+ desc 'Attach to redis dtach socket'
69
+ task :attach do
70
+ RedisRunner.attach
71
+ end
72
+
73
+ desc 'Install the lastest verison of Redis from Github (requires git, duh)'
74
+ task :install => [:about, :download, :make] do
75
+ %w(redis-benchmark redis-cli redis-server).each do |bin|
76
+ sh "sudo cp /tmp/redis/#{bin} /usr/bin/"
77
+ end
78
+
79
+ puts "Installed redis-benchmark, redis-cli and redis-server to /usr/bin/"
80
+
81
+ unless File.exists?('/etc/redis.conf')
82
+ sh 'sudo cp /tmp/redis/redis.conf /etc/'
83
+ puts "Installed redis.conf to /etc/ \n You should look at this file!"
84
+ end
85
+ end
86
+
87
+ task :make do
88
+ sh "cd #{RedisRunner.redisdir} && make clean"
89
+ sh "cd #{RedisRunner.redisdir} && make"
90
+ end
91
+
92
+ desc "Download package"
93
+ task :download do
94
+ sh 'rm -rf /tmp/redis/' if File.exists?("#{RedisRunner.redisdir}/.svn")
95
+ sh 'git clone git://github.com/antirez/redis.git /tmp/redis' unless File.exists?(RedisRunner.redisdir)
96
+ sh "cd #{RedisRunner.redisdir} && git pull" if File.exists?("#{RedisRunner.redisdir}/.git")
97
+ end
98
+
99
+ desc "Open an IRb session"
100
+ task :console do
101
+ RedisRunner.start_detached
102
+ system "irb -I lib -I extra -r redis.rb"
103
+ RedisRunner.stop
104
+ end
105
+ end
106
+
107
+ namespace :dtach do
108
+
109
+ desc 'About dtach'
110
+ task :about do
111
+ puts "\nSee http://dtach.sourceforge.net/ for information about dtach.\n\n"
112
+ end
113
+
114
+ desc 'Install dtach 0.8 from source'
115
+ task :install => [:about] do
116
+
117
+ Dir.chdir('/tmp/')
118
+ unless File.exists?('/tmp/dtach-0.8.tar.gz')
119
+ require 'net/http'
120
+
121
+ url = 'http://downloads.sourceforge.net/project/dtach/dtach/0.8/dtach-0.8.tar.gz'
122
+ open('/tmp/dtach-0.8.tar.gz', 'wb') do |file| file.write(open(url).read) end
123
+ end
124
+
125
+ unless File.directory?('/tmp/dtach-0.8')
126
+ system('tar xzf dtach-0.8.tar.gz')
127
+ end
128
+
129
+ Dir.chdir('/tmp/dtach-0.8/')
130
+ sh 'cd /tmp/dtach-0.8/ && ./configure && make'
131
+ sh 'sudo cp /tmp/dtach-0.8/dtach /usr/bin/'
132
+
133
+ puts 'Dtach successfully installed to /usr/bin.'
134
+ end
135
+ end
136
+
metadata CHANGED
@@ -1,30 +1,54 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: redis
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: "0.1"
5
5
  platform: ruby
6
6
  authors:
7
- - TBD
8
- autorequire:
7
+ - Ezra Zygmuntowicz
8
+ - Taylor Weibley
9
+ - Matthew Clark
10
+ - Brian McKinney
11
+ - Salvatore Sanfilippo
12
+ - Luca Guidi
13
+ autorequire: redis
9
14
  bindir: bin
10
15
  cert_chain: []
11
16
 
12
- date: 2009-06-10 00:00:00 -03:00
17
+ date: 2009-10-28 00:00:00 -07:00
13
18
  default_executable:
14
- dependencies: []
15
-
16
- description: TBD
17
- email: TBD
19
+ dependencies:
20
+ - !ruby/object:Gem::Dependency
21
+ name: rspec
22
+ type: :runtime
23
+ version_requirement:
24
+ version_requirements: !ruby/object:Gem::Requirement
25
+ requirements:
26
+ - - ">="
27
+ - !ruby/object:Gem::Version
28
+ version: "0"
29
+ version:
30
+ description: Ruby client library for redis key value storage server
31
+ email: ez@engineyard.com
18
32
  executables: []
19
33
 
20
34
  extensions: []
21
35
 
22
- extra_rdoc_files: []
23
-
24
- files: []
25
-
36
+ extra_rdoc_files:
37
+ - LICENSE
38
+ files:
39
+ - LICENSE
40
+ - README.markdown
41
+ - Rakefile
42
+ - lib/dist_redis.rb
43
+ - lib/hash_ring.rb
44
+ - lib/pipeline.rb
45
+ - lib/redis/raketasks.rb
46
+ - lib/redis.rb
47
+ - tasks/redis.tasks.rb
48
+ - spec/redis_spec.rb
49
+ - spec/spec_helper.rb
26
50
  has_rdoc: true
27
- homepage:
51
+ homepage: http://github.com/ezmobius/redis-rb
28
52
  licenses: []
29
53
 
30
54
  post_install_message:
@@ -47,9 +71,9 @@ required_rubygems_version: !ruby/object:Gem::Requirement
47
71
  requirements: []
48
72
 
49
73
  rubyforge_project:
50
- rubygems_version: 1.3.4
74
+ rubygems_version: 1.3.5
51
75
  signing_key:
52
76
  specification_version: 3
53
- summary: TBD
77
+ summary: Ruby client library for redis key value storage server
54
78
  test_files: []
55
79