madman 0.2.4 → 0.2.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -2
- data/lib/madman.rb +1 -1
- data/lib/madman/commands/readme.rb +1 -1
- data/lib/madman/dir_server.rb +16 -2
- data/lib/madman/directory.rb +2 -2
- data/lib/madman/item.rb +3 -1
- data/lib/madman/refinements/array.rb +11 -0
- data/lib/madman/renderers/default.rb +1 -1
- data/lib/madman/server_base.rb +7 -4
- data/lib/madman/version.rb +1 -1
- data/lib/madman/yamldoc.rb +2 -0
- metadata +32 -32
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: fea5fb59af24dad5a8f2da62bff33cc73b077fe35d48f06b0a2895bccf9884de
|
4
|
+
data.tar.gz: a696944e3f4a5daf6ab1f1d10ec0b330af01320267e8876125a152d739aa2dea
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: ca89b4634cc7f5c8bc0df8e7868afcc73f4aeb878a4df3ff80b8627a7e572119ea17c1587f6813cee33d1a650c5ed23be87ff3b22fd87fd861933e0469ec944c
|
7
|
+
data.tar.gz: 4966565ceff228bdfbf57af9f89aef554a1a3a9d58170066139a17c9be560d80a04262a876b5218a5f3d1087a3e4406ce455b56f4415f417fdf8a70b5333c080
|
data/README.md
CHANGED
@@ -2,9 +2,8 @@ Madman
|
|
2
2
|
==================================================
|
3
3
|
|
4
4
|
[![Gem Version](https://badge.fury.io/rb/madman.svg)](https://badge.fury.io/rb/madman)
|
5
|
-
[![Build Status](https://
|
5
|
+
[![Build Status](https://github.com/DannyBen/madman/workflows/Test/badge.svg)](https://github.com/DannyBen/madman/actions?query=workflow%3ATest)
|
6
6
|
[![Maintainability](https://api.codeclimate.com/v1/badges/506449ea988f5518425d/maintainability)](https://codeclimate.com/github/DannyBen/madman/maintainability)
|
7
|
-
[![Test Coverage](https://api.codeclimate.com/v1/badges/506449ea988f5518425d/test_coverage)](https://codeclimate.com/github/DannyBen/madman/test_coverage)
|
8
7
|
|
9
8
|
|
10
9
|
---
|
data/lib/madman.rb
CHANGED
data/lib/madman/dir_server.rb
CHANGED
@@ -8,14 +8,28 @@ module Madman
|
|
8
8
|
@renderer = settings.respond_to?(:renderer) ? settings.renderer : :default
|
9
9
|
end
|
10
10
|
|
11
|
+
not_found do
|
12
|
+
content_type :text
|
13
|
+
"4O4 Not Found"
|
14
|
+
end
|
15
|
+
|
16
|
+
get '/favicon.ico' do
|
17
|
+
content_type :text
|
18
|
+
'(oOo)'
|
19
|
+
end
|
20
|
+
|
11
21
|
get '/*' do
|
12
22
|
path = params[:splat].first
|
13
23
|
|
14
24
|
type, file = find_file(path)
|
15
25
|
redirect "#{path}/" if type == :dir and path[-1] != '/'
|
16
26
|
|
17
|
-
|
18
|
-
|
27
|
+
if File.exist? file
|
28
|
+
@doc = Document.from_file file
|
29
|
+
slim :template
|
30
|
+
else
|
31
|
+
halt 404
|
32
|
+
end
|
19
33
|
end
|
20
34
|
|
21
35
|
private
|
data/lib/madman/directory.rb
CHANGED
@@ -1,9 +1,9 @@
|
|
1
1
|
module Madman
|
2
|
-
# Represents a directory with markdown
|
2
|
+
# Represents a directory with markdown files and subflders.
|
3
3
|
class Directory
|
4
4
|
attr_reader :dir, :basedir
|
5
5
|
|
6
|
-
def initialize(dir, basedir=nil)
|
6
|
+
def initialize(dir, basedir = nil)
|
7
7
|
@dir = dir
|
8
8
|
@basedir = basedir || dir
|
9
9
|
end
|
data/lib/madman/item.rb
CHANGED
@@ -1,3 +1,5 @@
|
|
1
|
+
require 'addressable'
|
2
|
+
|
1
3
|
module Madman
|
2
4
|
class Item
|
3
5
|
attr_reader :path, :type, :basedir
|
@@ -11,7 +13,7 @@ module Madman
|
|
11
13
|
end
|
12
14
|
|
13
15
|
def href
|
14
|
-
URI.escape(path_without_extension.sub(/^#{basedir}\//, ''))
|
16
|
+
Addressable::URI.escape(path_without_extension.sub(/^#{basedir}\//, ''))
|
15
17
|
end
|
16
18
|
|
17
19
|
def dir?
|
data/lib/madman/server_base.rb
CHANGED
@@ -4,10 +4,13 @@ module Madman
|
|
4
4
|
|
5
5
|
Slim::Engine.set_options pretty: true
|
6
6
|
|
7
|
-
|
8
|
-
|
9
|
-
|
10
|
-
|
7
|
+
# Reloader temporarily removed due to
|
8
|
+
# https://github.com/sinatra/sinatra/issues/1587
|
9
|
+
#
|
10
|
+
# configure :development do
|
11
|
+
# register Sinatra::Reloader
|
12
|
+
# also_reload "#{__dir__}/*.rb"
|
13
|
+
# end
|
11
14
|
|
12
15
|
get '/favicon.ico' do
|
13
16
|
end
|
data/lib/madman/version.rb
CHANGED
data/lib/madman/yamldoc.rb
CHANGED
metadata
CHANGED
@@ -1,29 +1,29 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: madman
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.10
|
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:
|
11
|
+
date: 2020-06-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
|
-
- -
|
17
|
+
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0.
|
19
|
+
version: 2.0.5
|
20
20
|
type: :runtime
|
21
21
|
prerelease: false
|
22
22
|
version_requirements: !ruby/object:Gem::Requirement
|
23
23
|
requirements:
|
24
|
-
- -
|
24
|
+
- - "~>"
|
25
25
|
- !ruby/object:Gem::Version
|
26
|
-
version: 2.0.
|
26
|
+
version: 2.0.5
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
28
|
name: requires
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
@@ -44,14 +44,14 @@ dependencies:
|
|
44
44
|
requirements:
|
45
45
|
- - "~>"
|
46
46
|
- !ruby/object:Gem::Version
|
47
|
-
version: '0.
|
47
|
+
version: '0.20'
|
48
48
|
type: :runtime
|
49
49
|
prerelease: false
|
50
50
|
version_requirements: !ruby/object:Gem::Requirement
|
51
51
|
requirements:
|
52
52
|
- - "~>"
|
53
53
|
- !ruby/object:Gem::Version
|
54
|
-
version: '0.
|
54
|
+
version: '0.20'
|
55
55
|
- !ruby/object:Gem::Dependency
|
56
56
|
name: mister_bin
|
57
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -72,42 +72,28 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
76
|
-
type: :runtime
|
77
|
-
prerelease: false
|
78
|
-
version_requirements: !ruby/object:Gem::Requirement
|
79
|
-
requirements:
|
80
|
-
- - "~>"
|
81
|
-
- !ruby/object:Gem::Version
|
82
|
-
version: '3.11'
|
83
|
-
- !ruby/object:Gem::Dependency
|
84
|
-
name: sinatra-contrib
|
85
|
-
requirement: !ruby/object:Gem::Requirement
|
86
|
-
requirements:
|
87
|
-
- - "~>"
|
88
|
-
- !ruby/object:Gem::Version
|
89
|
-
version: '2.0'
|
75
|
+
version: '4.0'
|
90
76
|
type: :runtime
|
91
77
|
prerelease: false
|
92
78
|
version_requirements: !ruby/object:Gem::Requirement
|
93
79
|
requirements:
|
94
80
|
- - "~>"
|
95
81
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
82
|
+
version: '4.0'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: slim
|
99
85
|
requirement: !ruby/object:Gem::Requirement
|
100
86
|
requirements:
|
101
87
|
- - "~>"
|
102
88
|
- !ruby/object:Gem::Version
|
103
|
-
version: '
|
89
|
+
version: '4.0'
|
104
90
|
type: :runtime
|
105
91
|
prerelease: false
|
106
92
|
version_requirements: !ruby/object:Gem::Requirement
|
107
93
|
requirements:
|
108
94
|
- - "~>"
|
109
95
|
- !ruby/object:Gem::Version
|
110
|
-
version: '
|
96
|
+
version: '4.0'
|
111
97
|
- !ruby/object:Gem::Dependency
|
112
98
|
name: colsole
|
113
99
|
requirement: !ruby/object:Gem::Requirement
|
@@ -142,28 +128,28 @@ dependencies:
|
|
142
128
|
requirements:
|
143
129
|
- - "~>"
|
144
130
|
- !ruby/object:Gem::Version
|
145
|
-
version: '4.
|
131
|
+
version: '4.14'
|
146
132
|
type: :runtime
|
147
133
|
prerelease: false
|
148
134
|
version_requirements: !ruby/object:Gem::Requirement
|
149
135
|
requirements:
|
150
136
|
- - "~>"
|
151
137
|
- !ruby/object:Gem::Version
|
152
|
-
version: '4.
|
138
|
+
version: '4.14'
|
153
139
|
- !ruby/object:Gem::Dependency
|
154
140
|
name: sass
|
155
141
|
requirement: !ruby/object:Gem::Requirement
|
156
142
|
requirements:
|
157
143
|
- - "~>"
|
158
144
|
- !ruby/object:Gem::Version
|
159
|
-
version: '3.
|
145
|
+
version: '3.7'
|
160
146
|
type: :runtime
|
161
147
|
prerelease: false
|
162
148
|
version_requirements: !ruby/object:Gem::Requirement
|
163
149
|
requirements:
|
164
150
|
- - "~>"
|
165
151
|
- !ruby/object:Gem::Version
|
166
|
-
version: '3.
|
152
|
+
version: '3.7'
|
167
153
|
- !ruby/object:Gem::Dependency
|
168
154
|
name: coffee-script
|
169
155
|
requirement: !ruby/object:Gem::Requirement
|
@@ -178,6 +164,20 @@ dependencies:
|
|
178
164
|
- - "~>"
|
179
165
|
- !ruby/object:Gem::Version
|
180
166
|
version: '2.4'
|
167
|
+
- !ruby/object:Gem::Dependency
|
168
|
+
name: addressable
|
169
|
+
requirement: !ruby/object:Gem::Requirement
|
170
|
+
requirements:
|
171
|
+
- - "~>"
|
172
|
+
- !ruby/object:Gem::Version
|
173
|
+
version: '2.7'
|
174
|
+
type: :runtime
|
175
|
+
prerelease: false
|
176
|
+
version_requirements: !ruby/object:Gem::Requirement
|
177
|
+
requirements:
|
178
|
+
- - "~>"
|
179
|
+
- !ruby/object:Gem::Version
|
180
|
+
version: '2.7'
|
181
181
|
description: A command line utility for markdown fun
|
182
182
|
email: db@dannyben.com
|
183
183
|
executables:
|
@@ -202,6 +202,7 @@ files:
|
|
202
202
|
- lib/madman/item.rb
|
203
203
|
- lib/madman/navigation.rb
|
204
204
|
- lib/madman/preview_server.rb
|
205
|
+
- lib/madman/refinements/array.rb
|
205
206
|
- lib/madman/refinements/string.rb
|
206
207
|
- lib/madman/renderers.rb
|
207
208
|
- lib/madman/renderers/default.rb
|
@@ -231,8 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
231
232
|
- !ruby/object:Gem::Version
|
232
233
|
version: '0'
|
233
234
|
requirements: []
|
234
|
-
|
235
|
-
rubygems_version: 2.7.6
|
235
|
+
rubygems_version: 3.1.2
|
236
236
|
signing_key:
|
237
237
|
specification_version: 4
|
238
238
|
summary: The Markdown Swiss Army Knife
|