agile-proxy 0.1.7 → 0.1.8

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 3f910120525e74c3bffe004eb5ec11fd23eff979
4
- data.tar.gz: ceedb0aca91eba1bc0b9a835a3bd85e4e25e8d42
3
+ metadata.gz: 8236b648ae857c058338b7a938a0546c816b4576
4
+ data.tar.gz: 9d429c5a5f258158ff212489174551916d8c64c2
5
5
  SHA512:
6
- metadata.gz: 9ed9c1503cae9543509d9f3650c47d214b69e7d8e85a0cdb53ca3504bdbf501f5a1cef8642d8999e5699873ef7e2400ee498efff453ee9f8ff779b2132a84876
7
- data.tar.gz: f2c3924a192881c3960da34b36863efc6f1c0f5c2c9fe1c7868cb92e6483a4e9a3ca42514471a9c683c00fb880499228304e4dc91a28e46b1fe22e04aeca9e77
6
+ metadata.gz: 942cba76b39e140b07182d84af49bd553fd40dbf8020161de09cac8d65af0d85f47605b6d136f47586daa58aae7e8a719fcf16eb48d5253cb2dab33e2d6dc0a9
7
+ data.tar.gz: c36e3c588b4b97be0f74f313cc51e5f3fe501c32702c5203f89105dd7c0a385580fcd8b7c8f492a0a0c948a044dd325e06b19b8e389ca5552b5a1ff94fa55cd0
data/README.md CHANGED
@@ -100,3 +100,5 @@ http://public-app-1:password@localhost:3100
100
100
  2. Route matching on URL parameters from the query string
101
101
  3. Multi Application - The current infrastructure supports it, just need UI support - can already be done using REST
102
102
 
103
+ ## History
104
+ v0.1.8 Added support for plain text params parser - As DWR uses this (and maybe others)
@@ -79,12 +79,21 @@ module AgileProxy
79
79
 
80
80
  def rack_app
81
81
  route_set = @route_set
82
+ text_handler = plain_text_handler
82
83
  Rack::Builder.new do
83
- use ActionDispatch::ParamsParser
84
+ use ActionDispatch::ParamsParser, Mime::TEXT => text_handler
84
85
  use MergePostAndGetParams
85
86
  run route_set
86
87
  end
87
88
  end
89
+
90
+ def plain_text_handler
91
+ proc do |raw_post|
92
+ data_as_array = raw_post.split("\n").map {|line| line.split('=')}.flatten
93
+ data = Hash[*data_as_array]
94
+ ActionDispatch::Request::Utils.deep_munge(data).with_indifferent_access
95
+ end
96
+ end
88
97
  end
89
98
  #
90
99
  # @private
@@ -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.7'
5
+ VERSION = '0.1.8'
6
6
  end
@@ -84,6 +84,12 @@ shared_examples_for 'a request stub' do |options = {}|
84
84
  expect(resp.status).to eql 200
85
85
  expect(resp.headers['Content-Type']).to eql 'text/html'
86
86
  end
87
+ it 'Should match the route by posted plain text data and the posted data can be output via the template' do
88
+ resp = http.post '/api/forums/my_forum', "posted_var=special_value\n", 'Content-Type' => 'text/plain'
89
+ 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>'
90
+ expect(resp.status).to eql 200
91
+ expect(resp.headers['Content-Type']).to eql 'text/html'
92
+ end
87
93
  # it 'Should match the route by posted xml data and the posted data can be output via the template' do
88
94
  # resp = http.post "/api/forums/my_forum", '<posted_var>special_value</posted_var>', {'Content-Type' => 'application/xml'}
89
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>'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: agile-proxy
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.7
4
+ version: 0.1.8
5
5
  platform: ruby
6
6
  authors:
7
7
  - Gary Taylor
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-12-05 00:00:00.000000000 Z
11
+ date: 2014-12-09 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -1867,6 +1867,7 @@ files:
1867
1867
  - assets/ui/bower_components/angular-restmod/CONTRIBUTE.md
1868
1868
  - assets/ui/bower_components/angular-restmod/LICENSE.md
1869
1869
  - assets/ui/bower_components/angular-restmod/README.md
1870
+ - assets/ui/bower_components/angular-restmod/authors.md
1870
1871
  - assets/ui/bower_components/angular-restmod/bower.json
1871
1872
  - assets/ui/bower_components/angular-restmod/dist/angular-restmod-bundle.js
1872
1873
  - assets/ui/bower_components/angular-restmod/dist/angular-restmod-bundle.min.js
@@ -2193,7 +2194,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
2193
2194
  version: '0'
2194
2195
  requirements: []
2195
2196
  rubyforge_project:
2196
- rubygems_version: 2.4.2
2197
+ rubygems_version: 2.2.2
2197
2198
  signing_key:
2198
2199
  specification_version: 4
2199
2200
  summary: An agile, programmable, controllable flexible proxy server for development