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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 9a0f7f0f2058c4b4582000f3e5fa1834ba3aad64
4
- data.tar.gz: dc5c13d238bd54fea9fd33077f64c53ad42c9528
3
+ metadata.gz: 4f6fb6f73cf81d612aaeea9f9f6e001e59c38255
4
+ data.tar.gz: 2065632b48f49c16e80ed799d9b93e1f94104082
5
5
  SHA512:
6
- metadata.gz: 4a0ff31eaca328ac428a75a9f8005aa42c9aa5cb5ca5292df2634c350a568ec2140cb8d02658f08a133e4ec1a7895cf6cd29822aea5925e0164d662aada09a39
7
- data.tar.gz: c749fa33faa88005085bbf6e21be861fc063c73f7204cf51d2d44161c33b7ca4e335beb903f531bbbf47c18319aa8fb2a6ebc0242ec06ab709b4eb9a664f7e8e
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 = message_store.determine_content_type(content)
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
@@ -1,3 +1,3 @@
1
1
  module PinchHitter
2
- VERSION = "0.5.1"
2
+ VERSION = "0.5.2"
3
3
  end
@@ -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.1
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-07-04 00:00:00.000000000 Z
11
+ date: 2014-08-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra