madman 0.2.7 → 0.2.12
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 -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/version.rb +1 -1
- data/lib/madman/yamldoc.rb +2 -0
- metadata +45 -30
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: '045932758c95c7094714d6880c66c33a9ce3179627acc6fb23fa9dc3cb8c4f9d'
|
4
|
+
data.tar.gz: 5743a5f22be0d49e57aee5611902dfebd24e84b5f845e2d9ec64d2cb3c07315f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0e0afe77b7a85c9818870947784f219aebbfc0de5807fc55011d15ca6d8aec449bfb6cdfecc6e80071ca172e9e1bb77dca748e8b396bc674471b543479ce3a7c
|
7
|
+
data.tar.gz: e510a0cd32153ad6e5ec29cd38fb6d094d1485fe1f13403cbf15b8939b0011fc093f25d6f211367c9b45129c5b877383f2d3cbcd3d3ce2f9e6aa3584ec4f573e
|
data/README.md
CHANGED
@@ -2,7 +2,7 @@ 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
7
|
|
8
8
|
|
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/version.rb
CHANGED
data/lib/madman/yamldoc.rb
CHANGED
metadata
CHANGED
@@ -1,43 +1,57 @@
|
|
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.12
|
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-12-27 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
|
-
name:
|
14
|
+
name: addressable
|
15
15
|
requirement: !ruby/object:Gem::Requirement
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: 2.
|
19
|
+
version: '2.7'
|
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.
|
26
|
+
version: '2.7'
|
27
27
|
- !ruby/object:Gem::Dependency
|
28
|
-
name:
|
28
|
+
name: coffee-script
|
29
29
|
requirement: !ruby/object:Gem::Requirement
|
30
30
|
requirements:
|
31
31
|
- - "~>"
|
32
32
|
- !ruby/object:Gem::Version
|
33
|
-
version: '
|
33
|
+
version: '2.4'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
36
|
version_requirements: !ruby/object:Gem::Requirement
|
37
37
|
requirements:
|
38
38
|
- - "~>"
|
39
39
|
- !ruby/object:Gem::Version
|
40
|
-
version: '
|
40
|
+
version: '2.4'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: colsole
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - "~>"
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: '0.5'
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - "~>"
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: '0.5'
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: commonmarker
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -67,103 +81,103 @@ dependencies:
|
|
67
81
|
- !ruby/object:Gem::Version
|
68
82
|
version: '0.6'
|
69
83
|
- !ruby/object:Gem::Dependency
|
70
|
-
name:
|
84
|
+
name: octokit
|
71
85
|
requirement: !ruby/object:Gem::Requirement
|
72
86
|
requirements:
|
73
87
|
- - "~>"
|
74
88
|
- !ruby/object:Gem::Version
|
75
|
-
version: '4.
|
89
|
+
version: '4.14'
|
76
90
|
type: :runtime
|
77
91
|
prerelease: false
|
78
92
|
version_requirements: !ruby/object:Gem::Requirement
|
79
93
|
requirements:
|
80
94
|
- - "~>"
|
81
95
|
- !ruby/object:Gem::Version
|
82
|
-
version: '4.
|
96
|
+
version: '4.14'
|
83
97
|
- !ruby/object:Gem::Dependency
|
84
|
-
name:
|
98
|
+
name: puma
|
85
99
|
requirement: !ruby/object:Gem::Requirement
|
86
100
|
requirements:
|
87
101
|
- - "~>"
|
88
102
|
- !ruby/object:Gem::Version
|
89
|
-
version: '
|
103
|
+
version: '5.1'
|
90
104
|
type: :runtime
|
91
105
|
prerelease: false
|
92
106
|
version_requirements: !ruby/object:Gem::Requirement
|
93
107
|
requirements:
|
94
108
|
- - "~>"
|
95
109
|
- !ruby/object:Gem::Version
|
96
|
-
version: '
|
110
|
+
version: '5.1'
|
97
111
|
- !ruby/object:Gem::Dependency
|
98
|
-
name:
|
112
|
+
name: requires
|
99
113
|
requirement: !ruby/object:Gem::Requirement
|
100
114
|
requirements:
|
101
115
|
- - "~>"
|
102
116
|
- !ruby/object:Gem::Version
|
103
|
-
version: '0.
|
117
|
+
version: '0.1'
|
104
118
|
type: :runtime
|
105
119
|
prerelease: false
|
106
120
|
version_requirements: !ruby/object:Gem::Requirement
|
107
121
|
requirements:
|
108
122
|
- - "~>"
|
109
123
|
- !ruby/object:Gem::Version
|
110
|
-
version: '0.
|
124
|
+
version: '0.1'
|
111
125
|
- !ruby/object:Gem::Dependency
|
112
|
-
name:
|
126
|
+
name: sassc
|
113
127
|
requirement: !ruby/object:Gem::Requirement
|
114
128
|
requirements:
|
115
129
|
- - "~>"
|
116
130
|
- !ruby/object:Gem::Version
|
117
|
-
version: '
|
131
|
+
version: '2.4'
|
118
132
|
type: :runtime
|
119
133
|
prerelease: false
|
120
134
|
version_requirements: !ruby/object:Gem::Requirement
|
121
135
|
requirements:
|
122
136
|
- - "~>"
|
123
137
|
- !ruby/object:Gem::Version
|
124
|
-
version: '
|
138
|
+
version: '2.4'
|
125
139
|
- !ruby/object:Gem::Dependency
|
126
|
-
name:
|
140
|
+
name: sinatra
|
127
141
|
requirement: !ruby/object:Gem::Requirement
|
128
142
|
requirements:
|
129
143
|
- - "~>"
|
130
144
|
- !ruby/object:Gem::Version
|
131
|
-
version: '
|
145
|
+
version: '2.0'
|
132
146
|
type: :runtime
|
133
147
|
prerelease: false
|
134
148
|
version_requirements: !ruby/object:Gem::Requirement
|
135
149
|
requirements:
|
136
150
|
- - "~>"
|
137
151
|
- !ruby/object:Gem::Version
|
138
|
-
version: '
|
152
|
+
version: '2.0'
|
139
153
|
- !ruby/object:Gem::Dependency
|
140
|
-
name:
|
154
|
+
name: slim
|
141
155
|
requirement: !ruby/object:Gem::Requirement
|
142
156
|
requirements:
|
143
157
|
- - "~>"
|
144
158
|
- !ruby/object:Gem::Version
|
145
|
-
version: '
|
159
|
+
version: '4.0'
|
146
160
|
type: :runtime
|
147
161
|
prerelease: false
|
148
162
|
version_requirements: !ruby/object:Gem::Requirement
|
149
163
|
requirements:
|
150
164
|
- - "~>"
|
151
165
|
- !ruby/object:Gem::Version
|
152
|
-
version: '
|
166
|
+
version: '4.0'
|
153
167
|
- !ruby/object:Gem::Dependency
|
154
|
-
name:
|
168
|
+
name: string-direction
|
155
169
|
requirement: !ruby/object:Gem::Requirement
|
156
170
|
requirements:
|
157
171
|
- - "~>"
|
158
172
|
- !ruby/object:Gem::Version
|
159
|
-
version: '2
|
173
|
+
version: '1.2'
|
160
174
|
type: :runtime
|
161
175
|
prerelease: false
|
162
176
|
version_requirements: !ruby/object:Gem::Requirement
|
163
177
|
requirements:
|
164
178
|
- - "~>"
|
165
179
|
- !ruby/object:Gem::Version
|
166
|
-
version: '2
|
180
|
+
version: '1.2'
|
167
181
|
description: A command line utility for markdown fun
|
168
182
|
email: db@dannyben.com
|
169
183
|
executables:
|
@@ -188,6 +202,7 @@ files:
|
|
188
202
|
- lib/madman/item.rb
|
189
203
|
- lib/madman/navigation.rb
|
190
204
|
- lib/madman/preview_server.rb
|
205
|
+
- lib/madman/refinements/array.rb
|
191
206
|
- lib/madman/refinements/string.rb
|
192
207
|
- lib/madman/renderers.rb
|
193
208
|
- lib/madman/renderers/default.rb
|
@@ -217,7 +232,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
217
232
|
- !ruby/object:Gem::Version
|
218
233
|
version: '0'
|
219
234
|
requirements: []
|
220
|
-
rubygems_version: 3.
|
235
|
+
rubygems_version: 3.1.4
|
221
236
|
signing_key:
|
222
237
|
specification_version: 4
|
223
238
|
summary: The Markdown Swiss Army Knife
|