pinch_hitter 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Changelog +4 -0
- data/lib/pinch_hitter.rb +3 -2
- data/lib/pinch_hitter/version.rb +1 -1
- data/test/test_pinch_hitter.rb +5 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4f6fb6f73cf81d612aaeea9f9f6e001e59c38255
|
4
|
+
data.tar.gz: 2065632b48f49c16e80ed799d9b93e1f94104082
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5c03d3d5f7cc6413a913b10c71499705146332a2440496cbe6fc79de9bf1785f3871ada32e5f1969e70feb274556abf967ccfc810ed9e5baf771bf1b18890816
|
7
|
+
data.tar.gz: 8ca146df200cf8dcf07d84e0427d75fcefe752460919b300f2d6720520731709801ea1fce2bcf3ed73001b0f5dcf997aa7e6314ed29aa104317f4de90a6c5d1d
|
data/Changelog
CHANGED
@@ -16,3 +16,7 @@ Add ability to register modules for custom message handling
|
|
16
16
|
|
17
17
|
=== Release 0.5.1 / 2014-7-3
|
18
18
|
* Travis revealed some test issues with newer gems. Thanks Travis CI!
|
19
|
+
|
20
|
+
=== Release 0.5.2 / 2014-8-8
|
21
|
+
* Fix edge case where storing simple messages would fail without a messages
|
22
|
+
directory. Thanks to Dan Parks and Nathan Wallace for pointing it out!
|
data/lib/pinch_hitter.rb
CHANGED
@@ -1,9 +1,11 @@
|
|
1
1
|
require "pinch_hitter/version"
|
2
2
|
require "pinch_hitter/message/message_store"
|
3
|
+
require "pinch_hitter/message/content_type"
|
3
4
|
require "pinch_hitter/service/runner"
|
4
5
|
|
5
6
|
module PinchHitter
|
6
7
|
include PinchHitter::Service::Runner
|
8
|
+
include PinchHitter::Message::ContentType
|
7
9
|
attr_accessor :message_store
|
8
10
|
|
9
11
|
def messages_directory=(dir)
|
@@ -27,7 +29,7 @@ module PinchHitter
|
|
27
29
|
end
|
28
30
|
|
29
31
|
def store(endpoint, content)
|
30
|
-
content_type =
|
32
|
+
content_type = determine_content_type(content)
|
31
33
|
@session.post "/store?endpoint=#{endpoint}", content, 'Content-Type' => content_type
|
32
34
|
end
|
33
35
|
|
@@ -44,5 +46,4 @@ module PinchHitter
|
|
44
46
|
def received_messages(endpoint)
|
45
47
|
request_log(endpoint).map { |request| request.body }
|
46
48
|
end
|
47
|
-
|
48
49
|
end
|
data/lib/pinch_hitter/version.rb
CHANGED
data/test/test_pinch_hitter.rb
CHANGED
@@ -37,7 +37,7 @@ class TestPinchHitter < MiniTest::Test
|
|
37
37
|
end
|
38
38
|
|
39
39
|
def test_message_store_init
|
40
|
-
@test.messages_directory = "/bar"
|
40
|
+
@test.messages_directory = "/bar"
|
41
41
|
assert_equal "/bar", @test.message_store.message_directory
|
42
42
|
end
|
43
43
|
|
@@ -87,4 +87,8 @@ class TestPinchHitter < MiniTest::Test
|
|
87
87
|
assert_equal messages, @test.received_messages('/foo')
|
88
88
|
end
|
89
89
|
|
90
|
+
def test_dont_need_messages_directory_to_store_messages
|
91
|
+
@test.message_store = nil
|
92
|
+
@test.store '/foo', '{"this-is": "json"}'
|
93
|
+
end
|
90
94
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pinch_hitter
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Jackson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2014-
|
11
|
+
date: 2014-08-09 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|