runeblog 0.2.9 → 0.2.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.tgz +0 -0
- data/lib/helpers-blog.rb +16 -2
- data/lib/runeblog.rb +63 -27
- data/lib/runeblog_version.rb +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: a037d087baf23e47f7b3c254dac3348048cc9c498ad439a5f235149b9bbf96cb
|
4
|
+
data.tar.gz: f82a11b32ee3eb3738abdc1a60f3fc1606efb5252a29f5902d53591117199c6c
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9fa1d23bd68596356383676b5d4c5c9fba04afaba2d98ccf8bb1d27fb4b68aba8b9a1078aaebcc7a61cefb8d8bb5102e51d09ecd68e82ce436afaa734c028862
|
7
|
+
data.tar.gz: aae6ba4be7009d1cfcc7461f6dfb5f4459d880b796a7842e67050863e6f48d9ede6923a8995c4945a0923153b7f97c051f18691f8e0d343ed450dcba586c88e0
|
data/empty_view.tgz
CHANGED
Binary file
|
data/lib/helpers-blog.rb
CHANGED
@@ -38,7 +38,7 @@ exit unless rc
|
|
38
38
|
return false
|
39
39
|
end
|
40
40
|
|
41
|
-
def livetext(src, dst=nil)
|
41
|
+
def livetext(src, dst=nil, dir=".")
|
42
42
|
log!(enter: __method__, args: [src, dst])
|
43
43
|
src << ".lt3" unless src.end_with?(".lt3")
|
44
44
|
if dst
|
@@ -47,7 +47,21 @@ exit unless rc
|
|
47
47
|
dst = src.sub(/.lt3$/, "")
|
48
48
|
end
|
49
49
|
# return unless stale?(src, dst)
|
50
|
-
system("livetext #{src} >#{dst}")
|
50
|
+
Dir.chdir(dir) { system("livetext #{src} >#{dst}") }
|
51
|
+
end
|
52
|
+
|
53
|
+
def livetext!(src, dst=nil, dir=".")
|
54
|
+
log!(enter: __method__, args: [src, dst])
|
55
|
+
src << ".lt3" unless src.end_with?(".lt3")
|
56
|
+
if dst
|
57
|
+
dst << ".html" unless dst.end_with?(".html")
|
58
|
+
else
|
59
|
+
dst = src.sub(/.lt3$/, "")
|
60
|
+
end
|
61
|
+
# return unless stale?(src, dst)
|
62
|
+
STDERR.puts "-- livetext #{src} >#{dst} \n in: #{Dir.pwd}\n from: #{caller[0]}"
|
63
|
+
Dir.chdir(dir) { system("livetext #{src} >#{dst}") }
|
64
|
+
STDERR.puts "... completed"
|
51
65
|
end
|
52
66
|
|
53
67
|
def get_root
|
data/lib/runeblog.rb
CHANGED
@@ -206,7 +206,7 @@ class RuneBlog
|
|
206
206
|
end
|
207
207
|
|
208
208
|
Dir.chdir("#@root/views/#{vdir}") do
|
209
|
-
livetext "
|
209
|
+
livetext "generate", "../../../remote/index", "themes/standard/blog"
|
210
210
|
pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
|
211
211
|
dump(pub, "publish")
|
212
212
|
|
@@ -388,37 +388,73 @@ class RuneBlog
|
|
388
388
|
[noext, viewdir, slugdir, aslug, theme]
|
389
389
|
end
|
390
390
|
|
391
|
+
def _handle_post(draft, view)
|
392
|
+
noext, viewdir, slugdir, aslug, @theme = _copy_get_dirs(draft, view)
|
393
|
+
html = noext[5..-1] # strip "nnnn-"
|
394
|
+
remote = viewdir + "/remote"
|
395
|
+
Dir.chdir(slugdir) do
|
396
|
+
copy(draft, ".") # copy source into slugdir
|
397
|
+
lt3 = draft.split("/")[-1] # Remember: Some posts may be in more than
|
398
|
+
copy(lt3, remote) # one view -- careful with links back
|
399
|
+
STDERR.puts "1 pwd = #{Dir.pwd}"
|
400
|
+
livetext! draft, html
|
401
|
+
STDERR.puts " copy #{html}, #{remote}/#{html}"
|
402
|
+
copy(html, "#{remote}/#{html}")
|
403
|
+
|
404
|
+
title_line = File.readlines(draft).grep(/^.title /).first
|
405
|
+
title = title_line.split(" ", 2)[1]
|
406
|
+
excerpt = File.read("teaser.txt")
|
407
|
+
vars = %[.set title="#{title.chomp}"\n] +
|
408
|
+
%[.set teaser="#{excerpt.chomp}"]
|
409
|
+
theme = "#{viewdir}/themes/standard"
|
410
|
+
File.open("#{theme}/post/vars.lt3", "w") {|f| f.puts vars }
|
411
|
+
|
412
|
+
livetext! "generate.lt3", "#{remote}/html", "#{theme}/post"
|
413
|
+
copy("#{remote}/#{html}", "#{theme}/post")
|
414
|
+
|
415
|
+
livetext! "permalink.lt3", "#{remote}/permalink/#{html}", "#{theme}/post"
|
416
|
+
log!(str: "About to enter remote/", pwd: true, dir: true)
|
417
|
+
Dir.chdir(remote) do
|
418
|
+
log!(str: "Now in remote/", pwd: true, dir: true)
|
419
|
+
system("cp -r ../themes/standard/widgets .")
|
420
|
+
log!(str: "finished with remote/", pwd: true, dir: true)
|
421
|
+
end
|
422
|
+
end
|
423
|
+
end
|
424
|
+
|
391
425
|
def generate_post(draft)
|
392
426
|
log!(enter: __method__, args: [draft])
|
393
427
|
views = _get_views(draft)
|
394
428
|
views.each do |view|
|
395
|
-
|
396
|
-
remote = viewdir + "/remote"
|
397
|
-
Dir.chdir(slugdir) do
|
398
|
-
copy(draft, ".")
|
399
|
-
lt3 = draft.split("/")[-1]
|
400
|
-
# Remember: Some posts may be in more than one view -- careful with links back
|
401
|
-
copy(lt3, remote)
|
402
|
-
html = noext[5..-1]
|
403
|
-
livetext draft, html # livetext "foobar.lt3", "foobar.html"
|
404
|
-
copy(html, "../../remote/post/index.html")
|
405
|
-
title_line = File.readlines(draft).grep(/^.title /).first
|
406
|
-
title = title_line.split(" ", 2)[1]
|
407
|
-
excerpt = File.read("teaser.txt")
|
408
|
-
vars = %[.set title="#{title.chomp}"\n] +
|
409
|
-
%[.set teaser="#{excerpt.chomp}"]
|
410
|
-
theme = "../../theme/standard"
|
411
|
-
File.open("vars.lt3", "w") {|f| f.puts vars }
|
412
|
-
livetext "#{theme}/post/generate.lt3", "#{remote}/#{html}"
|
413
|
-
livetext "#{theme}/post/permalink.lt3", "#{remote}/permalink/#{html}"
|
414
|
-
log!(str: "About to enter remote/", pwd: true, dir: true)
|
415
|
-
Dir.chdir(remote) do
|
416
|
-
log!(str: "Now in remote/", pwd: true, dir: true)
|
417
|
-
system("cp -r ../themes/standard/widgets .")
|
418
|
-
log!(str: "finished with remote/", pwd: true, dir: true)
|
419
|
-
end
|
420
|
-
end
|
429
|
+
_handle_post(draft, view)
|
421
430
|
end
|
431
|
+
# noext, viewdir, slugdir, aslug, @theme = _copy_get_dirs(draft, view)
|
432
|
+
# remote = viewdir + "/remote"
|
433
|
+
# Dir.chdir(slugdir) do
|
434
|
+
# copy(draft, ".")
|
435
|
+
# lt3 = draft.split("/")[-1]
|
436
|
+
# # Remember: Some posts may be in more than one view -- careful with links back
|
437
|
+
# copy(lt3, remote)
|
438
|
+
# html = noext[5..-1] # strip "nnnn-"
|
439
|
+
# livetext! draft, html
|
440
|
+
# copy(html, "#{remote}/#{html}")
|
441
|
+
# title_line = File.readlines(draft).grep(/^.title /).first
|
442
|
+
# title = title_line.split(" ", 2)[1]
|
443
|
+
# excerpt = File.read("teaser.txt")
|
444
|
+
# vars = %[.set title="#{title.chomp}"\n] +
|
445
|
+
# %[.set teaser="#{excerpt.chomp}"]
|
446
|
+
# theme = "#{viewdir}/themes/standard"
|
447
|
+
# File.open("#{theme}/post/vars.lt3", "w") {|f| f.puts vars }
|
448
|
+
# livetext! "generate.lt3", "#{remote}/html", "#{theme}/post"
|
449
|
+
# copy("#{remote}/html", "#{theme}/post")
|
450
|
+
# livetext! "permalink.lt3", "#{remote}/permalink/#{html}", "#{theme}/post"
|
451
|
+
# log!(str: "About to enter remote/", pwd: true, dir: true)
|
452
|
+
# Dir.chdir(remote) do
|
453
|
+
# log!(str: "Now in remote/", pwd: true, dir: true)
|
454
|
+
# system("cp -r ../themes/standard/widgets .")
|
455
|
+
# log!(str: "finished with remote/", pwd: true, dir: true)
|
456
|
+
# end
|
457
|
+
# end
|
422
458
|
end
|
423
459
|
|
424
460
|
def relink
|
data/lib/runeblog_version.rb
CHANGED
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.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: 2019-09-
|
11
|
+
date: 2019-09-28 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|