runeblog 0.3.08 → 0.3.10
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/empty_view/assets/back-icon.png +0 -0
- data/lib/liveblog.rb +2 -1
- data/lib/publish.rb +1 -0
- data/lib/repl.rb +23 -19
- data/lib/runeblog.rb +15 -0
- data/lib/runeblog_version.rb +1 -1
- data/runeblog.gemspec +1 -1
- metadata +5 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bba11b6d6405c00ce558d4eef26ebc40059734a0fd479e1de01c01bc0bad3b0
|
4
|
+
data.tar.gz: a94636937502e82d06701b0d4da8743c1c82e256e36362ab577e0f3223a85923
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: d6678b23a3729c19d53769d5715a7912072203c6e935da741ae418531dfca531d017839f3c05f708ed21b0705b232b3d6b69f0855814dbf8a5f7c41738a22a43
|
7
|
+
data.tar.gz: 25e8b7feed31831f4dba88c33f8f4377bb48715a59310bc66ec1b5f4d5c77cc9fb8d1b2ecd452d1fbd19e5343ba2a140b54d540d5107bd4347fd3b3aa6778d33
|
Binary file
|
data/lib/liveblog.rb
CHANGED
@@ -78,7 +78,8 @@ end
|
|
78
78
|
end
|
79
79
|
|
80
80
|
def post_toolbar
|
81
|
-
|
81
|
+
back_icon = %[<img src="assets/back-icon.png" width=24 height=24 alt="Go back"></img>]
|
82
|
+
back = %[<a style="text-decoration: none" href="javascript:history.go(-1)">#{back_icon}</a>]
|
82
83
|
_out <<~HTML
|
83
84
|
<div align='right'>#{back} #@reddit_comments</div>
|
84
85
|
HTML
|
data/lib/publish.rb
CHANGED
@@ -52,6 +52,7 @@ class RuneBlog::Publishing
|
|
52
52
|
view_name = @blog.view.name
|
53
53
|
viewpath = dir
|
54
54
|
cmd = "rsync -r -z #{@blog.root}/views/#{@blog.view}/remote/ #@user@#@server:#{viewpath}/"
|
55
|
+
puts cmd
|
55
56
|
system!(cmd)
|
56
57
|
check_new_posts
|
57
58
|
dump("#{@blog.view} at #{Time.now}", "#{@blog.view.dir}/last_published")
|
data/lib/repl.rb
CHANGED
@@ -69,10 +69,10 @@ module RuneBlog::REPL
|
|
69
69
|
|
70
70
|
def cmd_manage(arg)
|
71
71
|
case arg
|
72
|
-
when "pages"; _manage_pages
|
73
|
-
when "links"; _manage_links
|
74
|
-
when "navbar"; _manage_navbar
|
75
|
-
|
72
|
+
when "pages"; _manage_pages
|
73
|
+
when "links"; _manage_links
|
74
|
+
when "navbar"; _manage_navbar
|
75
|
+
when "pinned"; _manage_pinned # ditch this??
|
76
76
|
else
|
77
77
|
puts "#{arg} is unknown"
|
78
78
|
end
|
@@ -119,7 +119,7 @@ module RuneBlog::REPL
|
|
119
119
|
edit_file(data)
|
120
120
|
end
|
121
121
|
|
122
|
-
def _manage_pages
|
122
|
+
def _manage_pages
|
123
123
|
dir = @blog.view.dir/"themes/standard/widgets/pages"
|
124
124
|
# Assume child files already generated (and list.data??)
|
125
125
|
data = dir/"list.data"
|
@@ -213,13 +213,18 @@ module RuneBlog::REPL
|
|
213
213
|
puts " Regenerating posts..." unless drafts.empty?
|
214
214
|
drafts.each do |draft|
|
215
215
|
orig = @blog.root/:drafts/draft
|
216
|
-
|
217
|
-
|
218
|
-
next if fresh?(orig,
|
219
|
-
|
216
|
+
postdir = @blog.root/:posts/draft.sub(/.lt3$/, "")
|
217
|
+
content = postdir/"/guts.html"
|
218
|
+
next if fresh?(orig, content)
|
219
|
+
|
220
220
|
@blog.generate_post(orig) # rebuild post
|
221
|
+
Dir.chdir(postdir) do
|
222
|
+
meta = @blog.read_metadata
|
223
|
+
num, title = meta.num, meta.title
|
224
|
+
num = '%4d' % num.to_s
|
225
|
+
puts " ", fx(num, Red), " ", fx(title, Black)
|
226
|
+
end
|
221
227
|
end
|
222
|
-
puts
|
223
228
|
end
|
224
229
|
|
225
230
|
def cmd_rebuild
|
@@ -235,8 +240,7 @@ module RuneBlog::REPL
|
|
235
240
|
_tmp_error(err)
|
236
241
|
end
|
237
242
|
|
238
|
-
def cmd_change_view(arg)
|
239
|
-
# Simplify this
|
243
|
+
def cmd_change_view(arg = nil)
|
240
244
|
if arg.nil?
|
241
245
|
viewnames = @blog.views.map {|x| x.name }
|
242
246
|
n = viewnames.find_index(@blog.view.name)
|
@@ -323,7 +327,7 @@ module RuneBlog::REPL
|
|
323
327
|
lines = lines.select {|x| x =~ /^title / && x !~ /VIEW_/ }
|
324
328
|
title = lines.first.split(" ", 2)[1]
|
325
329
|
print " ", ('%15s' % v)
|
326
|
-
puts " ", fx(title,
|
330
|
+
puts " ", fx(title, Black)
|
327
331
|
end
|
328
332
|
puts
|
329
333
|
end
|
@@ -342,7 +346,7 @@ module RuneBlog::REPL
|
|
342
346
|
Dir.chdir(dir) { meta = @blog.read_metadata }
|
343
347
|
num, title = meta.num, meta.title
|
344
348
|
num = '%4d' % num.to_s
|
345
|
-
puts " ", fx(num, Red), " ", fx(title,
|
349
|
+
puts " ", fx(num, Red), " ", fx(title, Black)
|
346
350
|
draft = @blog.root/:drafts/post + ".lt3"
|
347
351
|
other = meta.views - [@blog.view.to_s]
|
348
352
|
unless other.empty?
|
@@ -355,23 +359,23 @@ module RuneBlog::REPL
|
|
355
359
|
end
|
356
360
|
|
357
361
|
def cmd_list_drafts
|
358
|
-
|
359
|
-
if
|
362
|
+
curr_drafts = @blog.drafts # current view
|
363
|
+
if curr_drafts.empty?
|
360
364
|
puts "\n No drafts\n "
|
361
365
|
return
|
362
366
|
else
|
363
367
|
puts
|
364
|
-
|
368
|
+
curr_drafts.each do |draft|
|
365
369
|
base = draft.sub(/.lt3$/, "")
|
366
370
|
dir = @blog.root/:posts/base
|
367
371
|
meta = nil
|
368
372
|
Dir.chdir(dir) { meta = @blog.read_metadata }
|
369
373
|
num, title = meta.num, meta.title
|
370
374
|
num = '%4d' % num.to_s
|
371
|
-
puts " ", fx(num, Red), " ", fx(title,
|
375
|
+
puts " ", fx(num, Red), " ", fx(title, Black)
|
372
376
|
other = @blog._get_views(@blog.root/:drafts/draft) - [@blog.view.to_s]
|
373
377
|
unless other.empty?
|
374
|
-
print fx(" "*9 + "also in: ",
|
378
|
+
print fx(" "*9 + "also in: ", Bold)
|
375
379
|
puts other.join(", ")
|
376
380
|
end
|
377
381
|
end
|
data/lib/runeblog.rb
CHANGED
@@ -498,6 +498,21 @@ class RuneBlog
|
|
498
498
|
end
|
499
499
|
|
500
500
|
def drafts
|
501
|
+
log!(enter: __method__, level: 3)
|
502
|
+
curr_drafts = self.all_drafts
|
503
|
+
list = []
|
504
|
+
curr_drafts.each do |draft|
|
505
|
+
postdir = @root/:views/self.view/:posts/draft.sub(/.lt3$/, "")
|
506
|
+
next unless Dir.exist?(postdir)
|
507
|
+
meta = nil
|
508
|
+
Dir.chdir(postdir) { meta = read_metadata }
|
509
|
+
# puts [draft, meta.views].inspect
|
510
|
+
list << draft if meta.views.include?(self.view.to_s)
|
511
|
+
end
|
512
|
+
list.sort
|
513
|
+
end
|
514
|
+
|
515
|
+
def all_drafts
|
501
516
|
log!(enter: __method__, level: 3)
|
502
517
|
dir = @root/:drafts
|
503
518
|
drafts = Dir.entries(dir).grep(/^\d{4}.*/)
|
data/lib/runeblog_version.rb
CHANGED
data/runeblog.gemspec
CHANGED
@@ -20,7 +20,7 @@ spec = Gem::Specification.new do |s|
|
|
20
20
|
s.authors = ["Hal Fulton"]
|
21
21
|
s.email = 'rubyhacker@gmail.com'
|
22
22
|
s.executables << "blog"
|
23
|
-
s.add_runtime_dependency 'livetext', '~> 0.9', '>= 0.9.
|
23
|
+
s.add_runtime_dependency 'livetext', '~> 0.9', '>= 0.9.02'
|
24
24
|
s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.20'
|
25
25
|
|
26
26
|
s.add_development_dependency 'minitest', '~> 5.10', '>= 5.10.0'
|
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.3.
|
4
|
+
version: 0.3.10
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-01-
|
11
|
+
date: 2020-01-07 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -19,7 +19,7 @@ dependencies:
|
|
19
19
|
version: '0.9'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.9.
|
22
|
+
version: 0.9.02
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
@@ -29,7 +29,7 @@ dependencies:
|
|
29
29
|
version: '0.9'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.9.
|
32
|
+
version: 0.9.02
|
33
33
|
- !ruby/object:Gem::Dependency
|
34
34
|
name: rubytext
|
35
35
|
requirement: !ruby/object:Gem::Requirement
|
@@ -89,6 +89,7 @@ files:
|
|
89
89
|
- data/global.lt3
|
90
90
|
- data/universal.lt3
|
91
91
|
- empty_view/assets/austin-pano.jpg
|
92
|
+
- empty_view/assets/back-icon.png
|
92
93
|
- empty_view/assets/reddit-logo.png
|
93
94
|
- empty_view/assets/sky2.jpg
|
94
95
|
- empty_view/config/exper/2svg.lt3
|