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 +4 -4
- data/lib/madness/docopt.txt +8 -8
- data/lib/madness/refinements/string_refinements.rb +3 -1
- data/lib/madness/server_base.rb +11 -7
- data/lib/madness/static.rb +2 -2
- data/lib/madness/version.rb +1 -1
- metadata +12 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 177c0fe6c496b8b07eed2b80140a40db946c8a5af01a1e3d42655e652f3c50b2
|
4
|
+
data.tar.gz: 4e351e74d0a5df4d0111e02ebbe070a4c06cff2fb615b38ed7ef3f1407d3c7fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 875ff85eb026afc5146b56dfd213ec5943ff337847d1a0c4f131963f3350c0a8220b516290b4bd56015e4d59b009bb43445f03a323fda03a97bf28cb4baf4d5f
|
7
|
+
data.tar.gz: 8d6dd211a8b35b1a70b74adcf02b178876631fc55d19d07b409947a57420fcdb11b89f1b2ecf7d3a111203e9bdacc3ffefd75d126b45a791d7bbaf44b0bf62ee
|
data/lib/madness/docopt.txt
CHANGED
@@ -16,17 +16,17 @@ Subcommands:
|
|
16
16
|
|
17
17
|
Parameters:
|
18
18
|
PATH:
|
19
|
-
Path to the markdown directory
|
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
|
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
|
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
|
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.
|
data/lib/madness/server_base.rb
CHANGED
@@ -1,9 +1,8 @@
|
|
1
|
-
require '
|
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
|
-
|
24
|
-
|
25
|
-
|
26
|
-
|
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}/", :
|
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
|
|
data/lib/madness/static.rb
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
module Madness
|
2
2
|
|
3
3
|
# The Madness::Static middleware delegates requests to
|
4
|
-
# Rack::
|
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 =
|
8
|
+
@static = Rack::Static.new app, options
|
9
9
|
end
|
10
10
|
|
11
11
|
def call(env)
|
data/lib/madness/version.rb
CHANGED
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.
|
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-
|
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:
|
202
|
+
name: slim
|
217
203
|
requirement: !ruby/object:Gem::Requirement
|
218
204
|
requirements:
|
219
205
|
- - "~>"
|
220
206
|
- !ruby/object:Gem::Version
|
221
|
-
version: '
|
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: '
|
232
|
-
- - ">="
|
233
|
-
- !ruby/object:Gem::Version
|
234
|
-
version: 2.0.5
|
214
|
+
version: '4.0'
|
235
215
|
- !ruby/object:Gem::Dependency
|
236
|
-
name:
|
216
|
+
name: extended_yaml
|
237
217
|
requirement: !ruby/object:Gem::Requirement
|
238
218
|
requirements:
|
239
219
|
- - "~>"
|
240
220
|
- !ruby/object:Gem::Version
|
241
|
-
version: '
|
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: '
|
228
|
+
version: '0.2'
|
249
229
|
- !ruby/object:Gem::Dependency
|
250
|
-
name:
|
230
|
+
name: addressable
|
251
231
|
requirement: !ruby/object:Gem::Requirement
|
252
232
|
requirements:
|
253
233
|
- - "~>"
|
254
234
|
- !ruby/object:Gem::Version
|
255
|
-
version: '
|
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: '
|
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.
|
330
|
+
rubygems_version: 3.1.2
|
351
331
|
signing_key:
|
352
332
|
specification_version: 4
|
353
333
|
summary: Instant Markdown Server
|