scout 1.1.8 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/{CHANGELOG → History.txt} +28 -0
- data/{LICENSE → License.txt} +2 -1
- data/Manifest.txt +33 -0
- data/PostInstall.txt +7 -0
- data/README.txt +76 -0
- data/Rakefile +4 -134
- data/bin/scout +1 -200
- data/config/hoe.rb +73 -0
- data/config/requirements.rb +15 -0
- data/lib/scout/command/clone.rb +21 -0
- data/lib/scout/command/install.rb +62 -0
- data/lib/scout/command/run.rb +14 -0
- data/lib/scout/command/test.rb +38 -0
- data/lib/scout/command.rb +225 -0
- data/lib/scout/plugin.rb +97 -1
- data/lib/scout/server.rb +24 -2
- data/lib/scout/version.rb +9 -0
- data/lib/scout.rb +2 -4
- data/script/console +10 -0
- data/script/destroy +14 -0
- data/script/generate +14 -0
- data/script/txt2html +82 -0
- data/setup.rb +799 -574
- data/tasks/deployment.rake +34 -0
- data/tasks/environment.rake +7 -0
- data/tasks/website.rake +17 -0
- data/test/test_helper.rb +2 -0
- data/test/test_scout.rb +11 -0
- data/website/index.html +138 -0
- data/website/index.txt +81 -0
- data/website/javascripts/rounded_corners_lite.inc.js +285 -0
- data/website/stylesheets/screen.css +138 -0
- data/website/template.html.erb +48 -0
- metadata +61 -34
- data/AUTHORS +0 -4
- data/COPYING +0 -340
- data/INSTALL +0 -18
- data/README +0 -34
- data/TODO +0 -6
- data/test/scout_test.rb +0 -91
data/README
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
= ReadMe
|
2
|
-
|
3
|
-
Scout by Highgroove Studios
|
4
|
-
|
5
|
-
== Description
|
6
|
-
|
7
|
-
A Monitoring and Reporting Tool a Developer can Understand.
|
8
|
-
|
9
|
-
Scout makes monitoring and reporting on your web applications as flexible
|
10
|
-
and simple as possible.
|
11
|
-
|
12
|
-
Scout is a product of Highgroove Studios. Please visit http://scoutapp.com
|
13
|
-
for more information.
|
14
|
-
|
15
|
-
== Installing
|
16
|
-
|
17
|
-
After installing the scout gem:
|
18
|
-
|
19
|
-
$ sudo gem install scout --source http://gems.scoutapp.com
|
20
|
-
|
21
|
-
Simply run:
|
22
|
-
|
23
|
-
$ scout
|
24
|
-
|
25
|
-
to run the installation wizard. You'll need your Client Key to continue.
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
== Further Development / Test Suite
|
32
|
-
|
33
|
-
To test, you will need a valid Scout Server, client key, and plugin id. See
|
34
|
-
the test/scout_test.rb file for more details.
|
data/TODO
DELETED
data/test/scout_test.rb
DELETED
@@ -1,91 +0,0 @@
|
|
1
|
-
require 'test/unit'
|
2
|
-
require File.dirname(__FILE__) + '/../lib/scout'
|
3
|
-
require "logger"
|
4
|
-
|
5
|
-
class ScoutTest < Test::Unit::TestCase
|
6
|
-
|
7
|
-
SCOUT_TEST_SERVER = "http://localhost:4000/"
|
8
|
-
SCOUT_TEST_VALID_CLIENT_KEY = "valid key goes here"
|
9
|
-
SCOUT_TEST_VALID_PLUGIN_ID = "valid plugin id goes here"
|
10
|
-
|
11
|
-
def setup
|
12
|
-
@log = Logger.new('test.log')
|
13
|
-
@scout_server = create_scout_server(SCOUT_TEST_SERVER,
|
14
|
-
SCOUT_TEST_VALID_CLIENT_KEY)
|
15
|
-
end
|
16
|
-
|
17
|
-
def teardown
|
18
|
-
File.delete('test.log')
|
19
|
-
end
|
20
|
-
|
21
|
-
def test_create
|
22
|
-
assert @scout_server
|
23
|
-
end
|
24
|
-
|
25
|
-
def test_should_initialize_new_server
|
26
|
-
["@history_file", "@client_key", "@logger", "@server", "@history"].each do |var|
|
27
|
-
assert @scout_server.instance_variables.include?(var)
|
28
|
-
end
|
29
|
-
end
|
30
|
-
|
31
|
-
def test_should_send_report
|
32
|
-
report = {:server_load => "99.99"}
|
33
|
-
assert_does_not_exit { @scout_server.send_report(report, SCOUT_TEST_VALID_PLUGIN_ID) }
|
34
|
-
assert_log_contains("Report sent")
|
35
|
-
end
|
36
|
-
|
37
|
-
def test_should_not_send_report_with_invalid_client_key
|
38
|
-
@scout_server_invalid_client_key = create_scout_server(SCOUT_TEST_SERVER,
|
39
|
-
"1111-2222-3333-4444-5555")
|
40
|
-
report = {:server_load => "99.99"}
|
41
|
-
assert_does_exit { @scout_server_invalid_client_key.send_report(report, SCOUT_TEST_VALID_PLUGIN_ID) }
|
42
|
-
assert_log_contains("Unable to send report to server")
|
43
|
-
assert_log_contains("An HTTP error occurred: exit")
|
44
|
-
end
|
45
|
-
|
46
|
-
def test_should_not_send_report_with_invalid_plugin_id
|
47
|
-
report = {:server_load => "99.99"}
|
48
|
-
assert_does_exit { @scout_server.send_report(report, 9999999999) }
|
49
|
-
assert_log_contains("Unable to send report to server")
|
50
|
-
assert_log_contains("An HTTP error occurred: exit")
|
51
|
-
end
|
52
|
-
|
53
|
-
def test_should_not_send_report_with_plugin_not_belonging_to_client
|
54
|
-
report = {:server_load => "99.99"}
|
55
|
-
assert_does_exit { @scout_server.send_report(report, 4) }
|
56
|
-
assert_log_contains("Unable to send report to server")
|
57
|
-
assert_log_contains("An HTTP error occurred: exit")
|
58
|
-
end
|
59
|
-
|
60
|
-
def create_scout_server(server, client_key, history=File.join("/tmp", "client_history.yaml"), logger=@log)
|
61
|
-
Scout::Server.new(server, client_key, history, logger)
|
62
|
-
end
|
63
|
-
|
64
|
-
def assert_log_contains(pattern)
|
65
|
-
@log_file = File.read('test.log')
|
66
|
-
assert @log_file.include?(pattern), "log does not include the pattern:\n#{pattern}\nlog contains:\n#{@log_file}"
|
67
|
-
end
|
68
|
-
|
69
|
-
# asserts that the program actually exits, terminating.
|
70
|
-
def assert_does_exit(&block)
|
71
|
-
begin
|
72
|
-
yield
|
73
|
-
rescue SystemExit
|
74
|
-
assert true, "Expected program to not exit, but program did exit."
|
75
|
-
return
|
76
|
-
end
|
77
|
-
flunk "Expected program to exit, but program did not exit."
|
78
|
-
end
|
79
|
-
|
80
|
-
# asserts that the program does not exit.
|
81
|
-
def assert_does_not_exit(&block)
|
82
|
-
begin
|
83
|
-
yield
|
84
|
-
rescue SystemExit
|
85
|
-
flunk "Expected program to not exit, but program did exit."
|
86
|
-
return
|
87
|
-
end
|
88
|
-
assert true, "Expected program to not exit, but program did exit."
|
89
|
-
end
|
90
|
-
|
91
|
-
end
|