Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 69 lines (53 sloc) 1.494 kb
19dc580 @evanphx Reorganize and repackage from the rpm_contrib gem
authored
1 # -*- ruby -*-
2
3 require 'rubygems'
4 require 'hoe'
5
50c06f7 @evanphx Startup a real redis to test against
authored
6 REDIS_DIR = File.expand_path(File.join("..", "test"), __FILE__)
7 REDIS_CNF = File.join(REDIS_DIR, "test.conf")
8 REDIS_PID = File.join(REDIS_DIR, "db", "redis.pid")
9
10 task :default => :run
11
12 desc "Run tests and manage server start/stop"
13 task :run => [:start, :test, :stop]
14
15 desc "Start the Redis server"
16 task :start do
17 redis_running = \
18 begin
19 File.exists?(REDIS_PID) && Process.kill(0, File.read(REDIS_PID).to_i)
20 rescue Errno::ESRCH
21 FileUtils.rm REDIS_PID
22 false
23 end
24
25 unless redis_running
26 unless system("which redis-server")
27 STDERR.puts "redis-server not in PATH"
28 exit 1
29 end
30
31 unless system("redis-server #{REDIS_CNF}")
32 STDERR.puts "could not start redis-server"
33 exit 1
34 end
35 end
36 end
37
38 desc "Stop the Redis server"
39 task :stop do
40 if File.exists?(REDIS_PID)
41 Process.kill "INT", File.read(REDIS_PID).to_i
42 FileUtils.rm REDIS_PID
43 end
44 end
45
684bcb5 @evanphx Fix Manifest, add gemspec, change bundler auto-require name
authored
46 Hoe.plugin :bundler
47 Hoe.plugin :gemspec
48 Hoe.plugin :git
49
50 HOE = Hoe.spec 'newrelic-redis' do
19dc580 @evanphx Reorganize and repackage from the rpm_contrib gem
authored
51 developer 'Evan Phoenix', 'evan@phx.io'
da31a84 @evanphx Fix test running
authored
52 license "BSD"
684bcb5 @evanphx Fix Manifest, add gemspec, change bundler auto-require name
authored
53
1a8a7c4 @evanphx Bump the dependency to < 4.0
authored
54 dependency "redis", "< 4.0"
1ccd2b4 @jasonrclark Update newrelic-redis to Datastores
jasonrclark authored
55 dependency "newrelic_rpm", "~> 3.11"
5432986 @evanphx Bump to 2.0.0
authored
56
57 self.readme_file = "README.md"
19dc580 @evanphx Reorganize and repackage from the rpm_contrib gem
authored
58 end
59
684bcb5 @evanphx Fix Manifest, add gemspec, change bundler auto-require name
authored
60 file "#{HOE.spec.name}.gemspec" => ['Rakefile'] do |t|
61 puts "Generating #{t.name}"
62 File.open(t.name, 'wb') { |f| f.write HOE.spec.to_ruby }
63 end
64
65 desc "Generate or update the standalone gemspec file for the project"
66 task :gemspec => ["#{HOE.spec.name}.gemspec"]
67
19dc580 @evanphx Reorganize and repackage from the rpm_contrib gem
authored
68 # vim: syntax=ruby
Something went wrong with that request. Please try again.