scout 5.7.1 → 5.7.2.pre

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (251) hide show
  1. data/CHANGELOG.markdown +5 -0
  2. data/lib/scout/command/run.rb +1 -1
  3. data/lib/scout/server.rb +2 -1
  4. data/lib/scout/streamer.rb +3 -2
  5. data/lib/scout/streamer_daemon.rb +4 -4
  6. data/lib/scout/version.rb +1 -1
  7. data/test/scout_test.rb +7 -8
  8. data/vendor/httpclient/README.txt +759 -0
  9. data/vendor/httpclient/bin/httpclient +65 -0
  10. data/vendor/httpclient/lib/hexdump.rb +50 -0
  11. data/vendor/httpclient/lib/http-access2.rb +55 -0
  12. data/vendor/httpclient/lib/http-access2/cookie.rb +1 -0
  13. data/vendor/httpclient/lib/http-access2/http.rb +1 -0
  14. data/vendor/httpclient/lib/httpclient.rb +1156 -0
  15. data/vendor/httpclient/lib/httpclient/auth.rb +899 -0
  16. data/vendor/httpclient/lib/httpclient/cacert.p7s +1912 -0
  17. data/vendor/httpclient/lib/httpclient/connection.rb +88 -0
  18. data/vendor/httpclient/lib/httpclient/cookie.rb +438 -0
  19. data/vendor/httpclient/lib/httpclient/http.rb +1046 -0
  20. data/vendor/httpclient/lib/httpclient/include_client.rb +83 -0
  21. data/vendor/httpclient/lib/httpclient/session.rb +1025 -0
  22. data/vendor/httpclient/lib/httpclient/ssl_config.rb +403 -0
  23. data/vendor/httpclient/lib/httpclient/timeout.rb +140 -0
  24. data/vendor/httpclient/lib/httpclient/util.rb +178 -0
  25. data/vendor/httpclient/lib/httpclient/version.rb +3 -0
  26. data/vendor/httpclient/lib/oauthclient.rb +110 -0
  27. data/vendor/httpclient/sample/async.rb +8 -0
  28. data/vendor/httpclient/sample/auth.rb +11 -0
  29. data/vendor/httpclient/sample/cookie.rb +18 -0
  30. data/vendor/httpclient/sample/dav.rb +103 -0
  31. data/vendor/httpclient/sample/howto.rb +49 -0
  32. data/vendor/httpclient/sample/oauth_buzz.rb +57 -0
  33. data/vendor/httpclient/sample/oauth_friendfeed.rb +59 -0
  34. data/vendor/httpclient/sample/oauth_salesforce_10.rb +63 -0
  35. data/vendor/httpclient/sample/oauth_twitter.rb +61 -0
  36. data/vendor/httpclient/sample/ssl/0cert.pem +22 -0
  37. data/vendor/httpclient/sample/ssl/0key.pem +30 -0
  38. data/vendor/httpclient/sample/ssl/1000cert.pem +19 -0
  39. data/vendor/httpclient/sample/ssl/1000key.pem +18 -0
  40. data/vendor/httpclient/sample/ssl/htdocs/index.html +10 -0
  41. data/vendor/httpclient/sample/ssl/ssl_client.rb +22 -0
  42. data/vendor/httpclient/sample/ssl/webrick_httpsd.rb +29 -0
  43. data/vendor/httpclient/sample/stream.rb +21 -0
  44. data/vendor/httpclient/sample/thread.rb +27 -0
  45. data/vendor/httpclient/sample/wcat.rb +21 -0
  46. data/vendor/httpclient/test/ca-chain.cert +44 -0
  47. data/vendor/httpclient/test/ca.cert +23 -0
  48. data/vendor/httpclient/test/client.cert +19 -0
  49. data/vendor/httpclient/test/client.key +15 -0
  50. data/vendor/httpclient/test/helper.rb +129 -0
  51. data/vendor/httpclient/test/htdigest +1 -0
  52. data/vendor/httpclient/test/htpasswd +2 -0
  53. data/vendor/httpclient/test/runner.rb +2 -0
  54. data/vendor/httpclient/test/server.cert +19 -0
  55. data/vendor/httpclient/test/server.key +15 -0
  56. data/vendor/httpclient/test/sslsvr.rb +65 -0
  57. data/vendor/httpclient/test/subca.cert +21 -0
  58. data/vendor/httpclient/test/test_auth.rb +321 -0
  59. data/vendor/httpclient/test/test_cookie.rb +391 -0
  60. data/vendor/httpclient/test/test_hexdump.rb +14 -0
  61. data/vendor/httpclient/test/test_http-access2.rb +507 -0
  62. data/vendor/httpclient/test/test_httpclient.rb +1783 -0
  63. data/vendor/httpclient/test/test_include_client.rb +52 -0
  64. data/vendor/httpclient/test/test_ssl.rb +235 -0
  65. data/vendor/multi_json/.document +5 -0
  66. data/vendor/multi_json/.rspec +3 -0
  67. data/vendor/multi_json/.travis.yml +11 -0
  68. data/vendor/multi_json/.yardopts +6 -0
  69. data/vendor/multi_json/CHANGELOG.md +169 -0
  70. data/vendor/multi_json/CONTRIBUTING.md +46 -0
  71. data/vendor/multi_json/Gemfile +31 -0
  72. data/vendor/multi_json/LICENSE.md +20 -0
  73. data/vendor/multi_json/README.md +109 -0
  74. data/vendor/multi_json/Rakefile +12 -0
  75. data/vendor/multi_json/lib/multi_json.rb +157 -0
  76. data/vendor/multi_json/lib/multi_json/adapter.rb +48 -0
  77. data/vendor/multi_json/lib/multi_json/adapters/gson.rb +19 -0
  78. data/vendor/multi_json/lib/multi_json/adapters/jr_jackson.rb +19 -0
  79. data/vendor/multi_json/lib/multi_json/adapters/json_common.rb +25 -0
  80. data/vendor/multi_json/lib/multi_json/adapters/json_gem.rb +11 -0
  81. data/vendor/multi_json/lib/multi_json/adapters/json_pure.rb +11 -0
  82. data/vendor/multi_json/lib/multi_json/adapters/nsjsonserialization.rb +34 -0
  83. data/vendor/multi_json/lib/multi_json/adapters/oj.rb +24 -0
  84. data/vendor/multi_json/lib/multi_json/adapters/ok_json.rb +22 -0
  85. data/vendor/multi_json/lib/multi_json/adapters/yajl.rb +19 -0
  86. data/vendor/multi_json/lib/multi_json/convertible_hash_keys.rb +43 -0
  87. data/vendor/multi_json/lib/multi_json/load_error.rb +11 -0
  88. data/vendor/multi_json/lib/multi_json/options.rb +48 -0
  89. data/vendor/multi_json/lib/multi_json/vendor/okjson.rb +606 -0
  90. data/vendor/multi_json/lib/multi_json/version.rb +20 -0
  91. data/vendor/multi_json/multi_json.gemspec +22 -0
  92. data/vendor/multi_json/spec/adapter_shared_example.rb +235 -0
  93. data/vendor/multi_json/spec/has_options.rb +119 -0
  94. data/vendor/multi_json/spec/helper.rb +35 -0
  95. data/vendor/multi_json/spec/json_common_shared_example.rb +30 -0
  96. data/vendor/multi_json/spec/multi_json_spec.rb +226 -0
  97. data/vendor/{signature → pusher}/.document +0 -0
  98. data/vendor/{json_pure/diagrams/.keep → pusher/.gemtest} +0 -0
  99. data/vendor/pusher/.gitignore +23 -0
  100. data/vendor/pusher/.travis.yml +15 -0
  101. data/vendor/pusher/Gemfile +2 -0
  102. data/vendor/{pusher-gem → pusher}/LICENSE +1 -1
  103. data/vendor/pusher/README.md +186 -0
  104. data/vendor/{pusher-gem → pusher}/Rakefile +0 -0
  105. data/vendor/{pusher-gem → pusher}/examples/async_message.rb +0 -0
  106. data/vendor/pusher/lib/pusher.rb +60 -0
  107. data/vendor/{pusher-gem → pusher}/lib/pusher/channel.rb +47 -54
  108. data/vendor/pusher/lib/pusher/client.rb +306 -0
  109. data/vendor/pusher/lib/pusher/request.rb +107 -0
  110. data/vendor/pusher/lib/pusher/resource.rb +36 -0
  111. data/vendor/pusher/lib/pusher/webhook.rb +110 -0
  112. data/vendor/{pusher-gem → pusher}/pusher.gemspec +6 -5
  113. data/vendor/pusher/spec/channel_spec.rb +127 -0
  114. data/vendor/pusher/spec/client_spec.rb +464 -0
  115. data/vendor/{pusher-gem → pusher}/spec/spec_helper.rb +12 -0
  116. data/vendor/pusher/spec/web_hook_spec.rb +117 -0
  117. data/vendor/signature/.travis.yml +15 -0
  118. data/vendor/signature/Gemfile +1 -1
  119. data/vendor/signature/README.md +38 -28
  120. data/vendor/signature/lib/signature.rb +97 -15
  121. data/vendor/signature/lib/signature/query_encoder.rb +47 -0
  122. data/vendor/signature/lib/signature/version.rb +1 -1
  123. data/vendor/signature/signature.gemspec +3 -2
  124. data/vendor/signature/spec/signature_spec.rb +164 -55
  125. data/vendor/signature/spec/spec_helper.rb +2 -3
  126. metadata +120 -145
  127. data/vendor/json_pure/.gitignore +0 -12
  128. data/vendor/json_pure/.travis.yml +0 -20
  129. data/vendor/json_pure/CHANGES +0 -282
  130. data/vendor/json_pure/COPYING +0 -58
  131. data/vendor/json_pure/COPYING-json-jruby +0 -57
  132. data/vendor/json_pure/GPL +0 -340
  133. data/vendor/json_pure/Gemfile +0 -11
  134. data/vendor/json_pure/README-json-jruby.markdown +0 -33
  135. data/vendor/json_pure/README.rdoc +0 -358
  136. data/vendor/json_pure/Rakefile +0 -412
  137. data/vendor/json_pure/TODO +0 -1
  138. data/vendor/json_pure/VERSION +0 -1
  139. data/vendor/json_pure/data/example.json +0 -1
  140. data/vendor/json_pure/data/index.html +0 -38
  141. data/vendor/json_pure/data/prototype.js +0 -4184
  142. data/vendor/json_pure/ext/json/ext/fbuffer/fbuffer.h +0 -181
  143. data/vendor/json_pure/ext/json/ext/generator/depend +0 -1
  144. data/vendor/json_pure/ext/json/ext/generator/extconf.rb +0 -14
  145. data/vendor/json_pure/ext/json/ext/generator/generator.c +0 -1435
  146. data/vendor/json_pure/ext/json/ext/generator/generator.h +0 -148
  147. data/vendor/json_pure/ext/json/ext/parser/depend +0 -1
  148. data/vendor/json_pure/ext/json/ext/parser/extconf.rb +0 -13
  149. data/vendor/json_pure/ext/json/ext/parser/parser.c +0 -2204
  150. data/vendor/json_pure/ext/json/ext/parser/parser.h +0 -77
  151. data/vendor/json_pure/ext/json/ext/parser/parser.rl +0 -927
  152. data/vendor/json_pure/install.rb +0 -23
  153. data/vendor/json_pure/java/src/json/ext/ByteListTranscoder.java +0 -167
  154. data/vendor/json_pure/java/src/json/ext/Generator.java +0 -444
  155. data/vendor/json_pure/java/src/json/ext/GeneratorMethods.java +0 -232
  156. data/vendor/json_pure/java/src/json/ext/GeneratorService.java +0 -43
  157. data/vendor/json_pure/java/src/json/ext/GeneratorState.java +0 -543
  158. data/vendor/json_pure/java/src/json/ext/OptionsReader.java +0 -114
  159. data/vendor/json_pure/java/src/json/ext/Parser.java +0 -2644
  160. data/vendor/json_pure/java/src/json/ext/Parser.rl +0 -968
  161. data/vendor/json_pure/java/src/json/ext/ParserService.java +0 -35
  162. data/vendor/json_pure/java/src/json/ext/RuntimeInfo.java +0 -121
  163. data/vendor/json_pure/java/src/json/ext/StringDecoder.java +0 -167
  164. data/vendor/json_pure/java/src/json/ext/StringEncoder.java +0 -106
  165. data/vendor/json_pure/java/src/json/ext/Utils.java +0 -89
  166. data/vendor/json_pure/json-java.gemspec +0 -23
  167. data/vendor/json_pure/json.gemspec +0 -37
  168. data/vendor/json_pure/json_pure.gemspec +0 -39
  169. data/vendor/json_pure/lib/json.rb +0 -62
  170. data/vendor/json_pure/lib/json/add/bigdecimal.rb +0 -28
  171. data/vendor/json_pure/lib/json/add/complex.rb +0 -22
  172. data/vendor/json_pure/lib/json/add/core.rb +0 -11
  173. data/vendor/json_pure/lib/json/add/date.rb +0 -34
  174. data/vendor/json_pure/lib/json/add/date_time.rb +0 -50
  175. data/vendor/json_pure/lib/json/add/exception.rb +0 -31
  176. data/vendor/json_pure/lib/json/add/ostruct.rb +0 -31
  177. data/vendor/json_pure/lib/json/add/range.rb +0 -29
  178. data/vendor/json_pure/lib/json/add/rational.rb +0 -22
  179. data/vendor/json_pure/lib/json/add/regexp.rb +0 -30
  180. data/vendor/json_pure/lib/json/add/struct.rb +0 -30
  181. data/vendor/json_pure/lib/json/add/symbol.rb +0 -25
  182. data/vendor/json_pure/lib/json/add/time.rb +0 -38
  183. data/vendor/json_pure/lib/json/common.rb +0 -487
  184. data/vendor/json_pure/lib/json/ext.rb +0 -21
  185. data/vendor/json_pure/lib/json/ext/.keep +0 -0
  186. data/vendor/json_pure/lib/json/generic_object.rb +0 -70
  187. data/vendor/json_pure/lib/json/pure.rb +0 -21
  188. data/vendor/json_pure/lib/json/pure/generator.rb +0 -522
  189. data/vendor/json_pure/lib/json/pure/parser.rb +0 -359
  190. data/vendor/json_pure/lib/json/version.rb +0 -8
  191. data/vendor/json_pure/tests/fixtures/fail1.json +0 -1
  192. data/vendor/json_pure/tests/fixtures/fail10.json +0 -1
  193. data/vendor/json_pure/tests/fixtures/fail11.json +0 -1
  194. data/vendor/json_pure/tests/fixtures/fail12.json +0 -1
  195. data/vendor/json_pure/tests/fixtures/fail13.json +0 -1
  196. data/vendor/json_pure/tests/fixtures/fail14.json +0 -1
  197. data/vendor/json_pure/tests/fixtures/fail18.json +0 -1
  198. data/vendor/json_pure/tests/fixtures/fail19.json +0 -1
  199. data/vendor/json_pure/tests/fixtures/fail2.json +0 -1
  200. data/vendor/json_pure/tests/fixtures/fail20.json +0 -1
  201. data/vendor/json_pure/tests/fixtures/fail21.json +0 -1
  202. data/vendor/json_pure/tests/fixtures/fail22.json +0 -1
  203. data/vendor/json_pure/tests/fixtures/fail23.json +0 -1
  204. data/vendor/json_pure/tests/fixtures/fail24.json +0 -1
  205. data/vendor/json_pure/tests/fixtures/fail25.json +0 -1
  206. data/vendor/json_pure/tests/fixtures/fail27.json +0 -2
  207. data/vendor/json_pure/tests/fixtures/fail28.json +0 -2
  208. data/vendor/json_pure/tests/fixtures/fail3.json +0 -1
  209. data/vendor/json_pure/tests/fixtures/fail4.json +0 -1
  210. data/vendor/json_pure/tests/fixtures/fail5.json +0 -1
  211. data/vendor/json_pure/tests/fixtures/fail6.json +0 -1
  212. data/vendor/json_pure/tests/fixtures/fail7.json +0 -1
  213. data/vendor/json_pure/tests/fixtures/fail8.json +0 -1
  214. data/vendor/json_pure/tests/fixtures/fail9.json +0 -1
  215. data/vendor/json_pure/tests/fixtures/pass1.json +0 -56
  216. data/vendor/json_pure/tests/fixtures/pass15.json +0 -1
  217. data/vendor/json_pure/tests/fixtures/pass16.json +0 -1
  218. data/vendor/json_pure/tests/fixtures/pass17.json +0 -1
  219. data/vendor/json_pure/tests/fixtures/pass2.json +0 -1
  220. data/vendor/json_pure/tests/fixtures/pass26.json +0 -1
  221. data/vendor/json_pure/tests/fixtures/pass3.json +0 -6
  222. data/vendor/json_pure/tests/setup_variant.rb +0 -11
  223. data/vendor/json_pure/tests/test_json.rb +0 -545
  224. data/vendor/json_pure/tests/test_json_addition.rb +0 -196
  225. data/vendor/json_pure/tests/test_json_encoding.rb +0 -65
  226. data/vendor/json_pure/tests/test_json_fixtures.rb +0 -35
  227. data/vendor/json_pure/tests/test_json_generate.rb +0 -322
  228. data/vendor/json_pure/tests/test_json_generic_object.rb +0 -75
  229. data/vendor/json_pure/tests/test_json_string_matching.rb +0 -39
  230. data/vendor/json_pure/tests/test_json_unicode.rb +0 -72
  231. data/vendor/json_pure/tools/fuzz.rb +0 -139
  232. data/vendor/json_pure/tools/server.rb +0 -62
  233. data/vendor/pusher-gem/Gemfile +0 -2
  234. data/vendor/pusher-gem/README.md +0 -80
  235. data/vendor/pusher-gem/lib/pusher.rb +0 -107
  236. data/vendor/pusher-gem/lib/pusher/request.rb +0 -107
  237. data/vendor/pusher-gem/spec/channel_spec.rb +0 -274
  238. data/vendor/pusher-gem/spec/pusher_spec.rb +0 -87
  239. data/vendor/ruby-hmac/History.txt +0 -15
  240. data/vendor/ruby-hmac/Manifest.txt +0 -11
  241. data/vendor/ruby-hmac/README.md +0 -41
  242. data/vendor/ruby-hmac/Rakefile +0 -23
  243. data/vendor/ruby-hmac/lib/hmac-md5.rb +0 -11
  244. data/vendor/ruby-hmac/lib/hmac-rmd160.rb +0 -11
  245. data/vendor/ruby-hmac/lib/hmac-sha1.rb +0 -11
  246. data/vendor/ruby-hmac/lib/hmac-sha2.rb +0 -25
  247. data/vendor/ruby-hmac/lib/hmac.rb +0 -118
  248. data/vendor/ruby-hmac/lib/ruby_hmac.rb +0 -2
  249. data/vendor/ruby-hmac/ruby-hmac.gemspec +0 -33
  250. data/vendor/ruby-hmac/test/test_hmac.rb +0 -89
  251. data/vendor/signature/VERSION +0 -1
@@ -1,87 +0,0 @@
1
- require 'spec_helper'
2
-
3
- require 'em-http'
4
-
5
- describe Pusher do
6
- describe 'configuration' do
7
- it 'should be preconfigured for api host' do
8
- Pusher.host.should == 'api.pusherapp.com'
9
- end
10
-
11
- it 'should be preconfigured for port 80' do
12
- Pusher.port.should == 80
13
- end
14
-
15
- it 'should use standard logger if no other logger if defined' do
16
- Pusher.logger.debug('foo')
17
- Pusher.logger.should be_kind_of(Logger)
18
- end
19
-
20
- it "can be configured to use any logger" do
21
- logger = mock("ALogger")
22
- logger.should_receive(:debug).with('foo')
23
- Pusher.logger = logger
24
- Pusher.logger.debug('foo')
25
- Pusher.logger = nil
26
- end
27
- end
28
-
29
- describe "configuration using url" do
30
- after do
31
- Pusher.app_id = nil
32
- Pusher.key = nil
33
- Pusher.secret = nil
34
- Pusher.host = 'api.pusherapp.com'
35
- Pusher.port = 80
36
- end
37
-
38
- it "should be possible to configure everything by setting the url" do
39
- Pusher.url = "http://somekey:somesecret@api.staging.pusherapp.com:8080/apps/87"
40
-
41
- Pusher.host.should == 'api.staging.pusherapp.com'
42
- Pusher.port.should == 8080
43
- Pusher.key.should == 'somekey'
44
- Pusher.secret.should == 'somesecret'
45
- Pusher.app_id.should == '87'
46
- end
47
- end
48
-
49
- describe 'when configured' do
50
- before do
51
- Pusher.app_id = '20'
52
- Pusher.key = '12345678900000001'
53
- Pusher.secret = '12345678900000001'
54
- end
55
-
56
- after do
57
- Pusher.app_id = nil
58
- Pusher.key = nil
59
- Pusher.secret = nil
60
- end
61
-
62
- describe '.[]' do
63
- before do
64
- @channel = Pusher['test_channel']
65
- end
66
-
67
- it 'should return a channel' do
68
- @channel.should be_kind_of(Pusher::Channel)
69
- end
70
-
71
- it "should reuse the same channel objects" do
72
- channel1, channel2 = Pusher['test_channel'], Pusher['test_channel']
73
-
74
- channel1.object_id.should == channel2.object_id
75
- end
76
-
77
- %w{app_id key secret}.each do |config|
78
- it "should raise exception if #{config} not configured" do
79
- Pusher.send("#{config}=", nil)
80
- lambda {
81
- Pusher['test_channel']
82
- }.should raise_error(Pusher::ConfigurationError)
83
- end
84
- end
85
- end
86
- end
87
- end
@@ -1,15 +0,0 @@
1
- == 0.4.0 / 2010-01-19
2
-
3
- * Ruby 1.9 compatibility [Tim Kersey]
4
- * Minitest integration [Tim Kersey]
5
- * Updated to Hoe 2.5.0 [Geoffrey Grosenbach]
6
-
7
- == 0.3.2 / 2008-08-20
8
-
9
- * Removed spurious constants that cause warnings on load [Blaine Cook]
10
- * Move hoe to build dependency if build deps are supported [Blaine Cook]
11
-
12
- == 0.3.1 / 2007-08-13
13
-
14
- * Converted to gem by Geoffrey Grosenbach
15
- * Tests converted to Test::Unit
@@ -1,11 +0,0 @@
1
- History.txt
2
- Manifest.txt
3
- README.txt
4
- Rakefile
5
- lib/hmac-md5.rb
6
- lib/hmac-rmd160.rb
7
- lib/hmac-sha1.rb
8
- lib/hmac-sha2.rb
9
- lib/hmac.rb
10
- lib/ruby_hmac.rb
11
- test/test_hmac.rb
@@ -1,41 +0,0 @@
1
- = ruby-hmac
2
-
3
- * http://ruby-hmac.rubyforge.org
4
-
5
- == IMPORTANT: USE OpenSSL INSTEAD!
6
-
7
- The HMAC functionality included with OpenSSL is available from Ruby and is much faster. It's recommended that you use OpenSSL instead of this library.
8
-
9
- See the blog post on [OpenSSL vs. Ruby HMAC Benchmarks](http://blog.nathanielbibler.com/post/63031273/openssl-hmac-vs-ruby-hmac-benchmarks).
10
-
11
- == DESCRIPTION:
12
-
13
- This module provides common interface to HMAC functionality. HMAC is a kind of "Message Authentication Code" (MAC) algorithm whose standard is documented in RFC2104. Namely, a MAC provides a way to check the integrity of information transmitted over or stored in an unreliable medium, based on a secret key.
14
-
15
- Originally written by Daiki Ueno. Converted to a RubyGem by Geoffrey Grosenbach
16
-
17
- == LICENSE:
18
-
19
- (The MIT License)
20
-
21
- Copyright (c) 2007 Daiki Ueno
22
-
23
- Permission is hereby granted, free of charge, to any person obtaining
24
- a copy of this software and associated documentation files (the
25
- 'Software'), to deal in the Software without restriction, including
26
- without limitation the rights to use, copy, modify, merge, publish,
27
- distribute, sublicense, and/or sell copies of the Software, and to
28
- permit persons to whom the Software is furnished to do so, subject to
29
- the following conditions:
30
-
31
- The above copyright notice and this permission notice shall be
32
- included in all copies or substantial portions of the Software.
33
-
34
- THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,
35
- EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
36
- MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
37
- IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
38
- CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
39
- TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
40
- SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
41
-
@@ -1,23 +0,0 @@
1
- require 'rubygems'
2
- require 'hoe'
3
- $:.unshift(File.dirname(__FILE__) + "/lib")
4
- require 'hmac'
5
-
6
- Hoe.spec 'ruby-hmac' do
7
- developer "Daiki Ueno", ""
8
- developer "Geoffrey Grosenbach", "boss@topfunky.com"
9
- end
10
-
11
- Hoe.plugin :minitest
12
- Hoe.plugin :git
13
- Hoe.plugin :gemcutter
14
-
15
- desc "Simple require on packaged files to make sure they are all there"
16
- task :verify => :package do
17
- # An error message will be displayed if files are missing
18
- if system %(ruby -e "require 'pkg/ruby-hmac-#{HMAC::VERSION}/lib/hmac'")
19
- puts "\nThe library files are present"
20
- end
21
- end
22
-
23
- task :release => :verify
@@ -1,11 +0,0 @@
1
- require 'hmac'
2
- require 'digest/md5'
3
-
4
- module HMAC
5
- class MD5 < Base
6
- def initialize(key = nil)
7
- super(Digest::MD5, 64, 16, key)
8
- end
9
- public_class_method :new, :digest, :hexdigest
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require 'hmac'
2
- require 'digest/rmd160'
3
-
4
- module HMAC
5
- class RMD160 < Base
6
- def initialize(key = nil)
7
- super(Digest::RMD160, 64, 20, key)
8
- end
9
- public_class_method :new, :digest, :hexdigest
10
- end
11
- end
@@ -1,11 +0,0 @@
1
- require 'hmac'
2
- require 'digest/sha1'
3
-
4
- module HMAC
5
- class SHA1 < Base
6
- def initialize(key = nil)
7
- super(Digest::SHA1, 64, 20, key)
8
- end
9
- public_class_method :new, :digest, :hexdigest
10
- end
11
- end
@@ -1,25 +0,0 @@
1
- require 'hmac'
2
- require 'digest/sha2'
3
-
4
- module HMAC
5
- class SHA256 < Base
6
- def initialize(key = nil)
7
- super(Digest::SHA256, 64, 32, key)
8
- end
9
- public_class_method :new, :digest, :hexdigest
10
- end
11
-
12
- class SHA384 < Base
13
- def initialize(key = nil)
14
- super(Digest::SHA384, 128, 48, key)
15
- end
16
- public_class_method :new, :digest, :hexdigest
17
- end
18
-
19
- class SHA512 < Base
20
- def initialize(key = nil)
21
- super(Digest::SHA512, 128, 64, key)
22
- end
23
- public_class_method :new, :digest, :hexdigest
24
- end
25
- end
@@ -1,118 +0,0 @@
1
- # Copyright (C) 2001 Daiki Ueno <ueno@unixuser.org>
2
- # This library is distributed under the terms of the Ruby license.
3
-
4
- # This module provides common interface to HMAC engines.
5
- # HMAC standard is documented in RFC 2104:
6
- #
7
- # H. Krawczyk et al., "HMAC: Keyed-Hashing for Message Authentication",
8
- # RFC 2104, February 1997
9
- #
10
- # These APIs are inspired by JCE 1.2's javax.crypto.Mac interface.
11
- #
12
- # <URL:http://java.sun.com/security/JCE1.2/spec/apidoc/javax/crypto/Mac.html>
13
- #
14
- # Source repository is at
15
- #
16
- # http://github.com/topfunky/ruby-hmac/tree/master
17
-
18
- module HMAC
19
-
20
- VERSION = '0.4.0'
21
-
22
- class Base
23
- def initialize(algorithm, block_size, output_length, key)
24
- @algorithm = algorithm
25
- @block_size = block_size
26
- @output_length = output_length
27
- @initialized = false
28
- @key_xor_ipad = ''
29
- @key_xor_opad = ''
30
- set_key(key) unless key.nil?
31
- end
32
-
33
- private
34
- def check_status
35
- unless @initialized
36
- raise RuntimeError,
37
- "The underlying hash algorithm has not yet been initialized."
38
- end
39
- end
40
-
41
- public
42
- def set_key(key)
43
- # If key is longer than the block size, apply hash function
44
- # to key and use the result as a real key.
45
- key = @algorithm.digest(key) if key.size > @block_size
46
- akey = key.unpack("C*")
47
- key_xor_ipad = ("\x36" * @block_size).unpack("C*")
48
- key_xor_opad = ("\x5C" * @block_size).unpack("C*")
49
- for i in 0 .. akey.size - 1
50
- key_xor_ipad[i] ^= akey[i]
51
- key_xor_opad[i] ^= akey[i]
52
- end
53
- @key_xor_ipad = key_xor_ipad.pack("C*")
54
- @key_xor_opad = key_xor_opad.pack("C*")
55
- @md = @algorithm.new
56
- @initialized = true
57
- end
58
-
59
- def reset_key
60
- @key_xor_ipad.gsub!(/./, '?')
61
- @key_xor_opad.gsub!(/./, '?')
62
- @key_xor_ipad[0..-1] = ''
63
- @key_xor_opad[0..-1] = ''
64
- @initialized = false
65
- end
66
-
67
- def update(text)
68
- check_status
69
- # perform inner H
70
- md = @algorithm.new
71
- md.update(@key_xor_ipad)
72
- md.update(text)
73
- str = md.digest
74
- # perform outer H
75
- md = @algorithm.new
76
- md.update(@key_xor_opad)
77
- md.update(str)
78
- @md = md
79
- end
80
- alias << update
81
-
82
- def digest
83
- check_status
84
- @md.digest
85
- end
86
-
87
- def hexdigest
88
- check_status
89
- @md.hexdigest
90
- end
91
- alias to_s hexdigest
92
-
93
- # These two class methods below are safer than using above
94
- # instance methods combinatorially because an instance will have
95
- # held a key even if it's no longer in use.
96
- def Base.digest(key, text)
97
- hmac = self.new(key)
98
- begin
99
- hmac.update(text)
100
- hmac.digest
101
- ensure
102
- hmac.reset_key
103
- end
104
- end
105
-
106
- def Base.hexdigest(key, text)
107
- hmac = self.new(key)
108
- begin
109
- hmac.update(text)
110
- hmac.hexdigest
111
- ensure
112
- hmac.reset_key
113
- end
114
- end
115
-
116
- private_class_method :new, :digest, :hexdigest
117
- end
118
- end
@@ -1,2 +0,0 @@
1
- # Convenience file to match gem name
2
- require 'hmac'
@@ -1,33 +0,0 @@
1
- Gem::Specification.new do |s|
2
- s.name = %q{ruby-hmac}
3
- s.version = "0.3.2"
4
-
5
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
6
- s.authors = ["Daiki Ueno", "Geoffrey Grosenbach"]
7
- s.date = %q{2008-08-21}
8
- s.description = %q{A MAC provides a way to check the integrity of information transmitted over or stored in an unreliable medium, based on a secret key.}
9
- s.email = %q{boss@topfunky.com}
10
- s.extra_rdoc_files = ["History.txt", "Manifest.txt", "README.txt"]
11
- s.files = ["History.txt", "Manifest.txt", "README.txt", "Rakefile", "lib/hmac-md5.rb", "lib/hmac-rmd160.rb", "lib/hmac-sha1.rb", "lib/hmac-sha2.rb", "lib/hmac.rb", "test/test_hmac.rb"]
12
- s.has_rdoc = true
13
- s.homepage = %q{http://ruby-hmac.rubyforge.org}
14
- s.rdoc_options = ["--main", "README.txt"]
15
- s.require_paths = ["lib"]
16
- s.rubyforge_project = %q{ruby-hmac}
17
- s.rubygems_version = %q{1.2.0}
18
- s.summary = %q{An implementation of the HMAC authentication code in Ruby.}
19
- s.test_files = ["test/test_hmac.rb"]
20
-
21
- if s.respond_to? :specification_version then
22
- current_version = Gem::Specification::CURRENT_SPECIFICATION_VERSION
23
- s.specification_version = 2
24
-
25
- if current_version >= 3 then
26
- s.add_development_dependency(%q<hoe>, [">= 1.7.0"])
27
- else
28
- s.add_dependency(%q<hoe>, [">= 1.7.0"])
29
- end
30
- else
31
- s.add_dependency(%q<hoe>, [">= 1.7.0"])
32
- end
33
- end
@@ -1,89 +0,0 @@
1
- #!/usr/bin/env ruby
2
-
3
- $: << File.dirname(__FILE__) + "/../lib"
4
- require "hmac-md5"
5
- require "hmac-sha1"
6
- begin
7
- require "minitest/unit"
8
- rescue LoadError
9
- require "rubygems"
10
- require "minitest/unit"
11
- end
12
-
13
- MiniTest::Unit.autorun
14
-
15
- class TestHmac < MiniTest::Unit::TestCase
16
-
17
- def test_s_digest
18
- key = "\x0b" * 16
19
- text = "Hi There"
20
-
21
- hmac = HMAC::MD5.new(key)
22
- hmac.update(text)
23
-
24
- assert_equal(hmac.digest, HMAC::MD5.digest(key, text))
25
- end
26
-
27
- def test_s_hexdigest
28
- key = "\x0b" * 16
29
- text = "Hi There"
30
-
31
- hmac = HMAC::MD5.new(key)
32
- hmac.update(text)
33
-
34
- assert_equal(hmac.hexdigest, HMAC::MD5.hexdigest(key, text))
35
- end
36
-
37
- def test_hmac_md5_1
38
- assert_equal(HMAC::MD5.hexdigest("\x0b" * 16, "Hi There"),
39
- "9294727a3638bb1c13f48ef8158bfc9d")
40
- end
41
-
42
- def test_hmac_md5_2
43
- assert_equal(HMAC::MD5.hexdigest("Jefe", "what do ya want for nothing?"),
44
- "750c783e6ab0b503eaa86e310a5db738")
45
- end
46
-
47
- def test_hmac_md5_3
48
- assert_equal(HMAC::MD5.hexdigest("\xaa" * 16, "\xdd" * 50),
49
- "56be34521d144c88dbb8c733f0e8b3f6")
50
- end
51
-
52
- def test_hmac_md5_4
53
- assert_equal(HMAC::MD5.hexdigest(["0102030405060708090a0b0c0d0e0f10111213141516171819"].pack("H*"), "\xcd" * 50),
54
- "697eaf0aca3a3aea3a75164746ffaa79")
55
- end
56
-
57
- def test_hmac_md5_5
58
- assert_equal(HMAC::MD5.hexdigest("\x0c" * 16, "Test With Truncation"),
59
- "56461ef2342edc00f9bab995690efd4c")
60
- end
61
-
62
- # def test_hmac_md5_6
63
- # assert_equal(HMAC::MD5.hexdigest("\x0c" * 16, "Test With Truncation"),
64
- # "56461ef2342edc00f9bab995")
65
- # end
66
-
67
- def test_hmac_md5_7
68
- assert_equal(HMAC::MD5.hexdigest("\xaa" * 80, "Test Using Larger Than Block-Size Key - Hash Key First"),
69
- "6b1ab7fe4bd7bf8f0b62e6ce61b9d0cd")
70
- end
71
-
72
- def test_hmac_md5_8
73
- assert_equal(HMAC::MD5.hexdigest("\xaa" * 80, "Test Using Larger Than Block-Size Key and Larger Than One Block-Size Data"),
74
- "6f630fad67cda0ee1fb1f562db3aa53e")
75
- end
76
-
77
- def test_reset_key
78
- hmac = HMAC::MD5.new("key")
79
- hmac.reset_key
80
- assert_raises(RuntimeError) { hmac.update("foo") }
81
- end
82
-
83
- def test_set_key
84
- hmac = HMAC::MD5.new
85
- assert_raises(RuntimeError) { hmac.update("foo") }
86
- hmac.reset_key
87
- assert_raises(RuntimeError) { hmac.update("foo") }
88
- end
89
- end