rack 2.2.10 → 3.1.8

Sign up to get free protection for your applications and to get access to all the features.
Files changed (86) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +332 -90
  3. data/CONTRIBUTING.md +63 -55
  4. data/MIT-LICENSE +1 -1
  5. data/README.md +328 -0
  6. data/SPEC.rdoc +204 -131
  7. data/lib/rack/auth/abstract/handler.rb +3 -1
  8. data/lib/rack/auth/abstract/request.rb +3 -1
  9. data/lib/rack/auth/basic.rb +1 -3
  10. data/lib/rack/bad_request.rb +8 -0
  11. data/lib/rack/body_proxy.rb +21 -3
  12. data/lib/rack/builder.rb +102 -69
  13. data/lib/rack/cascade.rb +2 -3
  14. data/lib/rack/common_logger.rb +23 -18
  15. data/lib/rack/conditional_get.rb +18 -15
  16. data/lib/rack/constants.rb +67 -0
  17. data/lib/rack/content_length.rb +12 -16
  18. data/lib/rack/content_type.rb +8 -5
  19. data/lib/rack/deflater.rb +40 -26
  20. data/lib/rack/directory.rb +9 -3
  21. data/lib/rack/etag.rb +14 -23
  22. data/lib/rack/events.rb +4 -0
  23. data/lib/rack/files.rb +15 -17
  24. data/lib/rack/head.rb +9 -8
  25. data/lib/rack/headers.rb +238 -0
  26. data/lib/rack/lint.rb +840 -644
  27. data/lib/rack/lock.rb +2 -5
  28. data/lib/rack/logger.rb +3 -0
  29. data/lib/rack/method_override.rb +5 -1
  30. data/lib/rack/mime.rb +14 -5
  31. data/lib/rack/mock.rb +1 -271
  32. data/lib/rack/mock_request.rb +161 -0
  33. data/lib/rack/mock_response.rb +124 -0
  34. data/lib/rack/multipart/generator.rb +7 -5
  35. data/lib/rack/multipart/parser.rb +213 -95
  36. data/lib/rack/multipart/uploaded_file.rb +4 -0
  37. data/lib/rack/multipart.rb +53 -40
  38. data/lib/rack/null_logger.rb +9 -0
  39. data/lib/rack/query_parser.rb +81 -102
  40. data/lib/rack/recursive.rb +2 -0
  41. data/lib/rack/reloader.rb +0 -2
  42. data/lib/rack/request.rb +260 -123
  43. data/lib/rack/response.rb +151 -66
  44. data/lib/rack/rewindable_input.rb +24 -5
  45. data/lib/rack/runtime.rb +7 -6
  46. data/lib/rack/sendfile.rb +30 -25
  47. data/lib/rack/show_exceptions.rb +21 -4
  48. data/lib/rack/show_status.rb +17 -7
  49. data/lib/rack/static.rb +8 -8
  50. data/lib/rack/tempfile_reaper.rb +15 -4
  51. data/lib/rack/urlmap.rb +3 -1
  52. data/lib/rack/utils.rb +236 -237
  53. data/lib/rack/version.rb +1 -9
  54. data/lib/rack.rb +13 -89
  55. metadata +13 -39
  56. data/README.rdoc +0 -320
  57. data/Rakefile +0 -130
  58. data/bin/rackup +0 -5
  59. data/contrib/rack.png +0 -0
  60. data/contrib/rack.svg +0 -150
  61. data/contrib/rack_logo.svg +0 -164
  62. data/contrib/rdoc.css +0 -412
  63. data/example/lobster.ru +0 -6
  64. data/example/protectedlobster.rb +0 -16
  65. data/example/protectedlobster.ru +0 -10
  66. data/lib/rack/auth/digest/md5.rb +0 -131
  67. data/lib/rack/auth/digest/nonce.rb +0 -53
  68. data/lib/rack/auth/digest/params.rb +0 -54
  69. data/lib/rack/auth/digest/request.rb +0 -43
  70. data/lib/rack/chunked.rb +0 -117
  71. data/lib/rack/core_ext/regexp.rb +0 -14
  72. data/lib/rack/file.rb +0 -7
  73. data/lib/rack/handler/cgi.rb +0 -59
  74. data/lib/rack/handler/fastcgi.rb +0 -100
  75. data/lib/rack/handler/lsws.rb +0 -61
  76. data/lib/rack/handler/scgi.rb +0 -71
  77. data/lib/rack/handler/thin.rb +0 -36
  78. data/lib/rack/handler/webrick.rb +0 -129
  79. data/lib/rack/handler.rb +0 -104
  80. data/lib/rack/lobster.rb +0 -70
  81. data/lib/rack/server.rb +0 -466
  82. data/lib/rack/session/abstract/id.rb +0 -523
  83. data/lib/rack/session/cookie.rb +0 -203
  84. data/lib/rack/session/memcache.rb +0 -10
  85. data/lib/rack/session/pool.rb +0 -85
  86. data/rack.gemspec +0 -46
@@ -1,10 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require 'rack/session/dalli'
4
-
5
- module Rack
6
- module Session
7
- warn "Rack::Session::Memcache is deprecated, please use Rack::Session::Dalli from 'dalli' gem instead."
8
- Memcache = Dalli
9
- end
10
- end
@@ -1,85 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- # AUTHOR: blink <blinketje@gmail.com>; blink#ruby-lang@irc.freenode.net
4
- # THANKS:
5
- # apeiros, for session id generation, expiry setup, and threadiness
6
- # sergio, threadiness and bugreps
7
-
8
- require_relative 'abstract/id'
9
- require 'thread'
10
-
11
- module Rack
12
- module Session
13
- # Rack::Session::Pool provides simple cookie based session management.
14
- # Session data is stored in a hash held by @pool.
15
- # In the context of a multithreaded environment, sessions being
16
- # committed to the pool is done in a merging manner.
17
- #
18
- # The :drop option is available in rack.session.options if you wish to
19
- # explicitly remove the session from the session cache.
20
- #
21
- # Example:
22
- # myapp = MyRackApp.new
23
- # sessioned = Rack::Session::Pool.new(myapp,
24
- # :domain => 'foo.com',
25
- # :expire_after => 2592000
26
- # )
27
- # Rack::Handler::WEBrick.run sessioned
28
-
29
- class Pool < Abstract::PersistedSecure
30
- attr_reader :mutex, :pool
31
- DEFAULT_OPTIONS = Abstract::ID::DEFAULT_OPTIONS.merge drop: false
32
-
33
- def initialize(app, options = {})
34
- super
35
- @pool = Hash.new
36
- @mutex = Mutex.new
37
- end
38
-
39
- def generate_sid
40
- loop do
41
- sid = super
42
- break sid unless @pool.key? sid.private_id
43
- end
44
- end
45
-
46
- def find_session(req, sid)
47
- with_lock(req) do
48
- unless sid and session = get_session_with_fallback(sid)
49
- sid, session = generate_sid, {}
50
- @pool.store sid.private_id, session
51
- end
52
- [sid, session]
53
- end
54
- end
55
-
56
- def write_session(req, session_id, new_session, options)
57
- with_lock(req) do
58
- @pool.store session_id.private_id, new_session
59
- session_id
60
- end
61
- end
62
-
63
- def delete_session(req, session_id, options)
64
- with_lock(req) do
65
- @pool.delete(session_id.public_id)
66
- @pool.delete(session_id.private_id)
67
- generate_sid unless options[:drop]
68
- end
69
- end
70
-
71
- def with_lock(req)
72
- @mutex.lock if req.multithread?
73
- yield
74
- ensure
75
- @mutex.unlock if @mutex.locked?
76
- end
77
-
78
- private
79
-
80
- def get_session_with_fallback(sid)
81
- @pool[sid.private_id] || @pool[sid.public_id]
82
- end
83
- end
84
- end
85
- end
data/rack.gemspec DELETED
@@ -1,46 +0,0 @@
1
- # frozen_string_literal: true
2
-
3
- require_relative 'lib/rack/version'
4
-
5
- Gem::Specification.new do |s|
6
- s.name = "rack"
7
- s.version = Rack::RELEASE
8
- s.platform = Gem::Platform::RUBY
9
- s.summary = "A modular Ruby webserver interface."
10
- s.license = "MIT"
11
-
12
- s.description = <<~EOF
13
- Rack provides a minimal, modular and adaptable interface for developing
14
- web applications in Ruby. By wrapping HTTP requests and responses in
15
- the simplest way possible, it unifies and distills the API for web
16
- servers, web frameworks, and software in between (the so-called
17
- middleware) into a single method call.
18
- EOF
19
-
20
- s.files = Dir['{bin/*,contrib/*,example/*,lib/**/*}'] +
21
- %w(MIT-LICENSE rack.gemspec Rakefile README.rdoc SPEC.rdoc)
22
-
23
- s.bindir = 'bin'
24
- s.executables << 'rackup'
25
- s.require_path = 'lib'
26
- s.extra_rdoc_files = ['README.rdoc', 'CHANGELOG.md', 'CONTRIBUTING.md']
27
-
28
- s.author = 'Leah Neukirchen'
29
- s.email = 'leah@vuxu.org'
30
-
31
- s.homepage = 'https://github.com/rack/rack'
32
-
33
- s.required_ruby_version = '>= 2.3.0'
34
-
35
- s.metadata = {
36
- "bug_tracker_uri" => "https://github.com/rack/rack/issues",
37
- "changelog_uri" => "https://github.com/rack/rack/blob/master/CHANGELOG.md",
38
- "documentation_uri" => "https://rubydoc.info/github/rack/rack",
39
- "source_code_uri" => "https://github.com/rack/rack"
40
- }
41
-
42
- s.add_development_dependency 'minitest', "~> 5.0"
43
- s.add_development_dependency 'minitest-sprint'
44
- s.add_development_dependency 'minitest-global_expectations'
45
- s.add_development_dependency 'rake'
46
- end