runeblog 0.3.15 → 0.3.16

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 29a43db71861d8f4f4c0fb7d53a105c2a53046bf7750dbf027ab02e613369861
4
- data.tar.gz: 882e0d89b642866fdb87f3be48bebbcf3af37ebcc3d0a8cb1671adc21722cb2d
3
+ metadata.gz: 8d6961e05ec2e2b61542ec6d149bf2af83f77d8870549707bdde78764fbce0aa
4
+ data.tar.gz: 9e58ad2e2a60078de58c82fba9ce656b255836f38ac36840131e31ec864b4e7e
5
5
  SHA512:
6
- metadata.gz: 0720c49855701a7b032012b951efd315dfe882a0498a8e7d7d771741ed3849b58f3519329fdcc93939e0a7ee9c7827c41d4d3720737d48d9926109171ba1b609
7
- data.tar.gz: f0092498f40e784bee2847ae5ca11966e03fb9a59d5d9fca2c9a3142050f43df1e0fbff8607ebcc5d683869ab5fc0883ab681dbe87fb51e1e1644d2cd762e998
6
+ metadata.gz: cb5a93d9fabf6ad9e16c433590ee58a4b15946873ad7e50cb051159eb03694dcd3c4b31abc9d7cb0854216b18caee832d888a4ef44ed999f6a81a2311b995fab
7
+ data.tar.gz: 85e551c444ca1099de08e4885c2d657b8564e482bca77a5b3fac4733826248c1726217c06b371625a30317149d87b25a98614bd441c88b3b9e1f82856a2260df
@@ -9,10 +9,8 @@
9
9
  <!-- Generated from $File on $$date; editing not recommended. -->
10
10
 
11
11
  .seek global.lt3
12
- .include vars.lt3
13
12
 
14
13
  . FIXME
15
-
16
14
  .head
17
15
  og:title $title
18
16
  description $teaser
@@ -13,7 +13,6 @@
13
13
  <!-- It was generated from $File on $$date. -->
14
14
 
15
15
  .seek global.lt3
16
- .include vars.lt3
17
16
 
18
17
  .head
19
18
  og:title $title
@@ -33,8 +33,10 @@ def init_liveblog # FIXME - a lot of this logic sucks
33
33
  </a>
34
34
  HTML
35
35
  end
36
- rescue
37
- raise "Only works inside a blog repo"
36
+ rescue => err
37
+ STDERR.puts "err = #{err}"
38
+ STDERR.puts err.backtrace.join("\n")
39
+ # raise "Only works inside a blog repo"
38
40
  end
39
41
 
40
42
  ##################
@@ -121,3 +121,10 @@
121
121
  list.first
122
122
  end
123
123
 
124
+ def addvar(vars, hash)
125
+ hash.each_pair do |k, v|
126
+ vars[k.to_s] = v
127
+ vars[k.to_sym] = v
128
+ end
129
+ vars
130
+ end
@@ -2,7 +2,7 @@ if ! defined?(LIVE)
2
2
 
3
3
  require 'livetext'
4
4
 
5
- LIVE = Livetext.new
5
+ LIVE = "defined"
6
6
  LEXT = ".lt3"
7
7
 
8
8
  def newer?(f1, f2)
@@ -39,6 +39,7 @@ def preprocess(cwd: Dir.pwd, src:,
39
39
  STDERR.puts "#{sp} in: #{Dir.pwd}"
40
40
  STDERR.puts "#{sp} from: #{caller[0]}"
41
41
  STDERR.puts "#{sp} copy: #{copy}" if copy
42
+ STDERR.puts "#{sp} vars: #{vars.inspect}" unless vars == {}
42
43
  end
43
44
  stale = stale?(src, dst, deps, force)
44
45
  if stale
@@ -625,6 +625,7 @@ class RuneBlog
625
625
  nslug = fname.sub(/.lt3$/, "") # 0001-this-is-a-post
626
626
  aslug = nslug.sub(/\d\d\d\d-/, "") # this-is-a-post
627
627
  pnum = nslug[0..3] # 0001
628
+ hash = {}
628
629
  Dir.chdir(pdraft) do
629
630
  excerpt = File.read("teaser.txt")
630
631
  meta = read_metadata
@@ -633,29 +634,12 @@ class RuneBlog
633
634
  title = meta.title
634
635
  tags = meta.tags
635
636
  # FIXME simplify
636
- vars = <<~LIVE
637
- .set post.num = #{pnum}
638
- .heredoc post.aslug
639
- #{aslug}
640
- .end
641
- .heredoc post.date
642
- #{date}
643
- .end
644
- .heredoc title
645
- #{title.chomp}
646
- .end
647
- .heredoc post.tags
648
- #{tags.join(" ")}
649
- .end
650
- .heredoc teaser
651
- #{excerpt.chomp}
652
- .end
653
- .heredoc longdate
654
- #{longdate}
655
- .end
656
- LIVE
657
- File.open(pdraft/"vars.lt3", "w") {|f| f.puts vars }
637
+ addvar(hash, "post.num" => pnum, "post.aslug" => aslug,
638
+ "post.date" => date, title: title.chomp,
639
+ "post.tags" => tags.join(" "), teaser: excerpt.chomp,
640
+ longdate: longdate)
658
641
  end
642
+ hash
659
643
  rescue => err
660
644
  _tmp_error(err)
661
645
  end
@@ -681,8 +665,6 @@ class RuneBlog
681
665
 
682
666
  def _handle_post(draft, view_name = self.view.to_s)
683
667
  log!(enter: __method__, args: [draft, view_name], level: 2)
684
- # break into separate methods?
685
-
686
668
  return unless _check_view?(view_name)
687
669
 
688
670
  fname = File.basename(draft) # 0001-this-is-a-post.lt3
@@ -693,22 +675,16 @@ class RuneBlog
693
675
  remote = @root/:views/view_name/:remote
694
676
  @theme = @root/:views/view_name/:themes/:standard
695
677
 
696
- # Step 1...
697
- create_dirs(pdraft)
698
- # FIXME dependencies?
699
- preprocess cwd: pdraft, src: draft, dst: "guts.html",
700
- mix: "liveblog" # , debug: true
701
- _post_metadata(draft, pdraft)
702
- # Step 2...
703
- vposts = @root/:views/view_name/:posts
678
+ create_dirs(pdraft) # Step 1...
679
+ preprocess cwd: pdraft, src: draft, # FIXME dependencies?
680
+ dst: "guts.html", mix: "liveblog"
681
+ hash = _post_metadata(draft, pdraft)
682
+ vposts = @root/:views/view_name/:posts # Step 2...
704
683
  copy!(pdraft, vposts) # ??
705
- # Step 3..
706
- copy(pdraft/"guts.html", @theme/:post)
707
- copy(pdraft/"vars.lt3", @theme/:post)
708
- # Step 4...
709
- preprocess cwd: @theme/:post, src: "generate.lt3", force: true,
710
- dst: remote/ahtml, # copy: @theme/:post,
711
- call: ".nopara" # , debug: true
684
+ copy(pdraft/"guts.html", @theme/:post) # Step 3...
685
+ preprocess cwd: @theme/:post, src: "generate.lt3", # Step 4...
686
+ force: true, vars: hash,
687
+ dst: remote/ahtml, call: ".nopara"
712
688
  FileUtils.rm_f(remote/"published")
713
689
  timelog("Generated", remote/"history")
714
690
  copy_widget_html(view_name)
@@ -3,7 +3,7 @@ if !defined?(RuneBlog::Path)
3
3
  # if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
4
4
 
5
5
  class RuneBlog
6
- VERSION = "0.3.15"
6
+ VERSION = "0.3.16"
7
7
 
8
8
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
9
9
  Path = File.dirname(path)
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.15
4
+ version: 0.3.16
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-25 00:00:00.000000000 Z
11
+ date: 2020-01-29 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext