madness 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/app/public/css/main.css +2 -2
- data/app/public/css/main.css.map +1 -1
- data/app/styles/_nav.scss +1 -1
- data/lib/madness.rb +7 -7
- data/lib/madness/server_base.rb +1 -2
- data/lib/madness/version.rb +1 -1
- metadata +16 -3
- data/lib/madness/try_static.rb +0 -39
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8d588bd83b38718c29c92738d5a9ea5876ecfff30acbd02937eaba053a96a5f6
|
4
|
+
data.tar.gz: d198ff98538fcb2696ccc14e492e94432a92e162b6cb96276d938d2169232c9d
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 21c4ce8b9c7c93679cd6b296b1279ba9c07c62598f7cb175a235cb86c4e688819be2fd53e07be7d7d34519af292fa0c769e77e366ac9e61ce797fd93939c1572
|
7
|
+
data.tar.gz: 5c9d769becbfa0e337433ebcf3e237f1c26a8d354c6032b64211762f6bc466525e04650a0aa56ee52dbbdc227146ce6317f6e6fcfc9cab63378175d055a53987
|
data/app/public/css/main.css
CHANGED
@@ -233,9 +233,9 @@ nav {
|
|
233
233
|
nav {
|
234
234
|
display: none; } }
|
235
235
|
nav a, nav span {
|
236
|
+
border-bottom: 1px dotted #ddd;
|
236
237
|
display: block;
|
237
|
-
padding: 3px 20px 3px 30px;
|
238
|
-
margin-bottom: 4px; }
|
238
|
+
padding: 3px 20px 3px 30px; }
|
239
239
|
nav a:hover, nav span:hover {
|
240
240
|
background: #e4e4e4; }
|
241
241
|
nav:after {
|
data/app/public/css/main.css.map
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"version": 3,
|
3
|
-
"mappings": "AAAA,IAAK;EACH,oBAAoB,EAAE,IAAI;EAC1B,wB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ADf,GAAI;MAEA,OAAO,EAAE,IAAI;EASf,eAAQ;IACN,aAAa,EAAE,eAAe;IAI9B,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,iBAAiB;IAJ1B,2BAAQ;MACN,UAAU,EAAE,OAAO;EAKvB,SAAQ;IACN,OAAO,EAAE,EAAE;IACX,MAAM,EAAE,IAAI;IACZ,OAAO,EAAE,KAAK;;AAMlB,mBAAoB;EAClB,KAAK,EAAE,GAAG;;AAEZ,yBAA0B;EACxB,UAAU,EAAE,IAAI;EAChB,qBAAqB,EAAE,GAAG;;ACjC5B,CAAE;EACA,UAAU,EAAE,UAAU;;AAGxB,CAAE;EACA,UAAU,EAAE,CAAC;EACb,aAAa,EAAE,IAAI;;AAGrB,2BAAW;EACT,MAAM,EAAE,CAAC;EACT,OAAO,EAAE,MAAM;EACf,KAAK,EAAE,IAAI;EACX,WAAW,EAAE,cAAc;EAE3B,yDAAe;IACb,UAAU,EAAE,CAAC;EAGf,uDAAc;IACZ,aAAa,EAAE,CAAC;;AAIpB,sDAAsC;EACpC,UAAU,EAAE,CAAC;EACb,aAAa,EAAE,IAAI;;AAGrB,MAAO;EACL,KAAK,EAAE,IAAI;;AC5Bb,IAAK;EACH,SAAS,EAAE,MAAM;EACjB,MAAM,EAAE,MAAM;;AAGhB,KAAM;EAKJ,OAAO,EAAE,iBAAiB;EAC1B,WAAW,EAAE,KAAK;EAClB,MAAM,EAAC,cAAc;EACrB,YAAY,EAAE,KAAK;EACnB,UAAU,EAAE,KAAK;EARjB,YAAa;IADf,KAAM;MAEF,WAAW,EAAE,CAAC;MACd,YAAY,EAAE,CAAC;EAQjB,yBAAkB;IAChB,OAAO,EAAE,KAAK;IACd,OAAO,EAAE,EAAE",
|
4
4
|
"sources": ["../../styles/_typography.scss","../../styles/_table.scss","../../styles/_anchor.scss","../../styles/_list.scss","../../styles/_code.scss","../../styles/_coderay.scss","../../styles/_image.scss","../../styles/_line.scss","../../styles/_keyboard.scss","../../styles/_search.scss","../../styles/_breadcrumbs.scss","../../styles/_nav.scss","../../styles/_general.scss","../../styles/main.scss"],
|
5
5
|
"names": [],
|
6
6
|
"file": "main.css"
|
data/app/styles/_nav.scss
CHANGED
@@ -10,12 +10,12 @@ nav {
|
|
10
10
|
padding: 10px 0;
|
11
11
|
border-right: 1px solid #eee;
|
12
12
|
a, span {
|
13
|
+
border-bottom: 1px dotted #ddd;
|
13
14
|
&:hover {
|
14
15
|
background: #e4e4e4;
|
15
16
|
}
|
16
17
|
display: block;
|
17
18
|
padding: 3px 20px 3px 30px;
|
18
|
-
margin-bottom: 4px;
|
19
19
|
}
|
20
20
|
&:after {
|
21
21
|
content: "";
|
data/lib/madness.rb
CHANGED
@@ -2,16 +2,17 @@ require 'fileutils'
|
|
2
2
|
require 'singleton'
|
3
3
|
require 'yaml'
|
4
4
|
|
5
|
-
require 'slim'
|
6
|
-
require 'commonmarker'
|
7
5
|
require 'coderay'
|
6
|
+
require 'colsole'
|
7
|
+
require 'commonmarker'
|
8
|
+
require 'docopt'
|
9
|
+
require 'ferret'
|
10
|
+
require 'rack/contrib/try_static'
|
8
11
|
require 'sass'
|
12
|
+
require 'sass/plugin/rack'
|
9
13
|
require 'sinatra/base'
|
10
14
|
require 'sinatra/reloader'
|
11
|
-
require '
|
12
|
-
require 'docopt'
|
13
|
-
require 'colsole'
|
14
|
-
require 'ferret'
|
15
|
+
require 'slim'
|
15
16
|
|
16
17
|
require'byebug' if ENV['BYEBUG']
|
17
18
|
|
@@ -28,6 +29,5 @@ require 'madness/server'
|
|
28
29
|
require 'madness/server_base'
|
29
30
|
require 'madness/settings'
|
30
31
|
require 'madness/table_of_contents'
|
31
|
-
require 'madness/try_static'
|
32
32
|
require 'madness/version'
|
33
33
|
|
data/lib/madness/server_base.rb
CHANGED
@@ -1,4 +1,3 @@
|
|
1
|
-
|
2
1
|
module Madness
|
3
2
|
|
4
3
|
# The base class for the sinatra server.
|
@@ -29,7 +28,7 @@ module Madness
|
|
29
28
|
# The CommandLine class and the test suite should both call
|
30
29
|
# `Server.prepare` before calling Server.run!
|
31
30
|
def self.prepare
|
32
|
-
use TryStatic, root: "#{config.path}/", :urls => %w[/]
|
31
|
+
use Rack::TryStatic, root: "#{config.path}/", :urls => %w[/]
|
33
32
|
set :bind, config.bind
|
34
33
|
set :port, config.port
|
35
34
|
end
|
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.5.
|
4
|
+
version: 0.5.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: 2018-05-
|
11
|
+
date: 2018-05-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sass
|
@@ -52,6 +52,20 @@ dependencies:
|
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
54
|
version: '2.0'
|
55
|
+
- !ruby/object:Gem::Dependency
|
56
|
+
name: rack-contrib
|
57
|
+
requirement: !ruby/object:Gem::Requirement
|
58
|
+
requirements:
|
59
|
+
- - "~>"
|
60
|
+
- !ruby/object:Gem::Version
|
61
|
+
version: '2.0'
|
62
|
+
type: :runtime
|
63
|
+
prerelease: false
|
64
|
+
version_requirements: !ruby/object:Gem::Requirement
|
65
|
+
requirements:
|
66
|
+
- - "~>"
|
67
|
+
- !ruby/object:Gem::Version
|
68
|
+
version: '2.0'
|
55
69
|
- !ruby/object:Gem::Dependency
|
56
70
|
name: slim
|
57
71
|
requirement: !ruby/object:Gem::Requirement
|
@@ -352,7 +366,6 @@ files:
|
|
352
366
|
- lib/madness/server_helper.rb
|
353
367
|
- lib/madness/settings.rb
|
354
368
|
- lib/madness/table_of_contents.rb
|
355
|
-
- lib/madness/try_static.rb
|
356
369
|
- lib/madness/version.rb
|
357
370
|
homepage: https://github.com/DannyBen/madness
|
358
371
|
licenses:
|
data/lib/madness/try_static.rb
DELETED
@@ -1,39 +0,0 @@
|
|
1
|
-
module Madness
|
2
|
-
# This class allows multiple public folders so that we can load our
|
3
|
-
# CSS from the gem-domain public folder, and other things from the
|
4
|
-
# user-domain public folder
|
5
|
-
#
|
6
|
-
# TryStatic is borrowed from rack-contrib, since the gem is out of date
|
7
|
-
# and does not work with Sinatra 2
|
8
|
-
#
|
9
|
-
# It is used in `server_base.rb` like so:
|
10
|
-
#
|
11
|
-
# use TryStatic, :root => "#{config.path}/public/", :urls => %w[/]
|
12
|
-
#
|
13
|
-
# Ref:
|
14
|
-
# - https://stackoverflow.com/questions/18966318/sinatra-multiple-public-directories
|
15
|
-
# - https://github.com/rack/rack-contrib/blob/master/lib/rack/contrib/try_static.rb
|
16
|
-
# - https://github.com/rack/rack-contrib/pull/129
|
17
|
-
#
|
18
|
-
class TryStatic
|
19
|
-
def initialize(app, options)
|
20
|
-
@app = app
|
21
|
-
@try = ['', *options[:try]]
|
22
|
-
# :nocov:
|
23
|
-
@static = ::Rack::Static.new(
|
24
|
-
lambda { |_| [404, {}, []] },
|
25
|
-
options)
|
26
|
-
# :nocov:
|
27
|
-
end
|
28
|
-
|
29
|
-
def call(env)
|
30
|
-
orig_path = env['PATH_INFO']
|
31
|
-
found = nil
|
32
|
-
@try.each do |path|
|
33
|
-
resp = @static.call(env.merge!({'PATH_INFO' => orig_path + path}))
|
34
|
-
break if !(403..405).include?(resp[0]) && found = resp
|
35
|
-
end
|
36
|
-
found or @app.call(env.merge!('PATH_INFO' => orig_path))
|
37
|
-
end
|
38
|
-
end
|
39
|
-
end
|