optimus_prime 4.4.3 → 4.6.0

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: 45a62d9b8b16d8795c1cb4c35bf9b7d9fcb1ff75
4
- data.tar.gz: 4b0d103b77fab14ba473fa7d9ac52ad286eb9d9b
3
+ metadata.gz: 6002a6846076a2ab40d1c20b4db9a1ac0e4c9f9c
4
+ data.tar.gz: ec4a56f8542382076e5078e98ea1b996ec97bd5b
5
5
  SHA512:
6
- metadata.gz: 7c38e1e57e5318ec2d933ebbf67a90961773aa9089d8e1b385a9e61e2483b1c6781a68a5603f8fbbad9fdf190b2eedc53128f94530fbcf035cbc474cf921d164
7
- data.tar.gz: 7568486884aef47da24ff662582a4fc633f4447f7e6316b256a7475e004b94d163635e490bbbf13c10b5c648e627d1e4152883dfdbb8b1d6fbb0d63a6a3855cf
6
+ metadata.gz: 987faf196d8675bddda88f8afa986d7559fac01ff4e949aeaae95ffeda84ff8d8124f1ae652e7b64eaa80cbacded161bae7fb429db6e1da0e39f5d2e3fc1f2e6
7
+ data.tar.gz: 3d3816981345f13fdc7fea338760fffc0419a6b7968a942b0139e946d8d23595268f169659ce2f2218ae0c3da64bfb53aa61e03ea547e64c3298606eb9ecfd2c
checksums.yaml.gz.sig CHANGED
Binary file
@@ -131,7 +131,11 @@ module OptimusPrime
131
131
  params = JSON(payload.empty? ? '{}' : payload)
132
132
 
133
133
  path = params["path_name"]
134
- responses[path] = { content_type: (params["content_type"] || :html), body: params["response"], status_code: (params["status_code"] || 200), requested_with: (params["requested_with"] || false), sleep: (params["sleep"] || false), persisted: (params["persisted"] || false) }
134
+
135
+ body = params["response"]
136
+ body = body.is_a?(String) ? body : body.to_json
137
+
138
+ responses[path] = { content_type: (params["content_type"] || :html), body: body, status_code: (params["status_code"] || 200), requested_with: (params["requested_with"] || false), sleep: (params["sleep"] || false), persisted: (params["persisted"] || false) }
135
139
  requests[path] = { count: 0, last_request: nil }
136
140
  201
137
141
  end
@@ -1,3 +1,3 @@
1
1
  module OptimusPrime
2
- VERSION = "4.4.3"
2
+ VERSION = "4.6.0"
3
3
  end
data/optimus_prime.log CHANGED
@@ -17677,3 +17677,144 @@ Maximum connections set to 1024
17677
17677
  Listening on 0.0.0.0:7002, CTRL+C to stop
17678
17678
  Waiting for 1 connection(s) to finish, can take up to 30 sec, CTRL+C to stop now
17679
17679
  Exiting!
17680
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17681
+ Using rack adapter
17682
+ Thin web server (v1.6.3 codename Protein Powder)
17683
+ Debugging ON
17684
+ Maximum connections set to 1024
17685
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17686
+ Exiting!
17687
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17688
+ Using rack adapter
17689
+ Thin web server (v1.6.3 codename Protein Powder)
17690
+ Debugging ON
17691
+ Maximum connections set to 1024
17692
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17693
+ Exiting!
17694
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17695
+ Using rack adapter
17696
+ Thin web server (v1.6.3 codename Protein Powder)
17697
+ Debugging ON
17698
+ Maximum connections set to 1024
17699
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17700
+ Exiting!
17701
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17702
+ Using rack adapter
17703
+ Thin web server (v1.6.3 codename Protein Powder)
17704
+ Debugging ON
17705
+ Maximum connections set to 1024
17706
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17707
+ Exiting!
17708
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17709
+ Using rack adapter
17710
+ Thin web server (v1.6.3 codename Protein Powder)
17711
+ Debugging ON
17712
+ Maximum connections set to 1024
17713
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17714
+ Exiting!
17715
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17716
+ Using rack adapter
17717
+ Thin web server (v1.6.3 codename Protein Powder)
17718
+ Debugging ON
17719
+ Maximum connections set to 1024
17720
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17721
+ Exiting!
17722
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17723
+ Using rack adapter
17724
+ Thin web server (v1.6.3 codename Protein Powder)
17725
+ Debugging ON
17726
+ Maximum connections set to 1024
17727
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17728
+ Exiting!
17729
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17730
+ Using rack adapter
17731
+ Thin web server (v1.6.3 codename Protein Powder)
17732
+ Debugging ON
17733
+ Maximum connections set to 1024
17734
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17735
+ Exiting!
17736
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17737
+ Using rack adapter
17738
+ Thin web server (v1.6.3 codename Protein Powder)
17739
+ Debugging ON
17740
+ Maximum connections set to 1024
17741
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17742
+ Exiting!
17743
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17744
+ Using rack adapter
17745
+ Thin web server (v1.6.3 codename Protein Powder)
17746
+ Debugging ON
17747
+ Maximum connections set to 1024
17748
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17749
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17750
+ Using rack adapter
17751
+ Thin web server (v1.6.3 codename Protein Powder)
17752
+ Debugging ON
17753
+ Maximum connections set to 1024
17754
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17755
+ Exiting!
17756
+ Writing PID to /Users/acnalesso/dev/all/optimus_prime/tmp/pids/optimus_prime.pid
17757
+ Using rack adapter
17758
+ Thin web server (v1.6.3 codename Protein Powder)
17759
+ Debugging ON
17760
+ Maximum connections set to 1024
17761
+ Listening on 0.0.0.0:7003, CTRL+C to stop
17762
+ JSON::ParserError - 757: unexpected token at 'status=YES':
17763
+ /Users/acnalesso/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/json/common.rb:155:in `parse'
17764
+ /Users/acnalesso/.rvm/rubies/ruby-2.1.3/lib/ruby/2.1.0/json/common.rb:155:in `parse'
17765
+ /Users/acnalesso/dev/all/optimus_prime/lib/optimus_prime/server.rb:215:in `parse_request'
17766
+ /Users/acnalesso/dev/all/optimus_prime/lib/optimus_prime/server.rb:90:in `block in <class:Server>'
17767
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `call'
17768
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1603:in `block in compile!'
17769
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `[]'
17770
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (3 levels) in route!'
17771
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:985:in `route_eval'
17772
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:966:in `block (2 levels) in route!'
17773
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1006:in `block in process_route'
17774
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `catch'
17775
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1004:in `process_route'
17776
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:964:in `block in route!'
17777
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `each'
17778
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:963:in `route!'
17779
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1076:in `block in dispatch!'
17780
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
17781
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
17782
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
17783
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1073:in `dispatch!'
17784
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `block in call!'
17785
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `block in invoke'
17786
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `catch'
17787
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1058:in `invoke'
17788
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:898:in `call!'
17789
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:886:in `call'
17790
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/xss_header.rb:18:in `call'
17791
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/path_traversal.rb:16:in `call'
17792
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/json_csrf.rb:18:in `call'
17793
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
17794
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/base.rb:49:in `call'
17795
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-protection-1.5.3/lib/rack/protection/frame_options.rb:31:in `call'
17796
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/nulllogger.rb:9:in `call'
17797
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/rack-1.5.2/lib/rack/head.rb:11:in `call'
17798
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:180:in `call'
17799
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:2014:in `call'
17800
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `block in call'
17801
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1788:in `synchronize'
17802
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/sinatra-1.4.5/lib/sinatra/base.rb:1478:in `call'
17803
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/connection.rb:86:in `block in pre_process'
17804
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/connection.rb:84:in `catch'
17805
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/connection.rb:84:in `pre_process'
17806
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/connection.rb:53:in `process'
17807
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/connection.rb:39:in `receive_data'
17808
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run_machine'
17809
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/eventmachine-1.0.7/lib/eventmachine.rb:187:in `run'
17810
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/backends/base.rb:73:in `start'
17811
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/server.rb:162:in `start'
17812
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/controllers/controller.rb:87:in `start'
17813
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/runner.rb:200:in `run_command'
17814
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/lib/thin/runner.rb:156:in `run!'
17815
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/gems/thin-1.6.3/bin/thin:6:in `<top (required)>'
17816
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/bin/thin:23:in `load'
17817
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/bin/thin:23:in `<main>'
17818
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `eval'
17819
+ /Users/acnalesso/.rvm/gems/ruby-2.1.3/bin/ruby_executable_hooks:15:in `<main>'
17820
+ Exiting!
@@ -14,6 +14,14 @@ describe OptimusPrime do
14
14
  expect( op.prime("test").status ).to eq 201
15
15
  end
16
16
 
17
+ it "converts response payload, body, to string if it is not" do
18
+ op.prime('not-a-string', { string: false }, content_type: :json)
19
+
20
+ response = ::Faraday.new("http://localhost:7003").get('/get/not-a-string').body
21
+
22
+ expect(response).to eq('{"string":false}')
23
+ end
24
+
17
25
  it "records the custom X-Params header" do
18
26
  op.prime('custom-x-params', '{}', content_type: :json)
19
27
 
data.tar.gz.sig CHANGED
@@ -1,3 +1,4 @@
1
- Z�NjA˰��MR�pU����;e�81�W�cM�項��[]���Ħ�Ea?+a�jRc��i���;�K(`�`�%4�״�7��ȵ�z�F M|��Ռi��{��r`�Y�G? �cy[Nn3���bg�����8<%�H��3�AQ㛏��,��� �#��ԭ��qG���qX����Azݰ��
2
- rP�ÖrpN3�F#�"
3
- W�ރf4>]���JE*�ُ�]�t��*_�̻#Pe� ��22x6ab�8�
1
+ y�<��5a u���F�|÷%��5!�
2
+ b��pC��8��9�ڵȬ�97PZ�k ��R^0���h@Wv�������r ��
3
+ V�&h.u�l��Rn]�;��pckyr7��!�(oϒ�pj$�ާ���8��l($�OБO�񓴭�d}��!�����=�!��2�?��
4
+ �8��_.D�߾�j�{��$�E�rk�4���@�3 P���k�nCC�F�kM~rm���Jr����7 ο�V��@
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: optimus_prime
3
3
  version: !ruby/object:Gem::Version
4
- version: 4.4.3
4
+ version: 4.6.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Antonio Nalesso
@@ -31,7 +31,7 @@ cert_chain:
31
31
  xfaQSY/+k+cXJaUpE/aBsIgIzxuVJe98YWDtAgYpmo2jKsPleBAERd2lsSnfV4hj
32
32
  hAycz5zInHKNXc6zcb6ge0NC
33
33
  -----END CERTIFICATE-----
34
- date: 2015-06-02 00:00:00.000000000 Z
34
+ date: 2015-06-11 00:00:00.000000000 Z
35
35
  dependencies:
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: bundler
metadata.gz.sig CHANGED
Binary file