agile-proxy 0.1.8 → 0.1.9

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: 8236b648ae857c058338b7a938a0546c816b4576
4
- data.tar.gz: 9d429c5a5f258158ff212489174551916d8c64c2
3
+ metadata.gz: 9debf529ce58a4c1b629a0fcb240cbea68d2ad8b
4
+ data.tar.gz: cf140a73a3794a97a14f1f420d23762f70a7aeaa
5
5
  SHA512:
6
- metadata.gz: 942cba76b39e140b07182d84af49bd553fd40dbf8020161de09cac8d65af0d85f47605b6d136f47586daa58aae7e8a719fcf16eb48d5253cb2dab33e2d6dc0a9
7
- data.tar.gz: c36e3c588b4b97be0f74f313cc51e5f3fe501c32702c5203f89105dd7c0a385580fcd8b7c8f492a0a0c948a044dd325e06b19b8e389ca5552b5a1ff94fa55cd0
6
+ metadata.gz: 4f84ca76bfc4a8e8305ce22a83ad494210de26e8b4d5121cd018f79a4c87cc29306635116fe92823653a894b620f1294113942e90a58ad1520f7b10bff972965
7
+ data.tar.gz: 9e6da7607628bc29d4dda9d17c5d6481b27098aa53c02029efae899bf20431627f6729af915f979d8e614f577b56e519e9d5dd8b1af21b39e361359057721f6d
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- agile-proxy (0.1.7)
4
+ agile-proxy (0.1.9)
5
5
  activerecord (~> 4.1.6)
6
6
  em-http-request (~> 1.1.2)
7
7
  em-synchrony (~> 1.0.3)
@@ -89,7 +89,11 @@ module AgileProxy
89
89
 
90
90
  def plain_text_handler
91
91
  proc do |raw_post|
92
- data_as_array = raw_post.split("\n").map {|line| line.split('=')}.flatten
92
+ data_as_array = raw_post.split("\n").map do |line|
93
+ arr = line.split('=')
94
+ arr << nil if arr.length == 1
95
+ arr
96
+ end.flatten
93
97
  data = Hash[*data_as_array]
94
98
  ActionDispatch::Request::Utils.deep_munge(data).with_indifferent_access
95
99
  end
@@ -2,5 +2,5 @@
2
2
  #
3
3
  # The Agile Proxy module is a common namespace for all classes / sub modules.
4
4
  module AgileProxy
5
- VERSION = '0.1.8'
5
+ VERSION = '0.1.9'
6
6
  end
@@ -90,6 +90,12 @@ shared_examples_for 'a request stub' do |options = {}|
90
90
  expect(resp.status).to eql 200
91
91
  expect(resp.headers['Content-Type']).to eql 'text/html'
92
92
  end
93
+ it 'Should match the route by posted plain text data and the posted data can be output via the template' do
94
+ resp = http.post '/api/forums/my_forum', "dummy=\nposted_var=special_value\n", 'Content-Type' => 'text/plain'
95
+ expect(resp.body).to eql '<html><body><h1></h1><h2>special_value</h2><h3>my_forum</h3><p>This should get data from the POSTed data</p></body></html>'
96
+ expect(resp.status).to eql 200
97
+ expect(resp.headers['Content-Type']).to eql 'text/html'
98
+ end
93
99
  # it 'Should match the route by posted xml data and the posted data can be output via the template' do
94
100
  # resp = http.post "/api/forums/my_forum", '<posted_var>special_value</posted_var>', {'Content-Type' => 'application/xml'}
95
101
  # expect(resp.body).to eql '<html><body><h1></h1><h2>special_value</h2><h3>my_forum</h3><p>This should get data from the POSTed data</p></body></html>'
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agile-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor