postbin 0.1.6 → 0.1.7

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA256:
3
+ metadata.gz: c8a93043bdf69fff0f20c62ac798f7cee5b8610c6b8117f19b1e4ba8397315bd
4
+ data.tar.gz: bf345bc469a36294efc40ef9cb18defd94397ba63793bbe1101d31f2d9bdcc13
5
+ SHA512:
6
+ metadata.gz: 8d52a504d59a19c329adc13454a760422e8ea436a64b5cb2adce727f9c804992c09673027c68c8dd466c6a254460d11ab624e5fed424b7bf31639c5214d7c3f1
7
+ data.tar.gz: 733b2b3eb71af21f2708beaccadb4c47243251d941b7f89e78ec1fd78e729bb3a409d1ac98e8cb13f30407ea3605bcfedc0cc62c3eed4399e368cb83e1e2407a
data/Gemfile CHANGED
@@ -1,2 +1,2 @@
1
- source :rubygems
2
- gemspec
1
+ source 'https://rubygems.org'
2
+ gemspec
data/HISTORY.md CHANGED
@@ -1,3 +1,14 @@
1
+ # History
2
+
3
+ This file contains the overall histroy/changelog of the project.
4
+
5
+ ## HEAD
6
+
7
+ ## 0.1.7 (2020-12-18)
8
+
9
+ * (#3 - @drnic - Dr Nic Williams) Add `thin` depndency to Gemspec.
10
+ * Documentation improvments and a some 'house keeping' commits to the repo.
11
+
1
12
  ## 0.1.6 (2012-01-04)
2
13
 
3
14
  * Added support for Ruby 1.8.7
data/README.md CHANGED
@@ -1,47 +1,98 @@
1
- PostBin
2
- =======
1
+ # PostBin
3
2
 
4
- PostBin, a simple web service for testing WebHooks (HTTP POST requests).
3
+ PostBin, a simple web service for testing and logging of the receival of WebHooks
4
+ (HTTP POST requests).
5
5
 
6
- Quick Start
7
- -----------
6
+ ## Quick Start: Stand Alone
8
7
 
9
- $ gem install postbin
10
- $ postbin
11
- == Starting PostBin on http://127.0.0.1:6969
12
- == Sinatra/1.3.1 has taken the stage on 6969 for development with backup from Thin
13
- >> Thin web server (v1.2.11 codename Bat-Shit Crazy)
14
- >> Maximum connections set to 1024
15
- >> Listening on 127.0.0.1:6969, CTRL+C to stop
8
+ ```shell
9
+ $ gem install postbin
10
+ $ postbin
11
+ == Starting PostBin on http://127.0.0.1:6969
12
+ == Sinatra/1.3.1 has taken the stage on 6969 for development with backup from Thin
13
+ >> Thin web server (v1.2.11 codename Bat-Shit Crazy)
14
+ >> Maximum connections set to 1024
15
+ >> Listening on 127.0.0.1:6969, CTRL+C to stop
16
+ ```
16
17
 
17
18
  When running postbin from the command line, requests are stored in a temporary
18
19
  file database, they will be lost once the server terminates.
19
20
 
20
- Rack Application
21
- ----------------
21
+ You can then submit a basic POST request using `curl` as follows:
22
+
23
+ ```shell
24
+ curl --header "Content-Type: application/json" \
25
+ --request POST \
26
+ --data '{"foo":"bar", "hello":"world", "number": 42}' \
27
+ http://127.0.0.1:6969/my/fake/path
28
+ ```
29
+
30
+ Rar
31
+
32
+ ## Quick Start: Rack Application
22
33
 
23
34
  You can run a more permeant install by running PostBin as a Rack application:
24
35
 
25
- # example config.ru
26
- require 'postbin'
36
+ ```ruby
37
+ # example config.ru
38
+ require 'postbin'
39
+
40
+ # path of pstore file to use for storage.
41
+ pstore = File.expand_path(File.join(File.dirname(__FILE__), 'postbin.pstore'))
42
+
43
+ # start the server.
44
+ PostBin::Server.set :pstore_file, pstore
45
+ run PostBin::Server.new(pstore)
46
+ ```
47
+
48
+ ## Command Line Options
49
+
50
+ ```text
51
+ Usage: postbin [options]
52
+
53
+ PostBin options:
54
+ -v, --version show version number
55
+ -h, --help show this message
56
+
57
+ Rack options:
58
+ -s, --server SERVER server (webrick, mongrel, thin, etc.)
59
+ -a, --address HOST listen on HOST address (default: 127.0.0.1)
60
+ -p, --port PORT use PORT number (default: 6969)
61
+ ```
62
+
63
+ ---
64
+
65
+ ## Quick Start: Local Development
66
+
67
+ Local development/testing is handled by `rake` tasks for the most part:
27
68
 
28
- # path of pstore file to use for storage.
29
- pstore = File.expand_path(File.join(File.dirname(__FILE__), 'postbin.pstore'))
69
+ ```shell
70
+ # list available `rake` task
71
+ rake -T
72
+ # build and install gem
73
+ rake install
74
+ ```
30
75
 
31
- # start the server.
32
- PostBin::Server.set :pstore_file, pstore
33
- run PostBin::Server.new(pstore)
76
+ If you wish to build/test a set of uncommited changes:
34
77
 
35
- Command Line Options
36
- --------------------
78
+ ```shell
79
+ # build gem
80
+ gem build postbin.gemspec
81
+ # install gem (adjust as needed)
82
+ gem install postbin-<VERSION>.gem
83
+ ```
37
84
 
38
- Usage: postbin [options]
85
+ ## Release Instructions
39
86
 
40
- PostBin options:
41
- -v, --version show version number
42
- -h, --help show this message
87
+ 1. Bump the version number found in `lib/postbin/version.rb`.
88
+ 2. Tag git repo with the same version number.
89
+ 3. Publush `.gem` to https://rubygems.org/:
43
90
 
44
- Rack options:
45
- -s, --server SERVER server (webrick, mongrel, thin, etc.)
46
- -a, --address HOST listen on HOST address (default: 127.0.0.1)
47
- -p, --port PORT use PORT number (default: 6969)
91
+ ```shell
92
+ # ensure tests pass first
93
+ rake test
94
+ # build a new gem
95
+ rake build
96
+ # release the new gem
97
+ rake release
98
+ ```
data/Rakefile CHANGED
@@ -1,14 +1,18 @@
1
1
  require 'rubygems' unless defined?(Gem)
2
2
  require 'rake/testtask'
3
+ require 'rubygems/tasks'
3
4
 
4
5
  # by default run unit tests.
5
- task :default => 'test:unit'
6
+ task :default => 'test'
6
7
 
7
- namespace :test do
8
- # unit tests.
9
- Rake::TestTask.new(:unit) do |task|
10
- task.libs << 'test'
11
- task.test_files = FileList['test/**/*_test.rb']
12
- task.verbose = true
13
- end
8
+ # unit tests.
9
+ Rake::TestTask.new(:test) do |task|
10
+ task.libs << 'test'
11
+ task.test_files = FileList['test/**/*_test.rb']
12
+ task.verbose = true
14
13
  end
14
+
15
+ # gem build/relase tasks
16
+ Gem::Tasks.new(
17
+ build: {gem: true},
18
+ )
@@ -12,7 +12,7 @@ module PostBin
12
12
 
13
13
  # Redirect lost users.
14
14
  get '/?' do; redirect '/postbin/overview'; end
15
- get '/postbin/?' do; redirect '/postbin/overview'; end
15
+ get '/postbin/?' do; redirect '/postbin/overview'; end
16
16
 
17
17
  # Display main overview.
18
18
  get '/postbin/overview' do
@@ -1,3 +1,3 @@
1
1
  module PostBin
2
- Version = '0.1.6'
2
+ Version = '0.1.7'
3
3
  end
@@ -3,30 +3,31 @@ require './lib/postbin/version'
3
3
  spec = Gem::Specification.new do |s|
4
4
  s.name = 'postbin'
5
5
  s.version = PostBin::Version
6
+ s.licenses = 'MIT'
6
7
  s.date = Time.now.strftime('%Y-%m-%d')
7
8
  s.summary = 'PostBin, a simple web service for testing WebHooks (HTTP POST requests).'
8
9
  s.homepage = 'https://github.com/lantins/postbin'
9
10
  s.authors = ['Luke Antins']
10
11
  s.email = ['luke@lividpenguin.com']
11
- s.has_rdoc = false
12
12
 
13
13
  s.files = %w(Rakefile README.md HISTORY.md Gemfile postbin.gemspec)
14
14
  s.files += Dir.glob('{test/**/*,lib/**/*}')
15
15
  s.require_paths = ['lib']
16
16
  s.executables = ['postbin']
17
- s.default_executable = 'postbin'
18
17
 
19
- s.add_dependency('sinatra')
20
- s.add_dependency('multi_json')
21
- s.add_dependency('json')
22
- s.add_development_dependency('rake')
23
- s.add_development_dependency('yard')
24
- s.add_development_dependency('minitest')
25
- s.add_development_dependency('rack-test')
26
- s.add_development_dependency('bundler')
18
+ s.add_dependency('sinatra', '~> 2.0')
19
+ s.add_dependency('multi_json', '~> 1.0')
20
+ s.add_dependency('json', '~> 2.0')
21
+ s.add_dependency('thin', '~> 1')
22
+ s.add_development_dependency('rake', '~> 13.0')
23
+ s.add_development_dependency('yard', '~> 0.9')
24
+ s.add_development_dependency('minitest', '~> 5.14')
25
+ s.add_development_dependency('rack-test', '~> 1.1')
26
+ s.add_development_dependency('bundler', '~> 2.1')
27
+ s.add_development_dependency('rubygems-tasks', '~> 0.2')
27
28
 
28
29
  s.description = <<-EOL
29
30
  A ruby command line/rack application for testing systems that send WebHooks
30
31
  using a HTTP POST request. Requests can be viewed via a simple web interface.
31
32
  EOL
32
- end
33
+ end
metadata CHANGED
@@ -1,106 +1,158 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: postbin
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.6
5
- prerelease:
4
+ version: 0.1.7
6
5
  platform: ruby
7
6
  authors:
8
7
  - Luke Antins
9
- autorequire:
8
+ autorequire:
10
9
  bindir: bin
11
10
  cert_chain: []
12
- date: 2012-01-04 00:00:00.000000000Z
11
+ date: 2020-12-18 00:00:00.000000000 Z
13
12
  dependencies:
14
13
  - !ruby/object:Gem::Dependency
15
14
  name: sinatra
16
- requirement: &2166202940 !ruby/object:Gem::Requirement
17
- none: false
15
+ requirement: !ruby/object:Gem::Requirement
18
16
  requirements:
19
- - - ! '>='
17
+ - - "~>"
20
18
  - !ruby/object:Gem::Version
21
- version: '0'
19
+ version: '2.0'
22
20
  type: :runtime
23
21
  prerelease: false
24
- version_requirements: *2166202940
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '2.0'
25
27
  - !ruby/object:Gem::Dependency
26
28
  name: multi_json
27
- requirement: &2166202180 !ruby/object:Gem::Requirement
28
- none: false
29
+ requirement: !ruby/object:Gem::Requirement
29
30
  requirements:
30
- - - ! '>='
31
+ - - "~>"
31
32
  - !ruby/object:Gem::Version
32
- version: '0'
33
+ version: '1.0'
33
34
  type: :runtime
34
35
  prerelease: false
35
- version_requirements: *2166202180
36
+ version_requirements: !ruby/object:Gem::Requirement
37
+ requirements:
38
+ - - "~>"
39
+ - !ruby/object:Gem::Version
40
+ version: '1.0'
36
41
  - !ruby/object:Gem::Dependency
37
42
  name: json
38
- requirement: &2166201760 !ruby/object:Gem::Requirement
39
- none: false
43
+ requirement: !ruby/object:Gem::Requirement
40
44
  requirements:
41
- - - ! '>='
45
+ - - "~>"
42
46
  - !ruby/object:Gem::Version
43
- version: '0'
47
+ version: '2.0'
44
48
  type: :runtime
45
49
  prerelease: false
46
- version_requirements: *2166201760
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '2.0'
55
+ - !ruby/object:Gem::Dependency
56
+ name: thin
57
+ requirement: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - "~>"
60
+ - !ruby/object:Gem::Version
61
+ version: '1'
62
+ type: :runtime
63
+ prerelease: false
64
+ version_requirements: !ruby/object:Gem::Requirement
65
+ requirements:
66
+ - - "~>"
67
+ - !ruby/object:Gem::Version
68
+ version: '1'
47
69
  - !ruby/object:Gem::Dependency
48
70
  name: rake
49
- requirement: &2166201340 !ruby/object:Gem::Requirement
50
- none: false
71
+ requirement: !ruby/object:Gem::Requirement
51
72
  requirements:
52
- - - ! '>='
73
+ - - "~>"
53
74
  - !ruby/object:Gem::Version
54
- version: '0'
75
+ version: '13.0'
55
76
  type: :development
56
77
  prerelease: false
57
- version_requirements: *2166201340
78
+ version_requirements: !ruby/object:Gem::Requirement
79
+ requirements:
80
+ - - "~>"
81
+ - !ruby/object:Gem::Version
82
+ version: '13.0'
58
83
  - !ruby/object:Gem::Dependency
59
84
  name: yard
60
- requirement: &2166200900 !ruby/object:Gem::Requirement
61
- none: false
85
+ requirement: !ruby/object:Gem::Requirement
62
86
  requirements:
63
- - - ! '>='
87
+ - - "~>"
64
88
  - !ruby/object:Gem::Version
65
- version: '0'
89
+ version: '0.9'
66
90
  type: :development
67
91
  prerelease: false
68
- version_requirements: *2166200900
92
+ version_requirements: !ruby/object:Gem::Requirement
93
+ requirements:
94
+ - - "~>"
95
+ - !ruby/object:Gem::Version
96
+ version: '0.9'
69
97
  - !ruby/object:Gem::Dependency
70
98
  name: minitest
71
- requirement: &2166200440 !ruby/object:Gem::Requirement
72
- none: false
99
+ requirement: !ruby/object:Gem::Requirement
73
100
  requirements:
74
- - - ! '>='
101
+ - - "~>"
75
102
  - !ruby/object:Gem::Version
76
- version: '0'
103
+ version: '5.14'
77
104
  type: :development
78
105
  prerelease: false
79
- version_requirements: *2166200440
106
+ version_requirements: !ruby/object:Gem::Requirement
107
+ requirements:
108
+ - - "~>"
109
+ - !ruby/object:Gem::Version
110
+ version: '5.14'
80
111
  - !ruby/object:Gem::Dependency
81
112
  name: rack-test
82
- requirement: &2166200000 !ruby/object:Gem::Requirement
83
- none: false
113
+ requirement: !ruby/object:Gem::Requirement
84
114
  requirements:
85
- - - ! '>='
115
+ - - "~>"
86
116
  - !ruby/object:Gem::Version
87
- version: '0'
117
+ version: '1.1'
88
118
  type: :development
89
119
  prerelease: false
90
- version_requirements: *2166200000
120
+ version_requirements: !ruby/object:Gem::Requirement
121
+ requirements:
122
+ - - "~>"
123
+ - !ruby/object:Gem::Version
124
+ version: '1.1'
91
125
  - !ruby/object:Gem::Dependency
92
126
  name: bundler
93
- requirement: &2166199580 !ruby/object:Gem::Requirement
94
- none: false
127
+ requirement: !ruby/object:Gem::Requirement
128
+ requirements:
129
+ - - "~>"
130
+ - !ruby/object:Gem::Version
131
+ version: '2.1'
132
+ type: :development
133
+ prerelease: false
134
+ version_requirements: !ruby/object:Gem::Requirement
135
+ requirements:
136
+ - - "~>"
137
+ - !ruby/object:Gem::Version
138
+ version: '2.1'
139
+ - !ruby/object:Gem::Dependency
140
+ name: rubygems-tasks
141
+ requirement: !ruby/object:Gem::Requirement
95
142
  requirements:
96
- - - ! '>='
143
+ - - "~>"
97
144
  - !ruby/object:Gem::Version
98
- version: '0'
145
+ version: '0.2'
99
146
  type: :development
100
147
  prerelease: false
101
- version_requirements: *2166199580
102
- description: ! " A ruby command line/rack application for testing systems that send
103
- WebHooks\n using a HTTP POST request. Requests can be viewed via a simple web interface.\n"
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - "~>"
151
+ - !ruby/object:Gem::Version
152
+ version: '0.2'
153
+ description: |2
154
+ A ruby command line/rack application for testing systems that send WebHooks
155
+ using a HTTP POST request. Requests can be viewed via a simple web interface.
104
156
  email:
105
157
  - luke@lividpenguin.com
106
158
  executables:
@@ -108,47 +160,45 @@ executables:
108
160
  extensions: []
109
161
  extra_rdoc_files: []
110
162
  files:
111
- - Rakefile
112
- - README.md
113
- - HISTORY.md
114
163
  - Gemfile
164
+ - HISTORY.md
165
+ - README.md
166
+ - Rakefile
167
+ - bin/postbin
168
+ - lib/postbin.rb
169
+ - lib/postbin/post.rb
170
+ - lib/postbin/server.rb
171
+ - lib/postbin/server/views/layout.erb
172
+ - lib/postbin/server/views/overview.erb
173
+ - lib/postbin/storage.rb
174
+ - lib/postbin/version.rb
115
175
  - postbin.gemspec
116
176
  - test/post_test.rb
117
177
  - test/server_test.rb
118
178
  - test/storage_test.rb
119
179
  - test/test_helper.rb
120
180
  - test/version_test.rb
121
- - lib/postbin/post.rb
122
- - lib/postbin/server/views/layout.erb
123
- - lib/postbin/server/views/overview.erb
124
- - lib/postbin/server.rb
125
- - lib/postbin/storage.rb
126
- - lib/postbin/version.rb
127
- - lib/postbin.rb
128
- - bin/postbin
129
181
  homepage: https://github.com/lantins/postbin
130
- licenses: []
131
- post_install_message:
182
+ licenses:
183
+ - MIT
184
+ metadata: {}
185
+ post_install_message:
132
186
  rdoc_options: []
133
187
  require_paths:
134
188
  - lib
135
189
  required_ruby_version: !ruby/object:Gem::Requirement
136
- none: false
137
190
  requirements:
138
- - - ! '>='
191
+ - - ">="
139
192
  - !ruby/object:Gem::Version
140
193
  version: '0'
141
194
  required_rubygems_version: !ruby/object:Gem::Requirement
142
- none: false
143
195
  requirements:
144
- - - ! '>='
196
+ - - ">="
145
197
  - !ruby/object:Gem::Version
146
198
  version: '0'
147
199
  requirements: []
148
- rubyforge_project:
149
- rubygems_version: 1.8.10
150
- signing_key:
151
- specification_version: 3
200
+ rubygems_version: 3.1.4
201
+ signing_key:
202
+ specification_version: 4
152
203
  summary: PostBin, a simple web service for testing WebHooks (HTTP POST requests).
153
204
  test_files: []
154
- has_rdoc: false