madness 0.8.2 → 0.8.3

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: 7f277569da4b4196ac7b2ad110ad00c97d8271f9f00845222971d6dfa38cb298
4
- data.tar.gz: ca6fe615836d8d8c627a1228b7c9240f1230104f23145a7fe578d8604f7ad42f
3
+ metadata.gz: 177c0fe6c496b8b07eed2b80140a40db946c8a5af01a1e3d42655e652f3c50b2
4
+ data.tar.gz: 4e351e74d0a5df4d0111e02ebbe070a4c06cff2fb615b38ed7ef3f1407d3c7fd
5
5
  SHA512:
6
- metadata.gz: 7b402d979c6640fe5bb1117b3df11106038a0b54d6f0e3c08061c1898d7a3701d1e25fe2ba9aef101f9f0df43dace648304f9bf8add5e9e5d66b47a309fb9926
7
- data.tar.gz: bdbe0eaeb2cbe253f27aca7b51ffe540c0fa8b2a024913d9b02418db1e955a30a334dec1a4dc52a08192d0c6862ef73dd010c432a2672caf74177678dc82cce6
6
+ metadata.gz: 875ff85eb026afc5146b56dfd213ec5943ff337847d1a0c4f131963f3350c0a8220b516290b4bd56015e4d59b009bb43445f03a323fda03a97bf28cb4baf4d5f
7
+ data.tar.gz: 8d6dd211a8b35b1a70b74adcf02b178876631fc55d19d07b409947a57420fcdb11b89f1b2ecf7d3a111203e9bdacc3ffefd75d126b45a791d7bbaf44b0bf62ee
@@ -16,17 +16,17 @@ Subcommands:
16
16
 
17
17
  Parameters:
18
18
  PATH:
19
- Path to the markdown directory [default: .].
20
- (Config option: path)
19
+ Path to the markdown directory.
20
+ (Config option: path, default: .)
21
21
 
22
22
  Options:
23
23
  -p, --port NUMBER
24
- Set server port number [default: 3000].
25
- (Config option: port)
24
+ Set server port number.
25
+ (Config option: port, default: 3000)
26
26
 
27
27
  -b, --bind ADDRESS
28
- Set server listen address [default: 0.0.0.0].
29
- (Config option: bind)
28
+ Set server listen address.
29
+ (Config option: bind, default: 0.0.0.0)
30
30
 
31
31
  --no-auto-h1
32
32
  By default, if a markdown document does not start with an H1 caption,
@@ -77,8 +77,8 @@ Options:
77
77
  (Config option: auth)
78
78
 
79
79
  --auth-realm REALM
80
- The basic authentication realm [default: Madness].
81
- (Config option: auth_realm)
80
+ The basic authentication realm.
81
+ (Config option: auth_realm, default: Madness)
82
82
 
83
83
  --open
84
84
  Open the browser pointing at the madness webserver.
@@ -1,3 +1,5 @@
1
+ require 'addressable'
2
+
1
3
  module Madness
2
4
  module StringRefinements
3
5
  refine String do
@@ -6,7 +8,7 @@ module Madness
6
8
  end
7
9
 
8
10
  def to_href
9
- URI.escape self
11
+ Addressable::URI.escape self
10
12
  end
11
13
 
12
14
  def to_slug
@@ -1,9 +1,8 @@
1
- require 'rack/contrib/try_static'
1
+ # require 'sinatra/reloader'
2
2
  require 'rack/ssl'
3
3
  require 'sass'
4
4
  require 'sass/plugin/rack'
5
5
  require 'sinatra/base'
6
- require 'sinatra/reloader'
7
6
  require 'slim'
8
7
 
9
8
  module Madness
@@ -19,11 +18,16 @@ module Madness
19
18
  use Rack::SSL if ENV['MADNESS_FORCE_SSL']
20
19
  set :root, File.expand_path('../../', __dir__)
21
20
  set :server, :puma
21
+ set :environment, ENV['MADNESS_ENV'] || :production
22
22
 
23
- configure :development do
24
- register Sinatra::Reloader
25
- also_reload "#{__dir__}/*.rb"
26
- end
23
+ # TODO: Uncomment when the upstream issue is resolved
24
+ # At this time, we cannot use reloader, since it prints deprecation
25
+ # warnings in Ruby 2.7
26
+ # ref: https://github.com/sinatra/sinatra/issues/1590
27
+ # configure :development do
28
+ # register Sinatra::Reloader
29
+ # also_reload "#{__dir__}/*.rb"
30
+ # end
27
31
 
28
32
  # Since we cannot use any config values in the main body of the class,
29
33
  # since they will be updated later, we need to set anything that relys
@@ -31,7 +35,7 @@ module Madness
31
35
  # The CommandLine class and the test suite should both call
32
36
  # `Server.prepare` before calling Server.run!
33
37
  def self.prepare
34
- use Madness::Static, root: "#{config.path}/", :urls => %w[/]
38
+ use Madness::Static, root: "#{config.path}/", urls: %w[/], cascade: true
35
39
  set :bind, config.bind
36
40
  set :port, config.port
37
41
 
@@ -1,11 +1,11 @@
1
1
  module Madness
2
2
 
3
3
  # The Madness::Static middleware delegates requests to
4
- # Rack::TryStatic middleware unless the request URI ends with .md
4
+ # Rack::Static middleware unless the request URI ends with .md
5
5
  class Static
6
6
  def initialize(app, options)
7
7
  @app = app
8
- @static = ::Rack::TryStatic.new(app, options)
8
+ @static = Rack::Static.new app, options
9
9
  end
10
10
 
11
11
  def call(env)
@@ -1,3 +1,3 @@
1
1
  module Madness
2
- VERSION = "0.8.2"
2
+ VERSION = "0.8.3"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: madness
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.2
4
+ version: 0.8.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Danny Ben Shitrit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-04-27 00:00:00.000000000 Z
11
+ date: 2020-05-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: coderay
@@ -136,20 +136,6 @@ dependencies:
136
136
  - - "~>"
137
137
  - !ruby/object:Gem::Version
138
138
  version: '4.0'
139
- - !ruby/object:Gem::Dependency
140
- name: rack-contrib
141
- requirement: !ruby/object:Gem::Requirement
142
- requirements:
143
- - - "~>"
144
- - !ruby/object:Gem::Version
145
- version: '2.1'
146
- type: :runtime
147
- prerelease: false
148
- version_requirements: !ruby/object:Gem::Requirement
149
- requirements:
150
- - - "~>"
151
- - !ruby/object:Gem::Version
152
- version: '2.1'
153
139
  - !ruby/object:Gem::Dependency
154
140
  name: rack-ssl
155
141
  requirement: !ruby/object:Gem::Requirement
@@ -213,53 +199,47 @@ dependencies:
213
199
  - !ruby/object:Gem::Version
214
200
  version: 2.0.5
215
201
  - !ruby/object:Gem::Dependency
216
- name: sinatra-contrib
202
+ name: slim
217
203
  requirement: !ruby/object:Gem::Requirement
218
204
  requirements:
219
205
  - - "~>"
220
206
  - !ruby/object:Gem::Version
221
- version: '2.0'
222
- - - ">="
223
- - !ruby/object:Gem::Version
224
- version: 2.0.5
207
+ version: '4.0'
225
208
  type: :runtime
226
209
  prerelease: false
227
210
  version_requirements: !ruby/object:Gem::Requirement
228
211
  requirements:
229
212
  - - "~>"
230
213
  - !ruby/object:Gem::Version
231
- version: '2.0'
232
- - - ">="
233
- - !ruby/object:Gem::Version
234
- version: 2.0.5
214
+ version: '4.0'
235
215
  - !ruby/object:Gem::Dependency
236
- name: slim
216
+ name: extended_yaml
237
217
  requirement: !ruby/object:Gem::Requirement
238
218
  requirements:
239
219
  - - "~>"
240
220
  - !ruby/object:Gem::Version
241
- version: '4.0'
221
+ version: '0.2'
242
222
  type: :runtime
243
223
  prerelease: false
244
224
  version_requirements: !ruby/object:Gem::Requirement
245
225
  requirements:
246
226
  - - "~>"
247
227
  - !ruby/object:Gem::Version
248
- version: '4.0'
228
+ version: '0.2'
249
229
  - !ruby/object:Gem::Dependency
250
- name: extended_yaml
230
+ name: addressable
251
231
  requirement: !ruby/object:Gem::Requirement
252
232
  requirements:
253
233
  - - "~>"
254
234
  - !ruby/object:Gem::Version
255
- version: '0.2'
235
+ version: '2.7'
256
236
  type: :runtime
257
237
  prerelease: false
258
238
  version_requirements: !ruby/object:Gem::Requirement
259
239
  requirements:
260
240
  - - "~>"
261
241
  - !ruby/object:Gem::Version
262
- version: '0.2'
242
+ version: '2.7'
263
243
  description: Start a markdown server in any directory
264
244
  email: db@dannyben.com
265
245
  executables:
@@ -347,7 +327,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
347
327
  - !ruby/object:Gem::Version
348
328
  version: '0'
349
329
  requirements: []
350
- rubygems_version: 3.0.3
330
+ rubygems_version: 3.1.2
351
331
  signing_key:
352
332
  specification_version: 4
353
333
  summary: Instant Markdown Server