synful 1.0.0 → 1.0.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +3 -1
- data/bin/synful +39 -21
- data/synful.gemspec +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: bebeb5fb786aeb51dced6d659f916b4780c5d826b34cde51b20c24d567e49b67
|
4
|
+
data.tar.gz: d28d17a448e5cf0c86b00e8c2589a4ada7bec18237536a910d39f14ec8ad4f25
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 983bbe5586af0479ad709165cd8100c69284098a1953586ea866ec57a153e91b292ba042d5f16c86d05ab22e69c9f88f81aad32526eb850ebc6cbc5d9da316e6
|
7
|
+
data.tar.gz: 246452e18e1df63ab9d99ff1a2576c50c9a9092566c4484a27cb97b9ada2f6c30bed70755430fdaafaf41bd5aa98eb51546ddd9e0c9ca9e5d8ec02dada290303
|
data/README.md
CHANGED
@@ -25,6 +25,8 @@ is made possible by the amazing Rouge library.
|
|
25
25
|
$ synful winr/bin/winr censive/lib/censive.rb
|
26
26
|
```
|
27
27
|
|
28
|
+
<img src="https://user-images.githubusercontent.com/142875/219864590-482cb060-465c-4fbb-9fe0-3de34dea703e.png" width="900">
|
29
|
+
|
28
30
|
A more complicated example is:
|
29
31
|
|
30
32
|
```
|
@@ -36,7 +38,7 @@ exclude all files with the `.spec` or `.ru` extensions. It will also
|
|
36
38
|
include files from the `lib/` and `test/` directories as well as the
|
37
39
|
`/tmp/example.rb` file. Even though the `test/boring-results.txt` file
|
38
40
|
should be rendered, we have disabled it via the `-` (minus sign or dash)
|
39
|
-
in front of
|
41
|
+
in front of its filename. Note that to use this type of negation, we
|
40
42
|
need to precede it with a "double-dash" `--` to tell `synful` that we
|
41
43
|
are done with the normal command options.
|
42
44
|
|
data/bin/synful
CHANGED
@@ -14,6 +14,7 @@
|
|
14
14
|
# ============================================================================
|
15
15
|
# TODO:
|
16
16
|
# 1. Ensure there is a section for a file, even when it has a bad encoding
|
17
|
+
# 2. See https://stackoverflow.com/questions/18519641/why-cant-i-refer-to-data-in-class-context
|
17
18
|
# ============================================================================
|
18
19
|
|
19
20
|
require "optparse"
|
@@ -134,15 +135,28 @@ __END__
|
|
134
135
|
<title>Synful</title>
|
135
136
|
<link rel="icon" href="data:,">
|
136
137
|
<style type="text/css">
|
137
|
-
|
138
|
-
|
139
|
-
a { text-decoration: none; }
|
140
|
-
|
141
|
-
|
142
|
-
|
138
|
+
body { margin: 0; padding: 0; font-family: Verdana; font-size: 14px; }
|
139
|
+
pre { margin: 0; font-family: Consolas, Menlo, monospace; }
|
140
|
+
a { text-decoration: none; scroll-margin-top: 0.5em; }
|
141
|
+
|
142
|
+
.cap {
|
143
|
+
background: black;
|
144
|
+
color: white;
|
145
|
+
font-weight: bold;
|
146
|
+
line-height: 30px;
|
147
|
+
display: grid;
|
148
|
+
grid-template-columns: 1fr 10em;
|
149
|
+
align-items: stretch;
|
150
|
+
}
|
151
|
+
.cap > div:nth-child(1) { padding-left: 1em; }
|
152
|
+
.cap > div:nth-child(2) { display: grid; grid-template-columns: 1fr 1fr 1fr; place-content: stretch; }
|
153
|
+
.cap a { text-align: center; color: white; }
|
154
|
+
.cap a:hover { background: rgba(255,255,255,0.5); }
|
155
|
+
|
156
|
+
@media print { .cap > div:nth-child(2) { display: none; } }
|
157
|
+
|
143
158
|
li a { color: #000; }
|
144
159
|
li a:hover { text-decoration: underline; color: #666; }
|
145
|
-
pre { margin: 0; font-family: Consolas, Menlo, monospace; }
|
146
160
|
|
147
161
|
.rouge-table { padding: 0; border-collapse: collapse; }
|
148
162
|
.rouge-table td { padding: 0; vertical-align: top; }
|
@@ -225,13 +239,15 @@ __END__
|
|
225
239
|
<%= erb :toc if (count = @list.size) > 1 %><%
|
226
240
|
@list.each_with_index do |file, i|
|
227
241
|
@file = file
|
228
|
-
@prev = @list[(i - 1) % count]
|
229
242
|
@next = @list[(i + 1) % count]
|
243
|
+
@prev = @list[(i - 1) % count]
|
230
244
|
@curr = count > 1 ? "#{i + 1}) " : "" %>
|
231
245
|
<%= erb :file %><% end %>
|
232
246
|
|
233
247
|
@@ toc
|
234
|
-
<
|
248
|
+
<div class="cap">
|
249
|
+
<div><a name="top">Index</a></div>
|
250
|
+
</div>
|
235
251
|
|
236
252
|
<ul><% @list.each do |file| %>
|
237
253
|
<li><a href="#<%= file %>"><%= file %></a></li><% end %>
|
@@ -261,18 +277,20 @@ __END__
|
|
261
277
|
end
|
262
278
|
%>
|
263
279
|
|
264
|
-
<
|
265
|
-
<
|
266
|
-
|
267
|
-
|
268
|
-
|
269
|
-
|
270
|
-
|
271
|
-
|
272
|
-
<
|
273
|
-
|
274
|
-
|
275
|
-
|
280
|
+
<div class="cap">
|
281
|
+
<div>
|
282
|
+
<a name="<%= @file %>"><%= @curr %><%= @file %>
|
283
|
+
(<%= data.count("\n") + 1 %> lines)
|
284
|
+
<%= "[" + type.tag + "]" if type %>
|
285
|
+
<%= File.mtime(@file).strftime("on %Y-%m-%d at %-I:%M %P") %>
|
286
|
+
</a>
|
287
|
+
</div>
|
288
|
+
<div>
|
289
|
+
<a href="#<%= @next %>">↓</a>
|
290
|
+
<a href="#<%= @prev %>">↑</a>
|
291
|
+
<a href="#top">⥣</a>
|
292
|
+
</div>
|
293
|
+
</div>
|
276
294
|
|
277
295
|
<%=
|
278
296
|
if type
|
data/synful.gemspec
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: synful
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.0.
|
4
|
+
version: 1.0.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Steve Shreeve
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2023-02-
|
11
|
+
date: 2023-02-22 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: rouge
|