scout 2.0.7 → 4.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (128) hide show
  1. data/CHANGELOG +15 -0
  2. data/Rakefile +14 -59
  3. data/data/cacert.pem +3154 -0
  4. data/data/gpl-2.0.txt +339 -0
  5. data/data/lgpl-2.1.txt +504 -0
  6. data/lib/scout.rb +4 -4
  7. data/lib/scout/command.rb +9 -0
  8. data/lib/scout/command/test.rb +8 -6
  9. data/lib/scout/plugin.rb +17 -6
  10. data/lib/scout/server.rb +127 -123
  11. data/vendor/json_pure/CHANGES +119 -0
  12. data/vendor/json_pure/GPL +340 -0
  13. data/vendor/json_pure/README +78 -0
  14. data/vendor/json_pure/RUBY +58 -0
  15. data/vendor/json_pure/Rakefile +270 -0
  16. data/vendor/json_pure/TODO +1 -0
  17. data/vendor/json_pure/VERSION +1 -0
  18. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkComparison.log +52 -0
  19. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast-autocorrelation.dat +1000 -0
  20. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_fast.dat +1001 -0
  21. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty-autocorrelation.dat +900 -0
  22. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_pretty.dat +901 -0
  23. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe-autocorrelation.dat +1000 -0
  24. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt#generator_safe.dat +1001 -0
  25. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkExt.log +261 -0
  26. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast-autocorrelation.dat +1000 -0
  27. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_fast.dat +1001 -0
  28. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty-autocorrelation.dat +1000 -0
  29. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_pretty.dat +1001 -0
  30. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe-autocorrelation.dat +1000 -0
  31. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure#generator_safe.dat +1001 -0
  32. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkPure.log +262 -0
  33. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator-autocorrelation.dat +1000 -0
  34. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails#generator.dat +1001 -0
  35. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/GeneratorBenchmarkRails.log +82 -0
  36. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkComparison.log +34 -0
  37. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser-autocorrelation.dat +900 -0
  38. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt#parser.dat +901 -0
  39. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkExt.log +81 -0
  40. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser-autocorrelation.dat +1000 -0
  41. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure#parser.dat +1001 -0
  42. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkPure.log +82 -0
  43. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser-autocorrelation.dat +1000 -0
  44. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails#parser.dat +1001 -0
  45. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkRails.log +82 -0
  46. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser-autocorrelation.dat +1000 -0
  47. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML#parser.dat +1001 -0
  48. data/vendor/json_pure/benchmarks/data-p4-3GHz-ruby18/ParserBenchmarkYAML.log +82 -0
  49. data/vendor/json_pure/benchmarks/generator_benchmark.rb +165 -0
  50. data/vendor/json_pure/benchmarks/parser_benchmark.rb +197 -0
  51. data/vendor/json_pure/bin/edit_json.rb +9 -0
  52. data/vendor/json_pure/bin/prettify_json.rb +75 -0
  53. data/vendor/json_pure/data/example.json +1 -0
  54. data/vendor/json_pure/data/index.html +38 -0
  55. data/vendor/json_pure/data/prototype.js +4184 -0
  56. data/vendor/json_pure/doc-templates/main.txt +283 -0
  57. data/vendor/json_pure/ext/json/ext/generator/extconf.rb +11 -0
  58. data/vendor/json_pure/ext/json/ext/generator/generator.c +919 -0
  59. data/vendor/json_pure/ext/json/ext/generator/unicode.c +182 -0
  60. data/vendor/json_pure/ext/json/ext/generator/unicode.h +53 -0
  61. data/vendor/json_pure/ext/json/ext/parser/extconf.rb +11 -0
  62. data/vendor/json_pure/ext/json/ext/parser/parser.c +1829 -0
  63. data/vendor/json_pure/ext/json/ext/parser/parser.rl +686 -0
  64. data/vendor/json_pure/ext/json/ext/parser/unicode.c +154 -0
  65. data/vendor/json_pure/ext/json/ext/parser/unicode.h +58 -0
  66. data/vendor/json_pure/install.rb +26 -0
  67. data/vendor/json_pure/lib/json.rb +10 -0
  68. data/vendor/json_pure/lib/json/Array.xpm +21 -0
  69. data/vendor/json_pure/lib/json/FalseClass.xpm +21 -0
  70. data/vendor/json_pure/lib/json/Hash.xpm +21 -0
  71. data/vendor/json_pure/lib/json/Key.xpm +73 -0
  72. data/vendor/json_pure/lib/json/NilClass.xpm +21 -0
  73. data/vendor/json_pure/lib/json/Numeric.xpm +28 -0
  74. data/vendor/json_pure/lib/json/String.xpm +96 -0
  75. data/vendor/json_pure/lib/json/TrueClass.xpm +21 -0
  76. data/vendor/json_pure/lib/json/add/core.rb +135 -0
  77. data/vendor/json_pure/lib/json/add/rails.rb +58 -0
  78. data/vendor/json_pure/lib/json/common.rb +354 -0
  79. data/vendor/json_pure/lib/json/editor.rb +1371 -0
  80. data/vendor/json_pure/lib/json/ext.rb +15 -0
  81. data/vendor/json_pure/lib/json/json.xpm +1499 -0
  82. data/vendor/json_pure/lib/json/pure.rb +77 -0
  83. data/vendor/json_pure/lib/json/pure/generator.rb +430 -0
  84. data/vendor/json_pure/lib/json/pure/parser.rb +269 -0
  85. data/vendor/json_pure/lib/json/version.rb +8 -0
  86. data/vendor/json_pure/tests/fixtures/fail1.json +1 -0
  87. data/vendor/json_pure/tests/fixtures/fail10.json +1 -0
  88. data/vendor/json_pure/tests/fixtures/fail11.json +1 -0
  89. data/vendor/json_pure/tests/fixtures/fail12.json +1 -0
  90. data/vendor/json_pure/tests/fixtures/fail13.json +1 -0
  91. data/vendor/json_pure/tests/fixtures/fail14.json +1 -0
  92. data/vendor/json_pure/tests/fixtures/fail18.json +1 -0
  93. data/vendor/json_pure/tests/fixtures/fail19.json +1 -0
  94. data/vendor/json_pure/tests/fixtures/fail2.json +1 -0
  95. data/vendor/json_pure/tests/fixtures/fail20.json +1 -0
  96. data/vendor/json_pure/tests/fixtures/fail21.json +1 -0
  97. data/vendor/json_pure/tests/fixtures/fail22.json +1 -0
  98. data/vendor/json_pure/tests/fixtures/fail23.json +1 -0
  99. data/vendor/json_pure/tests/fixtures/fail24.json +1 -0
  100. data/vendor/json_pure/tests/fixtures/fail25.json +1 -0
  101. data/vendor/json_pure/tests/fixtures/fail27.json +2 -0
  102. data/vendor/json_pure/tests/fixtures/fail28.json +2 -0
  103. data/vendor/json_pure/tests/fixtures/fail3.json +1 -0
  104. data/vendor/json_pure/tests/fixtures/fail4.json +1 -0
  105. data/vendor/json_pure/tests/fixtures/fail5.json +1 -0
  106. data/vendor/json_pure/tests/fixtures/fail6.json +1 -0
  107. data/vendor/json_pure/tests/fixtures/fail7.json +1 -0
  108. data/vendor/json_pure/tests/fixtures/fail8.json +1 -0
  109. data/vendor/json_pure/tests/fixtures/fail9.json +1 -0
  110. data/vendor/json_pure/tests/fixtures/pass1.json +56 -0
  111. data/vendor/json_pure/tests/fixtures/pass15.json +1 -0
  112. data/vendor/json_pure/tests/fixtures/pass16.json +1 -0
  113. data/vendor/json_pure/tests/fixtures/pass17.json +1 -0
  114. data/vendor/json_pure/tests/fixtures/pass2.json +1 -0
  115. data/vendor/json_pure/tests/fixtures/pass26.json +1 -0
  116. data/vendor/json_pure/tests/fixtures/pass3.json +6 -0
  117. data/vendor/json_pure/tests/test_json.rb +312 -0
  118. data/vendor/json_pure/tests/test_json_addition.rb +164 -0
  119. data/vendor/json_pure/tests/test_json_fixtures.rb +34 -0
  120. data/vendor/json_pure/tests/test_json_generate.rb +106 -0
  121. data/vendor/json_pure/tests/test_json_rails.rb +146 -0
  122. data/vendor/json_pure/tests/test_json_unicode.rb +62 -0
  123. data/vendor/json_pure/tools/fuzz.rb +139 -0
  124. data/vendor/json_pure/tools/server.rb +61 -0
  125. metadata +120 -6
  126. data/lib/scout/command/clone.rb +0 -21
  127. data/setup.rb +0 -1360
  128. data/test/scout_test.rb +0 -91
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