mocktopus 0.1.3 → 0.1.4

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: 11ec3b399dd8e0d153c4329b0391620d0c24d6f9
4
- data.tar.gz: ff552697227fb4933a3960c01881297563d78519
3
+ metadata.gz: 30da376cf32eddf2ecc30c0b164f99f6bef93963
4
+ data.tar.gz: ade277507f628f20b1f44a8c4e7f7721d6af9d0d
5
5
  SHA512:
6
- metadata.gz: c03d2ea29fe2f2105b22db27478561867d4a5cbb6910990fd4446ea3417c7365aa5d2e50478dc7f1ff5089f5329d01e6cb9bde1f0efc4e07dd99fd8aace90a1a
7
- data.tar.gz: a9ad5adaef8070c71de1ba0e0b316dad2bc30a5b9f26e8d0a751da0e188c7944fafb2bf2a28d1acd9e1972dea6534dc1b197e1314649e8fe45e5fd2f392a6329
6
+ metadata.gz: a514f931b968ea6162bf50c6327ca16d1b67e889e2136d71a16412e0838f39e4fe70db3a632e82b41c26ac8c87c7e407d11152116def8b5a21e160acd5972ab8
7
+ data.tar.gz: e80e9da782506e982e900a4ea759ab33075167fb7632ef4935b14819471046657cd417ab9a1def4730966f2c883aa008c8a84f901c69b0ce63da1de970025ea0
@@ -1,5 +1,6 @@
1
1
  require 'time'
2
2
  require 'json'
3
+ require 'uri'
3
4
 
4
5
  module Mocktopus
5
6
 
@@ -17,7 +18,11 @@ module Mocktopus
17
18
  @verb = verb
18
19
  @headers = headers
19
20
  begin
20
- @body = JSON.parse(body)
21
+ @body = if @headers.has_key?('content_type') && @headers['content_type'] == 'application/x-www-form-urlencoded'
22
+ URI::decode_www_form_component(body).to_s
23
+ else
24
+ JSON.parse(body)
25
+ end
21
26
  rescue
22
27
  @body = body
23
28
  end
@@ -2,8 +2,8 @@
2
2
 
3
3
  Gem::Specification.new do |s|
4
4
  s.name = 'mocktopus'
5
- s.version = '0.1.3'
6
- s.date = '2017-03-14'
5
+ s.version = '0.1.4'
6
+ s.date = '2017-04-14'
7
7
  s.required_ruby_version = '>= 2.0.0'
8
8
 
9
9
  s.summary = 'A configurable mock Web API'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: mocktopus
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.3
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Rackspace
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-03-14 00:00:00.000000000 Z
11
+ date: 2017-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: sinatra