madman 0.2.5 → 0.2.11
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 +28 -28
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8f8251e7ea7210aa7d7d18071e550366871dfe5ff3fb4f58fd4e523be579e673
|
4
|
+
data.tar.gz: e8c29ed93d986347eae430d30a9c761df7e25559a9f665f863e395d6fd9158b8
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e1de558ae55144664fcade27dc8d855b6a01b47d368aa7e3ff901c5f70b7c7cc6dd0bb7bf1acefa4f5371423f8c822d57b2054f8275fcb17cd455d587b9f851f
|
7
|
+
data.tar.gz: 6e3198e1069baa736e1a64c8f64a73cc09ca38a2f8a1031cae7463d1d4df6111b12d4476955b3e89eaa3f1348a7e45677c19891c153f8604554489935fcc9d7f
|
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,14 +1,14 @@
|
|
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.11
|
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-12-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: sinatra
|
@@ -16,14 +16,14 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.0
|
19
|
+
version: '2.0'
|
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'
|
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,28 +72,14 @@ dependencies:
|
|
72
72
|
requirements:
|
73
73
|
- - "~>"
|
74
74
|
- !ruby/object:Gem::Version
|
75
|
-
version: '
|
75
|
+
version: '5.1'
|
76
76
|
type: :runtime
|
77
77
|
prerelease: false
|
78
78
|
version_requirements: !ruby/object:Gem::Requirement
|
79
79
|
requirements:
|
80
80
|
- - "~>"
|
81
81
|
- !ruby/object:Gem::Version
|
82
|
-
version: '
|
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.5
|
90
|
-
type: :runtime
|
91
|
-
prerelease: false
|
92
|
-
version_requirements: !ruby/object:Gem::Requirement
|
93
|
-
requirements:
|
94
|
-
- - "~>"
|
95
|
-
- !ruby/object:Gem::Version
|
96
|
-
version: 2.0.5
|
82
|
+
version: '5.1'
|
97
83
|
- !ruby/object:Gem::Dependency
|
98
84
|
name: slim
|
99
85
|
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.4
|
236
236
|
signing_key:
|
237
237
|
specification_version: 4
|
238
238
|
summary: The Markdown Swiss Army Knife
|