see_your_requests 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/bin/see_your_requests +27 -0
- data/lib/see_your_requests.rb +16 -0
- metadata +103 -0
checksums.yaml
ADDED
@@ -0,0 +1,7 @@
|
|
1
|
+
---
|
2
|
+
SHA1:
|
3
|
+
metadata.gz: 8ca0a78d0fb8dd4a718c932b79c3625d7366ae0f
|
4
|
+
data.tar.gz: 5521cecec7738f4340063344b8bbfc026ddc7b6c
|
5
|
+
SHA512:
|
6
|
+
metadata.gz: 565ef8627183357b6b31367a8f0efec3c5f2452a2c644342aab147b0ff93a907255f3de766b239a800c4ba74da1b3ea08457db6340926bb25217d3cfb73aef89
|
7
|
+
data.tar.gz: d9803443f8faa8173013cc489fb8df7e38950cf7d90f217e55596725c7f5633f1178b19221e46bc09460ab82930f1e6abde287efba9e40c140f781acf878e44b
|
@@ -0,0 +1,27 @@
|
|
1
|
+
#!/usr/bin/env ruby
|
2
|
+
require 'optparse'
|
3
|
+
|
4
|
+
options = {}
|
5
|
+
OptionParser.new do |opts|
|
6
|
+
opts.banner = "Usage: see_your_requests [options]"
|
7
|
+
opts.on("-pPORT", "--port=PORT", "Specify port to run on") do |port|
|
8
|
+
options[:port] = port
|
9
|
+
end
|
10
|
+
|
11
|
+
opts.on("-h", "--help", "Prints help") do
|
12
|
+
puts opts
|
13
|
+
exit
|
14
|
+
end
|
15
|
+
end.parse!
|
16
|
+
|
17
|
+
begin
|
18
|
+
require 'see_your_requests.rb'
|
19
|
+
rescue LoadError => e
|
20
|
+
require 'rubygems'
|
21
|
+
path = File.expand_path '../../lib', __FILE__
|
22
|
+
$:.unshift(path) if File.directory?(path) && !$:.include?(path)
|
23
|
+
require 'see_your_requests.rb'
|
24
|
+
end
|
25
|
+
|
26
|
+
port = options[:port] || 4567
|
27
|
+
SeeYourRequests.run!(port: port)
|
@@ -0,0 +1,16 @@
|
|
1
|
+
require 'sinatra/base'
|
2
|
+
require 'sinatra/multi_route'
|
3
|
+
require 'awesome_print'
|
4
|
+
|
5
|
+
class SeeYourRequests < Sinatra::Base
|
6
|
+
register Sinatra::MultiRoute
|
7
|
+
|
8
|
+
route :get, :post, :put, :delete, :head, :options, '/' do
|
9
|
+
content_type :text
|
10
|
+
ap request.env.reject { |k, v| k =~ /^rack.*/ }
|
11
|
+
if request.body.size > 0
|
12
|
+
ap request.body.read
|
13
|
+
end
|
14
|
+
end
|
15
|
+
|
16
|
+
end
|
metadata
ADDED
@@ -0,0 +1,103 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: see_your_requests
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.1.0
|
5
|
+
platform: ruby
|
6
|
+
authors:
|
7
|
+
- Casey Davidson
|
8
|
+
autorequire:
|
9
|
+
bindir: bin
|
10
|
+
cert_chain: []
|
11
|
+
date: 2016-05-04 00:00:00.000000000 Z
|
12
|
+
dependencies:
|
13
|
+
- !ruby/object:Gem::Dependency
|
14
|
+
name: sinatra
|
15
|
+
requirement: !ruby/object:Gem::Requirement
|
16
|
+
requirements:
|
17
|
+
- - "~>"
|
18
|
+
- !ruby/object:Gem::Version
|
19
|
+
version: '1.4'
|
20
|
+
type: :runtime
|
21
|
+
prerelease: false
|
22
|
+
version_requirements: !ruby/object:Gem::Requirement
|
23
|
+
requirements:
|
24
|
+
- - "~>"
|
25
|
+
- !ruby/object:Gem::Version
|
26
|
+
version: '1.4'
|
27
|
+
- !ruby/object:Gem::Dependency
|
28
|
+
name: sinatra-contrib
|
29
|
+
requirement: !ruby/object:Gem::Requirement
|
30
|
+
requirements:
|
31
|
+
- - "~>"
|
32
|
+
- !ruby/object:Gem::Version
|
33
|
+
version: '1.4'
|
34
|
+
type: :runtime
|
35
|
+
prerelease: false
|
36
|
+
version_requirements: !ruby/object:Gem::Requirement
|
37
|
+
requirements:
|
38
|
+
- - "~>"
|
39
|
+
- !ruby/object:Gem::Version
|
40
|
+
version: '1.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: awesome_print
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '1.2'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '1.2'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rspec
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '3.4'
|
62
|
+
type: :development
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '3.4'
|
69
|
+
description: A lightweight application that allows you to easily see your requests.
|
70
|
+
Useful for debugging API authorization, among others.
|
71
|
+
email:
|
72
|
+
executables:
|
73
|
+
- see_your_requests
|
74
|
+
extensions: []
|
75
|
+
extra_rdoc_files: []
|
76
|
+
files:
|
77
|
+
- bin/see_your_requests
|
78
|
+
- lib/see_your_requests.rb
|
79
|
+
homepage:
|
80
|
+
licenses:
|
81
|
+
- MIT
|
82
|
+
metadata: {}
|
83
|
+
post_install_message:
|
84
|
+
rdoc_options: []
|
85
|
+
require_paths:
|
86
|
+
- lib
|
87
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
88
|
+
requirements:
|
89
|
+
- - ">="
|
90
|
+
- !ruby/object:Gem::Version
|
91
|
+
version: '0'
|
92
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
93
|
+
requirements:
|
94
|
+
- - ">="
|
95
|
+
- !ruby/object:Gem::Version
|
96
|
+
version: '0'
|
97
|
+
requirements: []
|
98
|
+
rubyforge_project:
|
99
|
+
rubygems_version: 2.4.5.1
|
100
|
+
signing_key:
|
101
|
+
specification_version: 4
|
102
|
+
summary: Making requests human readable for debugging
|
103
|
+
test_files: []
|