daikon 0.8.14 → 0.8.15
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +1 -0
- data/Gemfile.lock +1 -0
- data/Rakefile +15 -14
- data/daikon.gemspec +6 -9
- data/features/daemon.feature +17 -0
- data/features/step_definitions/daikon_steps.rb +13 -0
- data/features/support/env.rb +43 -0
- data/gemfiles/daemons1-0.gemfile +1 -0
- data/gemfiles/daemons1-0.gemfile.lock +1 -0
- data/gemfiles/daemons1-1.gemfile +1 -0
- data/gemfiles/daemons1-1.gemfile.lock +1 -0
- data/gemfiles/excon0-5.gemfile +1 -0
- data/gemfiles/excon0-5.gemfile.lock +6 -5
- data/gemfiles/excon0-6.gemfile +1 -0
- data/gemfiles/excon0-6.gemfile.lock +6 -5
- data/gemfiles/json1-4.gemfile +1 -0
- data/gemfiles/json1-4.gemfile.lock +6 -5
- data/gemfiles/json1-5.gemfile +1 -0
- data/gemfiles/json1-5.gemfile.lock +6 -5
- data/gemfiles/redis2-1.gemfile +1 -0
- data/gemfiles/redis2-1.gemfile.lock +1 -0
- data/gemfiles/redis2-2.gemfile +1 -0
- data/gemfiles/redis2-2.gemfile.lock +1 -0
- data/lib/daikon.rb +1 -0
- data/lib/daikon/daemon.rb +7 -3
- data/lib/daikon/server.rb +20 -0
- data/lib/daikon/version.rb +1 -1
- metadata +31 -56
- data/spec/daemon_spec.rb +0 -36
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
data/Rakefile
CHANGED
@@ -1,21 +1,22 @@
|
|
1
1
|
require 'appraisal'
|
2
|
-
|
3
2
|
require 'rspec/core'
|
4
3
|
require 'rspec/core/rake_task'
|
4
|
+
require 'cucumber/rake/task'
|
5
|
+
|
5
6
|
RSpec::Core::RakeTask.new(:spec) do |spec|
|
6
7
|
spec.pattern = FileList['spec/**/*_spec.rb']
|
7
8
|
spec.ruby_opts = "-Ilib"
|
8
9
|
end
|
9
10
|
|
11
|
+
Cucumber::Rake::Task.new(:features)
|
12
|
+
|
10
13
|
desc "run tests"
|
11
|
-
task :default => :spec
|
14
|
+
task :default => [:spec, :features]
|
12
15
|
|
13
16
|
desc "test all appraisals"
|
14
17
|
task :all do
|
15
18
|
appraisals =
|
16
19
|
%w[redis2-1 redis2-2
|
17
|
-
excon0-5 excon0-6
|
18
|
-
json1-4 json1-5
|
19
20
|
daemons1-0 daemons1-1].map do |run|
|
20
21
|
"bundle exec rake appraisal:#{run}"
|
21
22
|
end
|
@@ -24,16 +25,6 @@ task :all do
|
|
24
25
|
sh appraisals.join(' && ')
|
25
26
|
end
|
26
27
|
|
27
|
-
def parse_monitor
|
28
|
-
monitor = Daikon::Monitor.new(nil, nil)
|
29
|
-
|
30
|
-
File.open("monitor.log", "r") do |f|
|
31
|
-
until f.eof?
|
32
|
-
monitor.parse(f.readline)
|
33
|
-
end
|
34
|
-
end
|
35
|
-
end
|
36
|
-
|
37
28
|
desc "benchmark monitor.log against the monitor parsing"
|
38
29
|
task :bench do
|
39
30
|
require 'benchmark'
|
@@ -46,6 +37,16 @@ end
|
|
46
37
|
|
47
38
|
desc "perf tools the monitor.log"
|
48
39
|
task :perf do
|
40
|
+
def parse_monitor
|
41
|
+
monitor = Daikon::Monitor.new(nil, nil)
|
42
|
+
|
43
|
+
File.open("monitor.log", "r") do |f|
|
44
|
+
until f.eof?
|
45
|
+
monitor.parse(f.readline)
|
46
|
+
end
|
47
|
+
end
|
48
|
+
end
|
49
|
+
|
49
50
|
require 'perftools'
|
50
51
|
PerfTools::CpuProfiler.start("daikon.profile") do
|
51
52
|
parse_monitor
|
data/daikon.gemspec
CHANGED
@@ -6,7 +6,7 @@ Gem::Specification.new do |s|
|
|
6
6
|
|
7
7
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
8
8
|
s.authors = ['Nick Quaranto', 'thoughtbot']
|
9
|
-
s.date = %q{2011-06-
|
9
|
+
s.date = %q{2011-06-24}
|
10
10
|
s.description = %q{daikon, a radishapp.com client}
|
11
11
|
s.email = %q{nick@thoughtbot.com}
|
12
12
|
s.executables = [%q{daikon}]
|
@@ -24,20 +24,17 @@ Gem::Specification.new do |s|
|
|
24
24
|
"Rakefile",
|
25
25
|
"bin/daikon",
|
26
26
|
"daikon.gemspec"
|
27
|
-
] + Dir["lib/**/*.rb"]
|
27
|
+
] + Dir["lib/**/*.rb"]
|
28
28
|
s.homepage = %q{http://github.com/qrush/daikon}
|
29
29
|
s.licenses = [%q{MIT}]
|
30
30
|
s.require_paths = [%q{lib}]
|
31
31
|
s.required_ruby_version = Gem::Requirement.new(">= 1.8.6")
|
32
32
|
s.rubygems_version = %q{1.8.1}
|
33
33
|
s.summary = %q{daikon, a radishapp.com client}
|
34
|
-
s.test_files =
|
35
|
-
"
|
36
|
-
"spec
|
37
|
-
"
|
38
|
-
"spec/monitor_spec.rb",
|
39
|
-
"spec/spec_helper.rb"
|
40
|
-
]
|
34
|
+
s.test_files =
|
35
|
+
Dir["gemfiles/**/*"] +
|
36
|
+
Dir["spec/**/*"] +
|
37
|
+
Dir["features/**/*"]
|
41
38
|
|
42
39
|
s.add_runtime_dependency(%q<daemons>, ["~> 1.0"])
|
43
40
|
s.add_runtime_dependency(%q<excon>, ["~> 0.5"])
|
@@ -0,0 +1,17 @@
|
|
1
|
+
Feature: Run the daikon daemon
|
2
|
+
|
3
|
+
Scenario: Starting daikon normally should not start an HTTP server
|
4
|
+
When I run `bundle exec ruby -Ilib ./bin/daikon start -- -k abcd`
|
5
|
+
Then a file named "daikon.pid" should exist
|
6
|
+
|
7
|
+
Scenario: Starting daikon with port starts HTTP server
|
8
|
+
Given I set the "PORT" variable to "8080"
|
9
|
+
When I run `bundle exec ruby -Ilib ./bin/daikon start -- -k abcd PORT=8080`
|
10
|
+
Then a file named "daikon.pid" should exist
|
11
|
+
When I wait 1 second
|
12
|
+
And I run `curl http://0.0.0.0:8080`
|
13
|
+
Then the output should contain "Radish: Dig deep into Redis"
|
14
|
+
|
15
|
+
Scenario: Show version
|
16
|
+
When I run `bundle exec ruby -Ilib ./bin/daikon --version`
|
17
|
+
Then the output should contain the current version number
|
@@ -0,0 +1,13 @@
|
|
1
|
+
When /^I set the "([^"]+)" variable to "([^"]+)"$/ do |key, value|
|
2
|
+
@env_vars ||= []
|
3
|
+
@env_vars << key
|
4
|
+
set_env(key, value)
|
5
|
+
end
|
6
|
+
|
7
|
+
When /^I wait (\d+) seconds?$/ do |seconds|
|
8
|
+
sleep seconds.to_i
|
9
|
+
end
|
10
|
+
|
11
|
+
Then /^the output should contain the current version number$/ do
|
12
|
+
all_output.should =~ /Daikon v#{Daikon::VERSION}/
|
13
|
+
end
|
@@ -0,0 +1,43 @@
|
|
1
|
+
require 'bundler'
|
2
|
+
begin
|
3
|
+
Bundler.setup(:default, :development)
|
4
|
+
rescue Bundler::BundlerError => e
|
5
|
+
$stderr.puts e.message
|
6
|
+
$stderr.puts "Run `bundle install` to install missing gems"
|
7
|
+
exit e.status_code
|
8
|
+
end
|
9
|
+
|
10
|
+
$LOAD_PATH.unshift(File.dirname(__FILE__) + '/../../lib')
|
11
|
+
require 'daikon'
|
12
|
+
|
13
|
+
require 'aruba/cucumber'
|
14
|
+
require 'rspec/expectations'
|
15
|
+
|
16
|
+
Before do
|
17
|
+
kill_daikon
|
18
|
+
|
19
|
+
@dirs = ["."]
|
20
|
+
@aruba_timeout_seconds = 5
|
21
|
+
end
|
22
|
+
|
23
|
+
After do
|
24
|
+
kill_daikon
|
25
|
+
|
26
|
+
if @env_vars
|
27
|
+
@env_vars.each do |key|
|
28
|
+
set_env(key, nil)
|
29
|
+
end
|
30
|
+
end
|
31
|
+
end
|
32
|
+
|
33
|
+
module KillHelpers
|
34
|
+
def kill_daikon
|
35
|
+
if File.exist?("daikon.pid")
|
36
|
+
system "bundle exec ruby -Ilib ./bin/daikon stop"
|
37
|
+
system "kill -TERM $(pgrep -f daikon)"
|
38
|
+
FileUtils.rm_rf("*.pid")
|
39
|
+
end
|
40
|
+
end
|
41
|
+
end
|
42
|
+
|
43
|
+
World(KillHelpers)
|
data/gemfiles/daemons1-0.gemfile
CHANGED
data/gemfiles/daemons1-1.gemfile
CHANGED
data/gemfiles/excon0-5.gemfile
CHANGED
@@ -14,19 +14,19 @@ GEM
|
|
14
14
|
builder (3.0.0)
|
15
15
|
childprocess (0.1.9)
|
16
16
|
ffi (~> 1.0.6)
|
17
|
-
cucumber (0.
|
17
|
+
cucumber (1.0.0)
|
18
18
|
builder (>= 2.1.2)
|
19
19
|
diff-lcs (>= 1.1.2)
|
20
|
-
gherkin (~> 2.4.
|
20
|
+
gherkin (~> 2.4.1)
|
21
21
|
json (>= 1.4.6)
|
22
22
|
term-ansicolor (>= 1.0.5)
|
23
|
-
daemons (1.1.
|
23
|
+
daemons (1.1.4)
|
24
24
|
diff-lcs (1.1.2)
|
25
25
|
excon (0.5.8)
|
26
26
|
ffi (1.0.9)
|
27
|
-
gherkin (2.4.
|
27
|
+
gherkin (2.4.1)
|
28
28
|
json (>= 1.4.6)
|
29
|
-
json (1.5.
|
29
|
+
json (1.5.3)
|
30
30
|
json_pure (1.4.6)
|
31
31
|
mocha (0.9.8)
|
32
32
|
rake
|
@@ -48,6 +48,7 @@ PLATFORMS
|
|
48
48
|
|
49
49
|
DEPENDENCIES
|
50
50
|
appraisal (~> 0.3.5)
|
51
|
+
aruba
|
51
52
|
bourne
|
52
53
|
cucumber
|
53
54
|
daemons (~> 1.1.0)
|
data/gemfiles/excon0-6.gemfile
CHANGED
@@ -14,19 +14,19 @@ GEM
|
|
14
14
|
builder (3.0.0)
|
15
15
|
childprocess (0.1.9)
|
16
16
|
ffi (~> 1.0.6)
|
17
|
-
cucumber (0.
|
17
|
+
cucumber (1.0.0)
|
18
18
|
builder (>= 2.1.2)
|
19
19
|
diff-lcs (>= 1.1.2)
|
20
|
-
gherkin (~> 2.4.
|
20
|
+
gherkin (~> 2.4.1)
|
21
21
|
json (>= 1.4.6)
|
22
22
|
term-ansicolor (>= 1.0.5)
|
23
|
-
daemons (1.1.
|
23
|
+
daemons (1.1.4)
|
24
24
|
diff-lcs (1.1.2)
|
25
25
|
excon (0.6.3)
|
26
26
|
ffi (1.0.9)
|
27
|
-
gherkin (2.4.
|
27
|
+
gherkin (2.4.1)
|
28
28
|
json (>= 1.4.6)
|
29
|
-
json (1.5.
|
29
|
+
json (1.5.3)
|
30
30
|
json_pure (1.4.6)
|
31
31
|
mocha (0.9.8)
|
32
32
|
rake
|
@@ -48,6 +48,7 @@ PLATFORMS
|
|
48
48
|
|
49
49
|
DEPENDENCIES
|
50
50
|
appraisal (~> 0.3.5)
|
51
|
+
aruba
|
51
52
|
bourne
|
52
53
|
cucumber
|
53
54
|
daemons (~> 1.1.0)
|
data/gemfiles/json1-4.gemfile
CHANGED
@@ -14,19 +14,19 @@ GEM
|
|
14
14
|
builder (3.0.0)
|
15
15
|
childprocess (0.1.9)
|
16
16
|
ffi (~> 1.0.6)
|
17
|
-
cucumber (0.
|
17
|
+
cucumber (1.0.0)
|
18
18
|
builder (>= 2.1.2)
|
19
19
|
diff-lcs (>= 1.1.2)
|
20
|
-
gherkin (~> 2.4.
|
20
|
+
gherkin (~> 2.4.1)
|
21
21
|
json (>= 1.4.6)
|
22
22
|
term-ansicolor (>= 1.0.5)
|
23
|
-
daemons (1.1.
|
23
|
+
daemons (1.1.4)
|
24
24
|
diff-lcs (1.1.2)
|
25
25
|
excon (0.6.3)
|
26
26
|
ffi (1.0.9)
|
27
|
-
gherkin (2.4.
|
27
|
+
gherkin (2.4.1)
|
28
28
|
json (>= 1.4.6)
|
29
|
-
json (1.5.
|
29
|
+
json (1.5.3)
|
30
30
|
json_pure (1.4.6)
|
31
31
|
mocha (0.9.8)
|
32
32
|
rake
|
@@ -48,6 +48,7 @@ PLATFORMS
|
|
48
48
|
|
49
49
|
DEPENDENCIES
|
50
50
|
appraisal (~> 0.3.5)
|
51
|
+
aruba
|
51
52
|
bourne
|
52
53
|
cucumber
|
53
54
|
daemons (~> 1.1.0)
|
data/gemfiles/json1-5.gemfile
CHANGED
@@ -14,19 +14,19 @@ GEM
|
|
14
14
|
builder (3.0.0)
|
15
15
|
childprocess (0.1.9)
|
16
16
|
ffi (~> 1.0.6)
|
17
|
-
cucumber (0.
|
17
|
+
cucumber (1.0.0)
|
18
18
|
builder (>= 2.1.2)
|
19
19
|
diff-lcs (>= 1.1.2)
|
20
|
-
gherkin (~> 2.4.
|
20
|
+
gherkin (~> 2.4.1)
|
21
21
|
json (>= 1.4.6)
|
22
22
|
term-ansicolor (>= 1.0.5)
|
23
|
-
daemons (1.1.
|
23
|
+
daemons (1.1.4)
|
24
24
|
diff-lcs (1.1.2)
|
25
25
|
excon (0.6.3)
|
26
26
|
ffi (1.0.9)
|
27
|
-
gherkin (2.4.
|
27
|
+
gherkin (2.4.1)
|
28
28
|
json (>= 1.4.6)
|
29
|
-
json (1.5.
|
29
|
+
json (1.5.3)
|
30
30
|
json_pure (1.4.6)
|
31
31
|
mocha (0.9.8)
|
32
32
|
rake
|
@@ -48,6 +48,7 @@ PLATFORMS
|
|
48
48
|
|
49
49
|
DEPENDENCIES
|
50
50
|
appraisal (~> 0.3.5)
|
51
|
+
aruba
|
51
52
|
bourne
|
52
53
|
cucumber
|
53
54
|
daemons (~> 1.1.0)
|
data/gemfiles/redis2-1.gemfile
CHANGED
data/gemfiles/redis2-2.gemfile
CHANGED
data/lib/daikon.rb
CHANGED
data/lib/daikon/daemon.rb
CHANGED
@@ -35,9 +35,13 @@ module Daikon
|
|
35
35
|
logger = Logger.new("/tmp/radish.log")
|
36
36
|
end
|
37
37
|
|
38
|
-
|
39
|
-
|
40
|
-
|
38
|
+
if port = ENV["PORT"]
|
39
|
+
logger.info "Port detected, starting server on port #{port}"
|
40
|
+
Daikon::Server.start(logger, port)
|
41
|
+
end
|
42
|
+
|
43
|
+
rotated_at = reported_at = Time.now
|
44
|
+
client = Daikon::Client.new
|
41
45
|
|
42
46
|
client.setup(config, logger)
|
43
47
|
client.start_monitor
|
@@ -0,0 +1,20 @@
|
|
1
|
+
module Daikon
|
2
|
+
class Server
|
3
|
+
def self.start(logger, port)
|
4
|
+
fork do
|
5
|
+
require 'webrick'
|
6
|
+
server = WEBrick::HTTPServer.new :Logger => logger, :Port => port
|
7
|
+
server.mount_proc('/') do |req, resp|
|
8
|
+
resp.body = <<-HTML
|
9
|
+
<a href='http://radishapp.com'>Radish: Dig deep into Redis.</a>
|
10
|
+
<br />
|
11
|
+
Running Daikon v#{VERSION}
|
12
|
+
HTML
|
13
|
+
end
|
14
|
+
trap('INT') { server.stop }
|
15
|
+
trap('TERM') { server.stop }
|
16
|
+
server.start
|
17
|
+
end
|
18
|
+
end
|
19
|
+
end
|
20
|
+
end
|
data/lib/daikon/version.rb
CHANGED
metadata
CHANGED
@@ -1,13 +1,8 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: daikon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 8
|
9
|
-
- 14
|
10
|
-
version: 0.8.14
|
4
|
+
prerelease:
|
5
|
+
version: 0.8.15
|
11
6
|
platform: ruby
|
12
7
|
authors:
|
13
8
|
- Nick Quaranto
|
@@ -16,8 +11,7 @@ autorequire:
|
|
16
11
|
bindir: bin
|
17
12
|
cert_chain: []
|
18
13
|
|
19
|
-
date: 2011-06-
|
20
|
-
default_executable:
|
14
|
+
date: 2011-06-24 00:00:00 Z
|
21
15
|
dependencies:
|
22
16
|
- !ruby/object:Gem::Dependency
|
23
17
|
name: daemons
|
@@ -27,10 +21,6 @@ dependencies:
|
|
27
21
|
requirements:
|
28
22
|
- - ~>
|
29
23
|
- !ruby/object:Gem::Version
|
30
|
-
hash: 15
|
31
|
-
segments:
|
32
|
-
- 1
|
33
|
-
- 0
|
34
24
|
version: "1.0"
|
35
25
|
type: :runtime
|
36
26
|
version_requirements: *id001
|
@@ -42,10 +32,6 @@ dependencies:
|
|
42
32
|
requirements:
|
43
33
|
- - ~>
|
44
34
|
- !ruby/object:Gem::Version
|
45
|
-
hash: 1
|
46
|
-
segments:
|
47
|
-
- 0
|
48
|
-
- 5
|
49
35
|
version: "0.5"
|
50
36
|
type: :runtime
|
51
37
|
version_requirements: *id002
|
@@ -57,10 +43,6 @@ dependencies:
|
|
57
43
|
requirements:
|
58
44
|
- - ~>
|
59
45
|
- !ruby/object:Gem::Version
|
60
|
-
hash: 7
|
61
|
-
segments:
|
62
|
-
- 1
|
63
|
-
- 4
|
64
46
|
version: "1.4"
|
65
47
|
type: :runtime
|
66
48
|
version_requirements: *id003
|
@@ -72,10 +54,6 @@ dependencies:
|
|
72
54
|
requirements:
|
73
55
|
- - ~>
|
74
56
|
- !ruby/object:Gem::Version
|
75
|
-
hash: 1
|
76
|
-
segments:
|
77
|
-
- 2
|
78
|
-
- 1
|
79
57
|
version: "2.1"
|
80
58
|
type: :runtime
|
81
59
|
version_requirements: *id004
|
@@ -87,9 +65,6 @@ dependencies:
|
|
87
65
|
requirements:
|
88
66
|
- - ">="
|
89
67
|
- !ruby/object:Gem::Version
|
90
|
-
hash: 3
|
91
|
-
segments:
|
92
|
-
- 0
|
93
68
|
version: "0"
|
94
69
|
type: :development
|
95
70
|
version_requirements: *id005
|
@@ -101,9 +76,6 @@ dependencies:
|
|
101
76
|
requirements:
|
102
77
|
- - ">="
|
103
78
|
- !ruby/object:Gem::Version
|
104
|
-
hash: 3
|
105
|
-
segments:
|
106
|
-
- 0
|
107
79
|
version: "0"
|
108
80
|
type: :development
|
109
81
|
version_requirements: *id006
|
@@ -115,9 +87,6 @@ dependencies:
|
|
115
87
|
requirements:
|
116
88
|
- - ">="
|
117
89
|
- !ruby/object:Gem::Version
|
118
|
-
hash: 3
|
119
|
-
segments:
|
120
|
-
- 0
|
121
90
|
version: "0"
|
122
91
|
type: :development
|
123
92
|
version_requirements: *id007
|
@@ -129,9 +98,6 @@ dependencies:
|
|
129
98
|
requirements:
|
130
99
|
- - ">="
|
131
100
|
- !ruby/object:Gem::Version
|
132
|
-
hash: 3
|
133
|
-
segments:
|
134
|
-
- 0
|
135
101
|
version: "0"
|
136
102
|
type: :development
|
137
103
|
version_requirements: *id008
|
@@ -143,9 +109,6 @@ dependencies:
|
|
143
109
|
requirements:
|
144
110
|
- - ">="
|
145
111
|
- !ruby/object:Gem::Version
|
146
|
-
hash: 3
|
147
|
-
segments:
|
148
|
-
- 0
|
149
112
|
version: "0"
|
150
113
|
type: :development
|
151
114
|
version_requirements: *id009
|
@@ -174,13 +137,9 @@ files:
|
|
174
137
|
- lib/daikon/daemons_hacks.rb
|
175
138
|
- lib/daikon/monitor.rb
|
176
139
|
- lib/daikon/redis_hacks.rb
|
140
|
+
- lib/daikon/server.rb
|
177
141
|
- lib/daikon/version.rb
|
178
142
|
- lib/daikon.rb
|
179
|
-
- spec/client_spec.rb
|
180
|
-
- spec/configuration_spec.rb
|
181
|
-
- spec/daemon_spec.rb
|
182
|
-
- spec/monitor_spec.rb
|
183
|
-
- spec/spec_helper.rb
|
184
143
|
- gemfiles/daemons1-0.gemfile
|
185
144
|
- gemfiles/daemons1-0.gemfile.lock
|
186
145
|
- gemfiles/daemons1-1.gemfile
|
@@ -197,7 +156,13 @@ files:
|
|
197
156
|
- gemfiles/redis2-1.gemfile.lock
|
198
157
|
- gemfiles/redis2-2.gemfile
|
199
158
|
- gemfiles/redis2-2.gemfile.lock
|
200
|
-
|
159
|
+
- spec/client_spec.rb
|
160
|
+
- spec/configuration_spec.rb
|
161
|
+
- spec/monitor_spec.rb
|
162
|
+
- spec/spec_helper.rb
|
163
|
+
- features/daemon.feature
|
164
|
+
- features/step_definitions/daikon_steps.rb
|
165
|
+
- features/support/env.rb
|
201
166
|
homepage: http://github.com/qrush/daikon
|
202
167
|
licenses:
|
203
168
|
- MIT
|
@@ -211,31 +176,41 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
211
176
|
requirements:
|
212
177
|
- - ">="
|
213
178
|
- !ruby/object:Gem::Version
|
214
|
-
hash: 59
|
215
|
-
segments:
|
216
|
-
- 1
|
217
|
-
- 8
|
218
|
-
- 6
|
219
179
|
version: 1.8.6
|
220
180
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
221
181
|
none: false
|
222
182
|
requirements:
|
223
183
|
- - ">="
|
224
184
|
- !ruby/object:Gem::Version
|
225
|
-
hash: 3
|
226
|
-
segments:
|
227
|
-
- 0
|
228
185
|
version: "0"
|
229
186
|
requirements: []
|
230
187
|
|
231
188
|
rubyforge_project:
|
232
|
-
rubygems_version: 1.
|
189
|
+
rubygems_version: 1.8.5
|
233
190
|
signing_key:
|
234
191
|
specification_version: 3
|
235
192
|
summary: daikon, a radishapp.com client
|
236
193
|
test_files:
|
194
|
+
- gemfiles/daemons1-0.gemfile
|
195
|
+
- gemfiles/daemons1-0.gemfile.lock
|
196
|
+
- gemfiles/daemons1-1.gemfile
|
197
|
+
- gemfiles/daemons1-1.gemfile.lock
|
198
|
+
- gemfiles/excon0-5.gemfile
|
199
|
+
- gemfiles/excon0-5.gemfile.lock
|
200
|
+
- gemfiles/excon0-6.gemfile
|
201
|
+
- gemfiles/excon0-6.gemfile.lock
|
202
|
+
- gemfiles/json1-4.gemfile
|
203
|
+
- gemfiles/json1-4.gemfile.lock
|
204
|
+
- gemfiles/json1-5.gemfile
|
205
|
+
- gemfiles/json1-5.gemfile.lock
|
206
|
+
- gemfiles/redis2-1.gemfile
|
207
|
+
- gemfiles/redis2-1.gemfile.lock
|
208
|
+
- gemfiles/redis2-2.gemfile
|
209
|
+
- gemfiles/redis2-2.gemfile.lock
|
237
210
|
- spec/client_spec.rb
|
238
211
|
- spec/configuration_spec.rb
|
239
|
-
- spec/daemon_spec.rb
|
240
212
|
- spec/monitor_spec.rb
|
241
213
|
- spec/spec_helper.rb
|
214
|
+
- features/daemon.feature
|
215
|
+
- features/step_definitions/daikon_steps.rb
|
216
|
+
- features/support/env.rb
|
data/spec/daemon_spec.rb
DELETED
@@ -1,36 +0,0 @@
|
|
1
|
-
require 'spec_helper'
|
2
|
-
|
3
|
-
describe Daikon::Daemon do
|
4
|
-
let(:client) { stub("client") }
|
5
|
-
|
6
|
-
before do
|
7
|
-
Daikon::Client.stubs(:new => client)
|
8
|
-
Daikon::Daemon.sleep_time = 0.05
|
9
|
-
client.stubs(:setup => true,
|
10
|
-
:start_monitor => true,
|
11
|
-
:rotate_monitor => true,
|
12
|
-
:report_info => true)
|
13
|
-
end
|
14
|
-
|
15
|
-
it "submits the last minute of data" do
|
16
|
-
thread = Thread.new do
|
17
|
-
Daikon::Daemon.start(["run", "--", "-k", "1234"], true)
|
18
|
-
end
|
19
|
-
sleep 3.1
|
20
|
-
Daikon::Daemon.run = false
|
21
|
-
client.should have_received(:rotate_monitor)
|
22
|
-
client.should have_received(:report_info).times(6)
|
23
|
-
end
|
24
|
-
end
|
25
|
-
|
26
|
-
describe Daikon::Daemon, "flags" do
|
27
|
-
%w[-v --version].each do |flag|
|
28
|
-
it "shows the daikon version with #{flag}" do
|
29
|
-
old_stdout = $stdout
|
30
|
-
$stdout = StringIO.new("")
|
31
|
-
Daikon::Daemon.start([flag])
|
32
|
-
$stdout.string.should include(Daikon::VERSION)
|
33
|
-
$stdout = old_stdout
|
34
|
-
end
|
35
|
-
end
|
36
|
-
end
|