runeblog 0.2.17 → 0.2.18
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/empty_view.tgz +0 -0
- data/lib/liveblog.rb +27 -16
- data/lib/runeblog.rb +3 -1
- data/lib/runeblog_version.rb +1 -1
- data/lib/xlate.rb +12 -6
- data/test/make_blog.rb +16 -13
- metadata +2 -3
- data/test/config +0 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2f937d26af0033b5370fb7057e148cf2a0c9574f1fd2a3575f19ba11a9fb412f
|
4
|
+
data.tar.gz: 54ee56282b161b3b114d968f31d818f35eb9d9116bebda68f2de380d8aa5d290
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: b820edb205e03e5a4ba420daa50b8e163e2dc74fdc3dcebb96deecc963e0ef0e64d1a9c592bd0825e2589fca6998323990b6b76c1c015483038693bf7af500dc
|
7
|
+
data.tar.gz: 07e9915006923ba7de0e33963ce4ecf9a63d4fbe20368f8962f13d0ed131951905219ccaafdff636f6100bd230546877ab6122e4cc48151e06dcdbeb7469cdc6
|
data/empty_view.tgz
CHANGED
Binary file
|
data/lib/liveblog.rb
CHANGED
@@ -117,13 +117,25 @@ def _write_card(cardfile, mainfile, pairs, card_title, tag, relative: true)
|
|
117
117
|
</h5>
|
118
118
|
EOS
|
119
119
|
log!(str: "Writing data pairs to #{cardfile}.html", pwd: true)
|
120
|
-
top = ""
|
121
|
-
top = :widgets/tag + "/" unless tag == "news" # FIXME !!
|
122
120
|
pairs.each do |file, title|
|
123
|
-
|
124
|
-
|
125
|
-
|
126
|
-
|
121
|
+
url = file
|
122
|
+
if ["news", "links"].include? tag
|
123
|
+
frameable, title = title.split(/, */, 2)
|
124
|
+
frameable = (frameable.downcase == "yes")
|
125
|
+
if frameable
|
126
|
+
anchor = %[<a href="javascript: void(0)" onclick="javascript:open_main('#{url}')">#{title}</a>]
|
127
|
+
else
|
128
|
+
anchor = %[<a href='#{url}' target='_blank'>#{title}</a>]
|
129
|
+
end
|
130
|
+
else
|
131
|
+
url = :widgets/tag/file
|
132
|
+
anchor = %[<a href="javascript: void(0)" onclick="javascript:open_main('#{url}')">#{title}</a>]
|
133
|
+
end
|
134
|
+
STDERR.puts [file, title].inspect
|
135
|
+
STDERR.puts [tag, frameable, anchor].inspect
|
136
|
+
STDERR.puts
|
137
|
+
wrapper = %[<li class="list-group-item">#{anchor}</li>]
|
138
|
+
f.puts wrapper
|
127
139
|
end
|
128
140
|
f.puts <<-EOS
|
129
141
|
</div>
|
@@ -138,7 +150,7 @@ def _write_main(mainfile, pairs, card_title)
|
|
138
150
|
_html_body(f) do
|
139
151
|
f.puts "<h1>#{card_title}</h1>"
|
140
152
|
pairs.each do |file, title|
|
141
|
-
main = _main(file)
|
153
|
+
main = (file.start_with?("http") ? _main(file) : file)
|
142
154
|
f.puts %[<a style="text-decoration: none; font-size: 24px" #{main}>#{title}</a> <br>]
|
143
155
|
end
|
144
156
|
end
|
@@ -153,7 +165,7 @@ def make_main_links
|
|
153
165
|
cardfile, mainfile = "#{tag}-card", "#{tag}-main"
|
154
166
|
input = "list.data"
|
155
167
|
log!(str: "Reading #{input}", pwd: true)
|
156
|
-
pairs = File.readlines(input).map {|line| line.chomp.split(
|
168
|
+
pairs = File.readlines(input).map {|line| line.chomp.split(/, */, 2) }
|
157
169
|
_write_main(mainfile, pairs, card_title)
|
158
170
|
widget_relative = false # (tag != "news") # FIXME kludge!!!
|
159
171
|
_write_card(cardfile, mainfile, pairs, card_title, tag, relative: widget_relative)
|
@@ -440,26 +452,25 @@ STDERR.puts "---- SIDEBAR pwd = #{Dir.pwd}"
|
|
440
452
|
wtag = :widgets/tag
|
441
453
|
raise "Can't find #{wtag}" unless Dir.exist?(wtag)
|
442
454
|
tcard = "#{tag}-card.html"
|
443
|
-
|
444
|
-
xlate cwd: wtag, src: tag, dst: tcard, debug: true
|
455
|
+
xlate cwd: wtag, src: tag, dst: tcard
|
445
456
|
_include_file wtag/tcard
|
446
457
|
end
|
447
458
|
_out %[</div>]
|
448
459
|
end
|
449
460
|
|
450
461
|
def sidebar!
|
451
|
-
|
452
|
-
|
453
|
-
|
454
|
-
|
462
|
+
if _args.include? "off"
|
463
|
+
_body { } # iterate, do nothing
|
464
|
+
return
|
465
|
+
end
|
466
|
+
|
455
467
|
_out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
|
456
468
|
_args do |token|
|
457
469
|
tag = token.chomp.strip.downcase
|
458
470
|
wtag = :widgets/tag
|
459
471
|
raise "Can't find #{wtag}" unless Dir.exist?(wtag)
|
460
472
|
tcard = "#{tag}-card.html"
|
461
|
-
|
462
|
-
xlate cwd: wtag, src: tag, dst: tcard, debug: true
|
473
|
+
xlate cwd: wtag, src: tag, dst: tcard
|
463
474
|
_include_file wtag/tcard
|
464
475
|
end
|
465
476
|
_out %[</div>]
|
data/lib/runeblog.rb
CHANGED
@@ -385,7 +385,9 @@ class RuneBlog
|
|
385
385
|
log!(enter: __method__, args: [view])
|
386
386
|
generate_index(view) # recent posts (recent.html)
|
387
387
|
vdir = @root/:views/view
|
388
|
-
xlate cwd: vdir
|
388
|
+
xlate cwd: vdir/"themes/standard/etc",
|
389
|
+
src: "blog.css.lt3", copy: vdir/"remote/etc/blog.css" # , debug: true
|
390
|
+
xlate cwd: vdir/"themes/standard",
|
389
391
|
src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
|
390
392
|
end
|
391
393
|
|
data/lib/runeblog_version.rb
CHANGED
data/lib/xlate.rb
CHANGED
@@ -15,17 +15,23 @@ LEXT = ".lt3"
|
|
15
15
|
copy: nil, debug: false, force: false)
|
16
16
|
src += LEXT unless src.end_with?(LEXT)
|
17
17
|
dst += ".html" unless dst.end_with?(".html") || strip
|
18
|
-
|
18
|
+
indent = " "*12
|
19
19
|
Dir.chdir(cwd) do
|
20
|
-
return unless stale?(src, dst, force)
|
21
20
|
if debug
|
22
|
-
STDERR.puts "-- xlate #{src} >#{dst}"
|
23
|
-
STDERR.puts "
|
24
|
-
STDERR.puts "
|
25
|
-
STDERR.puts "
|
21
|
+
STDERR.puts "#{indent} -- xlate #{src} >#{dst}"
|
22
|
+
STDERR.puts "#{indent} in: #{Dir.pwd}"
|
23
|
+
STDERR.puts "#{indent} from: #{caller[0]}"
|
24
|
+
STDERR.puts "#{indent} copy: #{copy}" if copy
|
25
|
+
end
|
26
|
+
if stale?(src, dst, force)
|
27
|
+
# do nothing
|
28
|
+
else
|
29
|
+
STDERR.puts "#{indent} -- ^ Already up to date!" if debug
|
30
|
+
return
|
26
31
|
end
|
27
32
|
rc = system("livetext #{src} >#{dst}")
|
28
33
|
STDERR.puts "...completed (shell returned #{rc})" if debug
|
34
|
+
system("cp #{dst} #{copy}") if copy
|
29
35
|
end
|
30
36
|
end
|
31
37
|
|
data/test/make_blog.rb
CHANGED
@@ -14,8 +14,8 @@ def getch
|
|
14
14
|
# sleep 5
|
15
15
|
end
|
16
16
|
|
17
|
-
def debug(str)
|
18
|
-
STDERR.puts "
|
17
|
+
def debug(str = "")
|
18
|
+
STDERR.puts "#{Time.now.strftime("%H:%M:%S")} #{str}"
|
19
19
|
end
|
20
20
|
|
21
21
|
def make_post(x, title, teaser, body, views=[])
|
@@ -23,10 +23,10 @@ def make_post(x, title, teaser, body, views=[])
|
|
23
23
|
# print "."
|
24
24
|
x.create_new_post(title, true, teaser: teaser, body: body, other_views: views)
|
25
25
|
views.each do |view|
|
26
|
-
debug
|
26
|
+
debug
|
27
|
+
debug "** generate_index #{view}"
|
27
28
|
x.generate_index(view)
|
28
29
|
end # recent.html
|
29
|
-
STDERR.puts
|
30
30
|
end
|
31
31
|
|
32
32
|
def show_lines(text)
|
@@ -44,7 +44,7 @@ system("rm -rf .blogs")
|
|
44
44
|
RuneBlog.create_new_blog_repo(".blogs")
|
45
45
|
x = RuneBlog.new(".blogs")
|
46
46
|
|
47
|
-
debug("create_view
|
47
|
+
debug("create_view: around_austin")
|
48
48
|
x.create_view("around_austin") # FIXME remember view title!
|
49
49
|
|
50
50
|
# Hack:
|
@@ -52,12 +52,13 @@ if File.exist?("publish")
|
|
52
52
|
system("cp publish .blogs/views/around_austin/publish")
|
53
53
|
end
|
54
54
|
|
55
|
-
debug("create_view
|
55
|
+
debug("create_view: computing")
|
56
56
|
x.create_view("computing")
|
57
57
|
|
58
|
-
debug("create_view
|
58
|
+
debug("create_view: music")
|
59
59
|
x.create_view("music")
|
60
60
|
|
61
|
+
debug("-- change_view: around_austin")
|
61
62
|
x.change_view("around_austin") # 1 2 7 8 9
|
62
63
|
|
63
64
|
make_post(x, "What's at Stubbs...", <<-EXCERPT, <<-BODY, ["music"])
|
@@ -72,6 +73,7 @@ EXCERPT
|
|
72
73
|
Now, depending on what you consider "major," blah blah blah...
|
73
74
|
BODY
|
74
75
|
|
76
|
+
debug("-- change_view: computing")
|
75
77
|
x.change_view("computing") # 3 5 6
|
76
78
|
|
77
79
|
make_post(x, "Elixir Conf coming up...", <<-EXCERPT, <<-BODY)
|
@@ -81,6 +83,7 @@ I mean, unless the previous one was the last one ever, which I don't expect to
|
|
81
83
|
happen for a couple of decades.
|
82
84
|
BODY
|
83
85
|
|
86
|
+
debug("-- change_view: music")
|
84
87
|
x.change_view("music") # 4 10
|
85
88
|
|
86
89
|
make_post(x, "Does indie still matter?", <<-EXCERPT, <<-BODY)
|
@@ -89,6 +92,7 @@ EXCERPT
|
|
89
92
|
And more about indie music.
|
90
93
|
BODY
|
91
94
|
|
95
|
+
debug("-- change_view: computing")
|
92
96
|
x.change_view("computing")
|
93
97
|
|
94
98
|
make_post(x, "The genius of Scenic", <<-EXCERPT, <<-BODY)
|
@@ -103,6 +107,7 @@ EXCERPT
|
|
103
107
|
But that day hasn't come yet.
|
104
108
|
BODY
|
105
109
|
|
110
|
+
debug("-- change_view: around_austin")
|
106
111
|
x.change_view("around_austin")
|
107
112
|
|
108
113
|
make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
|
@@ -124,6 +129,7 @@ EXCERPT
|
|
124
129
|
This is about Sabine St, blah blah lorem ipsum dolor...
|
125
130
|
BODY
|
126
131
|
|
132
|
+
debug("-- change_view: music")
|
127
133
|
x.change_view("music")
|
128
134
|
|
129
135
|
make_post(x, "Remember Modest Mouse?", <<-EXCERPT, <<-BODY, ["around_austin"])
|
@@ -133,11 +139,8 @@ But I first heard of them
|
|
133
139
|
in 2005.
|
134
140
|
BODY
|
135
141
|
|
136
|
-
debug
|
142
|
+
debug
|
143
|
+
debug("** generate_view: around_austin")
|
137
144
|
x.generate_view("around_austin")
|
138
145
|
|
139
|
-
|
140
|
-
|
141
|
-
puts
|
142
|
-
puts Time.now
|
143
|
-
puts
|
146
|
+
debug
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: runeblog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-10-
|
11
|
+
date: 2019-10-04 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -77,7 +77,6 @@ files:
|
|
77
77
|
- lib/runeblog_version.rb
|
78
78
|
- lib/view.rb
|
79
79
|
- lib/xlate.rb
|
80
|
-
- test/config
|
81
80
|
- test/fakeimage.jpg
|
82
81
|
- test/general_test.rb
|
83
82
|
- test/make_blog.rb
|
data/test/config
DELETED