adsf 1.4.6 → 1.4.7

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
  SHA256:
3
- metadata.gz: c682683f791919dc76e3763428199f54d17b4fc11a70ff8c6f19199ec944e07d
4
- data.tar.gz: 955985f08cc3c6ec48886a7ac829c569c28c2d45e8c89e9e17b111396eb935a8
3
+ metadata.gz: cd19b64a645ae62ffcc22dcf97cf5cb98d4ce756583755631646e03e369740a4
4
+ data.tar.gz: aa88b49a59830d4298cf5b634258010d6b1d0757a4192de2a1fae156c81bf0af
5
5
  SHA512:
6
- metadata.gz: 167f3f2295cb22acd8686924e394789ddb76e1c13c60c38c781a746d79444085d26f63d46dee2970ed1e52f34493b800a62485264ba0631318f6d5457530f544
7
- data.tar.gz: 3ebf46f79170bacb198d4eeb82d0925491c231c51d8dd34397a435f997531d7026d1d6c8f7fc0e488791ab8c0e80cb21b4d95fc60fd636a2dd7177aaff3fea80
6
+ metadata.gz: c82f31a29d08c8d30e349e2e37188343516ae8dfe924aa96f027f55bb22553a6c521d40335bc20668e1190abcc8e662aeb0f920e0eca247e6d9cf2b6f3ee8f45
7
+ data.tar.gz: 4ad549207aecfff4ac26468c63e5ec58a8971f8fd7b3db6179cf4c1783f266e16cfaaa4f2cc491bbe5b03e2f79c91befa251f07a224715aef8b2db3c2071e3a5
data/NEWS.md CHANGED
@@ -1,5 +1,11 @@
1
1
  # Release notes for adsf
2
2
 
3
+ ## 1.4.7 (2023-03-18)
4
+
5
+ Fixes:
6
+
7
+ * Added Rack 3.0 compatibility
8
+
3
9
  ## 1.4.6 (2021-05-16)
4
10
 
5
11
  Fixes:
data/README.md CHANGED
@@ -2,24 +2,24 @@
2
2
  [![Gem downloads](https://img.shields.io/gem/dt/adsf.svg)](http://rubygems.org/gems/adsf)
3
3
  [![Build status](https://img.shields.io/travis/ddfreyne/adsf.svg)](https://travis-ci.org/ddfreyne/adsf)
4
4
  [![Code Climate](https://img.shields.io/codeclimate/github/ddfreyne/adsf.svg)](https://codeclimate.com/github/ddfreyne/adsf)
5
- [![Code Coverage](https://img.shields.io/codecov/c/github/ddfreyne/adsf.svg)](https://codecov.io/gh/ddfreyne/adsf)
6
5
 
7
- adsf
8
- ====
6
+ # adsf
9
7
 
10
8
  _adsf_ (**A** **D**ead **S**imple **F**ileserver) is a tiny static web server that you can launch instantly in any directory, like this:
11
9
 
12
- ▸ ls -l
13
- total 0
14
- drwxr-xr-x 2 ddfreyne staff 68 May 29 10:04 about
15
- drwxr-xr-x 2 ddfreyne staff 68 May 29 10:04 contact
16
- -rw-r--r-- 1 ddfreyne staff 0 May 29 10:04 index.html
17
- drwxr-xr-x 2 ddfreyne staff 68 May 29 10:04 projects
18
-
19
- ▸ adsf
20
- [2017-11-19 11:49:20] INFO WEBrick 1.3.1
21
- [2017-11-19 11:49:20] INFO ruby 2.4.2 (2017-09-14) [x86_64-darwin17]
22
- [2017-11-19 11:49:20] INFO WEBrick::HTTPServer#start: pid=95218 port=3000
10
+ ```
11
+ ls -l
12
+ total 0
13
+ drwxr-xr-x 2 ddfreyne staff 68 May 29 10:04 about
14
+ drwxr-xr-x 2 ddfreyne staff 68 May 29 10:04 contact
15
+ -rw-r--r-- 1 ddfreyne staff 0 May 29 10:04 index.html
16
+ drwxr-xr-x 2 ddfreyne staff 68 May 29 10:04 projects
17
+
18
+ adsf
19
+ [2017-11-19 11:49:20] INFO WEBrick 1.3.1
20
+ [2017-11-19 11:49:20] INFO ruby 2.4.2 (2017-09-14) [x86_64-darwin17]
21
+ [2017-11-19 11:49:20] INFO WEBrick::HTTPServer#start: pid=95218 port=3000
22
+ ```
23
23
 
24
24
  … and now you can go to http://localhost:3000/ and start browsing.
25
25
 
@@ -27,8 +27,7 @@ See `adsf --help` for details.
27
27
 
28
28
  To use `adsf --live-reload`, please install the separate `adsf-live` gem. (The live-reload support is not part of adsf itself, because the dependencies of `adsf-live` make it difficult to install under some circumstances.)
29
29
 
30
- Using adsf programmatically
31
- ---------------------------
30
+ ## Using adsf programmatically
32
31
 
33
32
  ### IndexFileFinder
34
33
 
@@ -41,26 +40,26 @@ run Rack::File.new('public')
41
40
 
42
41
  It takes the following options:
43
42
 
44
- * `root` (required): the path to the web root
43
+ - `root` (required): the path to the web root
45
44
 
46
- * `index_filenames` (optional; defaults to `['index.html']`): contains the names of the index filenames that will be served when a directory containing an index file is requested. Usually, this will simply be `['index.html']`, but under different circumstances (when using IIS, for example), the array may have to be modified to include index filenames such as `default.html` or `index.xml`. Here’s an example middleware/application stack that uses custom index filenames:
45
+ - `index_filenames` (optional; defaults to `['index.html']`): contains the names of the index filenames that will be served when a directory containing an index file is requested. Usually, this will simply be `['index.html']`, but under different circumstances (when using IIS, for example), the array may have to be modified to include index filenames such as `default.html` or `index.xml`. Here’s an example middleware/application stack that uses custom index filenames:
47
46
 
48
- ```ruby
49
- use Adsf::Rack::IndexFileFinder,
50
- root: 'public',
51
- index_filenames: %w[index.html index.xhtml]
52
- run Rack::File.new('public')
53
- ```
47
+ ```ruby
48
+ use Adsf::Rack::IndexFileFinder,
49
+ root: 'public',
50
+ index_filenames: %w[index.html index.xhtml]
51
+ run Rack::File.new('public')
52
+ ```
54
53
 
55
54
  **Why not use `Rack::Static`?** Rack comes with `Rack::Static`, whose purpose is similar to, but not the same as, `Adsf::Rack::IndexFileFinder`. In particular:
56
55
 
57
- * `Adsf::Rack::IndexFileFinder` does not serve files, unlike `Rack::Static`. `IndexFileFinder` only rewrites the incoming request and passes it on (usually to `Rack::File`).
56
+ - `Adsf::Rack::IndexFileFinder` does not serve files, unlike `Rack::Static`. `IndexFileFinder` only rewrites the incoming request and passes it on (usually to `Rack::File`).
58
57
 
59
- * `Adsf::Rack::IndexFileFinder` supports multiple index files, while `Rack::Static` only supports one (you could have multiple `Rack::Static` middlewares, one for each index filenames, though).
58
+ - `Adsf::Rack::IndexFileFinder` supports multiple index files, while `Rack::Static` only supports one (you could have multiple `Rack::Static` middlewares, one for each index filenames, though).
60
59
 
61
- * `Rack::Static` will report the wrong filename on 404 pages: when requesting a directory without an index file, it will e.g. report “File not found: /index.html” rather than “File not found: /”.
60
+ - `Rack::Static` will report the wrong filename on 404 pages: when requesting a directory without an index file, it will e.g. report “File not found: /index.html” rather than “File not found: /”.
62
61
 
63
- * When requesting a directory without specifying the trailing slash, `Adsf::Rack::IndexFileFinder` will redirect to the URL with a trailing slash, unlike `Rack::Static`. This mimics the behavior of typical HTTP servers. For example, when requesting `/foo`, when a `foo` directory exists and it contains `index.html`, `IndexFileFinder` will redirect to `/foo/`.
62
+ - When requesting a directory without specifying the trailing slash, `Adsf::Rack::IndexFileFinder` will redirect to the URL with a trailing slash, unlike `Rack::Static`. This mimics the behavior of typical HTTP servers. For example, when requesting `/foo`, when a `foo` directory exists and it contains `index.html`, `IndexFileFinder` will redirect to `/foo/`.
64
63
 
65
64
  ### Server
66
65
 
@@ -78,16 +77,15 @@ server.run
78
77
 
79
78
  It takes the following options:
80
79
 
81
- * `root` (required): the path to the web root
82
- * `index_filenames` (optional; defaults to `['index.html']`): (see above)
83
- * `host` (optional; defaults to `'127.0.0.1'`): the address of the network interface to listen on
84
- * `port` (optional; defaults to `3000`): the port ot listen on
85
- * `handler` (optional): the Rack handler to use
80
+ - `root` (required): the path to the web root
81
+ - `index_filenames` (optional; defaults to `['index.html']`): (see above)
82
+ - `host` (optional; defaults to `'127.0.0.1'`): the address of the network interface to listen on
83
+ - `port` (optional; defaults to `3000`): the port ot listen on
84
+ - `handler` (optional): the Rack handler to use
86
85
 
87
- Contributors
88
- ------------
86
+ ## Contributors
89
87
 
90
- * Ed Brannin
91
- * Larissa Reis
92
- * Mark Meves
93
- * Vipul Amler
88
+ - Ed Brannin
89
+ - Larissa Reis
90
+ - Mark Meves
91
+ - Vipul Amler
@@ -11,7 +11,7 @@ module Adsf::Rack
11
11
 
12
12
  new_headers =
13
13
  headers.merge(
14
- 'Cache-Control' => 'max-age=0, stale-if-error=0',
14
+ 'cache-control' => 'max-age=0, stale-if-error=0',
15
15
  )
16
16
 
17
17
  [status, new_headers, body]
@@ -11,8 +11,8 @@ module Adsf::Rack
11
11
 
12
12
  new_headers =
13
13
  headers.merge(
14
- 'Access-Control-Allow-Origin' => '*',
15
- 'Access-Control-Allow-Headers' => 'Origin, X-Requested-With, Content-Type, Accept, Range',
14
+ 'access-control-allow-origin' => '*',
15
+ 'access-control-allow-headers' => 'Origin, X-Requested-With, Content-Type, Accept, Range',
16
16
  )
17
17
 
18
18
  [status, new_headers, body]
@@ -18,7 +18,7 @@ module Adsf::Rack
18
18
  new_path_info = env['PATH_INFO'] + '/'
19
19
  return [
20
20
  302,
21
- { 'Location' => new_path_info, 'Content-Type' => 'text/html' },
21
+ { 'location' => new_path_info, 'content-type' => 'text/html' },
22
22
  ["Redirecting you to #{new_path_info}…"],
23
23
  ]
24
24
  end
data/lib/adsf/server.rb CHANGED
@@ -63,7 +63,7 @@ module Adsf
63
63
 
64
64
  if is_live
65
65
  require 'adsf/live'
66
- use ::Rack::LiveReload, source: :vendored
66
+ use ::Rack::LiveReload, no_swf: true, source: :vendored
67
67
  end
68
68
 
69
69
  run ::Rack::File.new(root)
@@ -72,9 +72,9 @@ module Adsf
72
72
 
73
73
  def build_handler
74
74
  if @handler
75
- ::Rack::Handler.get(@handler)
75
+ ::Rackup::Handler.get(@handler)
76
76
  else
77
- ::Rack::Handler.default
77
+ ::Rackup::Handler.default
78
78
  end
79
79
  end
80
80
  end
data/lib/adsf/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Adsf
4
- VERSION = '1.4.6'
4
+ VERSION = '1.4.7'
5
5
  end
data/lib/adsf.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  require 'rack'
4
+ require 'rackup'
4
5
 
5
6
  module Adsf
6
7
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: adsf
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.6
4
+ version: 1.4.7
5
5
  platform: ruby
6
6
  authors:
7
7
  - Denis Defreyne
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-16 00:00:00.000000000 Z
11
+ date: 2023-03-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rack
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: 1.0.0
20
20
  - - "<"
21
21
  - !ruby/object:Gem::Version
22
- version: 3.0.0
22
+ version: 4.0.0
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,21 @@ dependencies:
29
29
  version: 1.0.0
30
30
  - - "<"
31
31
  - !ruby/object:Gem::Version
32
- version: 3.0.0
32
+ version: 4.0.0
33
+ - !ruby/object:Gem::Dependency
34
+ name: rackup
35
+ requirement: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '2.1'
40
+ type: :runtime
41
+ prerelease: false
42
+ version_requirements: !ruby/object:Gem::Requirement
43
+ requirements:
44
+ - - "~>"
45
+ - !ruby/object:Gem::Version
46
+ version: '2.1'
33
47
  description: A web server that can be spawned in any directory
34
48
  email: denis.defreyne@stoneship.org
35
49
  executables:
@@ -50,7 +64,8 @@ files:
50
64
  homepage: http://github.com/ddfreyne/adsf/
51
65
  licenses:
52
66
  - MIT
53
- metadata: {}
67
+ metadata:
68
+ rubygems_mfa_required: 'true'
54
69
  post_install_message:
55
70
  rdoc_options: []
56
71
  require_paths:
@@ -66,7 +81,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
66
81
  - !ruby/object:Gem::Version
67
82
  version: '0'
68
83
  requirements: []
69
- rubygems_version: 3.2.17
84
+ rubygems_version: 3.4.8
70
85
  signing_key:
71
86
  specification_version: 4
72
87
  summary: a tiny static file server