tardy 0.0.1

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.
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 88e9c584d27916684349e24480dc5c93af8f5c3d
4
+ data.tar.gz: a9759f096f71cd7472611d044d50428a7a65594b
5
+ SHA512:
6
+ metadata.gz: 530b1fad838a2774e8ad7f9d6a01a7638022ffd6a9d17ad83eb923d2870ecdb1fab4f000309a27f42cc13e58b6b3e03c4ebcc8f42341c9e928463b07eaf31caa
7
+ data.tar.gz: 5a892577212ce4090e7d4c28ec12ebe8e851a129224e7b83a73fa5cfc338e6b97ba3917397d5a0e76b638ee3e05334f04bf062b7d190fc83c46b8591073d9fba
data/Gemfile ADDED
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ source 'https://rubygems.org'
4
+
5
+ gemspec
6
+
7
+ group :production do
8
+ gem 'rails_12factor'
9
+ end
10
+
11
+ group :production, :development do
12
+ gem 'puma'
13
+ end
14
+
15
+ group :development do
16
+ gem 'foreman'
17
+ end
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2017 Richard Doe
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1 @@
1
+ web: bundle exec puma -C config/puma.rb
@@ -0,0 +1,17 @@
1
+ Tardy
2
+ =====
3
+
4
+ Sinatra app responding to any HTTP request by waiting 90 seconds then returning
5
+ a simple JSON response.
6
+
7
+ For testing handling of slow HTTP responses by other apps.
8
+
9
+ ## Usage
10
+
11
+ `bundle exec rackup`
12
+
13
+ ## License
14
+
15
+ Licensed under the MIT license.
16
+
17
+ For full details, see [LICENSE](LICENSE).
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+ require File.expand_path('../config/boot', __FILE__)
3
+
4
+ require 'tardy/app'
5
+
6
+ run Tardy::App
@@ -0,0 +1,7 @@
1
+ # frozen_string_literal: true
2
+
3
+ $LOAD_PATH.unshift(File.expand_path('../../lib', __FILE__))
4
+
5
+ require 'bundler/setup'
6
+ ENV['RACK_ENV'] ||= 'development'
7
+ Bundler.require(:default, ENV['RACK_ENV'])
@@ -0,0 +1,10 @@
1
+ # frozen_string_literal: true
2
+ workers Integer(ENV['WEB_CONCURRENCY'] || 2)
3
+ threads_count = Integer(ENV['MAX_THREADS'] || 5)
4
+ threads threads_count, threads_count
5
+
6
+ preload_app!
7
+
8
+ rackup DefaultRackup
9
+ port ENV['PORT'] || 3000
10
+ environment ENV['RACK_ENV'] || 'development'
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tardy
4
+ autoload :App, 'tardy/app'
5
+ end
@@ -0,0 +1,17 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'json'
4
+ require 'sinatra'
5
+
6
+ module Tardy
7
+ class App < Sinatra::Base
8
+ get '*' do |path|
9
+ sleep 90
10
+ [
11
+ 200,
12
+ { 'Content-Type' => 'application/json' },
13
+ [{ 'path' => path }.to_json]
14
+ ]
15
+ end
16
+ end
17
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Tardy
4
+ VERSION = '0.0.1'
5
+ end
metadata ADDED
@@ -0,0 +1,68 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: tardy
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: ruby
6
+ authors:
7
+ - Richard Doe
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-06-22 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'
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - "~>"
25
+ - !ruby/object:Gem::Version
26
+ version: '1'
27
+ description:
28
+ email:
29
+ - richard.doe@rwdit.net
30
+ executables: []
31
+ extensions: []
32
+ extra_rdoc_files: []
33
+ files:
34
+ - Gemfile
35
+ - LICENSE
36
+ - Procfile
37
+ - README.md
38
+ - config.ru
39
+ - config/boot.rb
40
+ - config/puma.rb
41
+ - lib/tardy.rb
42
+ - lib/tardy/app.rb
43
+ - lib/tardy/version.rb
44
+ homepage: https://github.com/rwd/tardy
45
+ licenses:
46
+ - MIT
47
+ metadata: {}
48
+ post_install_message:
49
+ rdoc_options: []
50
+ require_paths:
51
+ - lib
52
+ required_ruby_version: !ruby/object:Gem::Requirement
53
+ requirements:
54
+ - - ">="
55
+ - !ruby/object:Gem::Version
56
+ version: 2.1.0
57
+ required_rubygems_version: !ruby/object:Gem::Requirement
58
+ requirements:
59
+ - - ">="
60
+ - !ruby/object:Gem::Version
61
+ version: '0'
62
+ requirements: []
63
+ rubyforge_project:
64
+ rubygems_version: 2.5.1
65
+ signing_key:
66
+ specification_version: 4
67
+ summary: Tardy HTTP responses
68
+ test_files: []