runeblog 0.2.70 → 0.2.71

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: e0d49c8d62c0c29650322fcff89f90294b364bd631ab2c678e6fe79a5db478c3
4
- data.tar.gz: e6c772a8d7cdb0a5032fee2a3ed09179a1eb6acc60278c443e40b96e8cb8d7f2
3
+ metadata.gz: a760647775e3857ec07a63defdbb5a32a9d9ff2120b3f53b3c13d46ad37defb2
4
+ data.tar.gz: 27114990eebf8a5221beef06396f86e0e744e2f1df8323b803a874157fdf4da1
5
5
  SHA512:
6
- metadata.gz: ecaacf45f6a89e49204df2ca539f17bd1635cf9cd346d2212c73de6e35aa459cbde02dfb6a1376b491e9290730af11e962e7f5c120b4d7f23cc8aa36f2a08fe9
7
- data.tar.gz: c14a8482023fa93f8efa06d1f728f8d314028176f1ea003191a547a5795338fc6e4c4e232d0109e165dadf0ce50c329847d166e83d1dadba4d8d9d15f4680120
6
+ metadata.gz: 209520abd4238593d2e21e3d5ac253b4074836ed96c88cc4b994d4fc8010ddb5f0dd29f86c4a53586f06da68a0cb75d3091610c81c311482326507072a7754dc
7
+ data.tar.gz: a93b099787b73569dcfa1fe8b2dd9d55cada404333586238ed9c749007d2ced9898740e2c3f5ff6cc810a3290d68d40df88a0989902752bf8666b097d1e544ae
data/bin/blog CHANGED
@@ -94,7 +94,7 @@ STDERR.reopen(errfile)
94
94
 
95
95
  # read a .rubytext file here?? Call it something else?
96
96
  home = ENV['HOME']
97
- @fg, @bg = try_read_config("#{home}/.rubytext", fg: Blue, bg: White)
97
+ @fg, @bg = Blue, White ## FIXME!! try_read_config("#{home}/.rubytext", fg: Blue, bg: White)
98
98
  @fg = @fg.downcase.to_sym
99
99
  @bg = @bg.downcase.to_sym
100
100
 
File without changes
data/lib/helpers-blog.rb CHANGED
@@ -1,7 +1,7 @@
1
1
  require 'runeblog_version'
2
2
  require 'fileutils'
3
3
 
4
- require 'pathmagic'
4
+ #require 'pathmagic'
5
5
  require 'xlate'
6
6
 
7
7
  module RuneBlog::Helpers
@@ -32,7 +32,7 @@ module RuneBlog::Helpers
32
32
  log!(enter: __method__, level: 3)
33
33
  @editor = File.read("data/EDITOR").chomp
34
34
  @current_view = File.read("data/VIEW").chomp
35
- @root = File.read("data/EDITOR").chomp
35
+ @root = File.read(".blogs/data/ROOT").chomp
36
36
  rescue => err
37
37
  puts "Can't read config: #{err}"
38
38
  puts err.backtrace.join("\n")
data/lib/liveblog.rb CHANGED
@@ -4,14 +4,14 @@ require 'date'
4
4
  require 'find'
5
5
 
6
6
  require 'runeblog'
7
- require 'pathmagic'
7
+ # require 'pathmagic'
8
8
  require 'xlate'
9
9
 
10
10
 
11
11
  def init_liveblog # FIXME - a lot of this logic sucks
12
12
  here = Dir.pwd
13
13
  dir = here
14
- loop { dir = Dir.pwd; break if File.exist?("data/ROOT"); Dir.chdir("..") }
14
+ # loop { dir = Dir.pwd; break if File.exist?("data/ROOT"); Dir.chdir("..") }
15
15
  Dir.chdir(here) # here??? or dir??
16
16
  @blog = RuneBlog.new(dir)
17
17
  @root = @blog.root
@@ -443,10 +443,14 @@ rescue => err
443
443
  end
444
444
 
445
445
  def write_post
446
+ STDERR.puts :wp1
446
447
  raise "'post' was not called" unless @meta
448
+ STDERR.puts :wp2
447
449
  @meta.views = @meta.views.join(" ") if @meta.views.is_a? Array
448
450
  @meta.tags = @meta.tags.join(" ") if @meta.tags.is_a? Array
451
+ STDERR.puts :wp3
449
452
  _write_metadata
453
+ STDERR.puts :wp4
450
454
  rescue => err
451
455
  puts "err = #{err}"
452
456
  puts err.backtrace.join("\n")
@@ -467,13 +471,19 @@ def teaser
467
471
  end
468
472
 
469
473
  def finalize
474
+ STDERR.puts :final1
470
475
  return unless @meta
476
+ STDERR.puts :final2
471
477
  return @meta if @blog.nil?
478
+ STDERR.puts :final3
472
479
 
473
480
  @slug = @blog.make_slug(@meta)
481
+ STDERR.puts :final4
474
482
  slug_dir = @slug
475
483
  @postdir = @blog.view.dir/:posts/slug_dir
484
+ STDERR.puts :final5
476
485
  write_post
486
+ STDERR.puts :final6
477
487
  @meta
478
488
  end
479
489
 
data/lib/post.rb CHANGED
@@ -1,6 +1,6 @@
1
1
  require 'runeblog'
2
2
  require 'global'
3
- require 'pathmagic'
3
+ # require 'pathmagic'
4
4
 
5
5
  class RuneBlog::Post
6
6
 
@@ -42,7 +42,9 @@ puts "-- load: opening #{pdir}"
42
42
  fname2 = "metadata.txt"
43
43
  hash = meta.to_h
44
44
 
45
+ p :wmd1
45
46
  File.write("teaser.txt", hash[:teaser])
47
+ p :wmd2
46
48
  hash.delete(:teaser)
47
49
  hash.delete(:body)
48
50
 
@@ -106,9 +108,14 @@ puts "-- load: opening #{pdir}"
106
108
  def build
107
109
  log!(enter: __method__)
108
110
  post = self
111
+ p :bld1
109
112
  views = post.meta.views
113
+ p :bld2
110
114
  text = File.read(@draft)
115
+ p :bld3
116
+ p @draft
111
117
  @blog.generate_post(@draft)
118
+ p :bld4
112
119
  end
113
120
  end
114
121
 
data/lib/runeblog.rb CHANGED
@@ -12,7 +12,7 @@ require 'view'
12
12
  require 'publish'
13
13
  require 'post'
14
14
 
15
- require 'pathmagic'
15
+ # require 'pathmagic'
16
16
 
17
17
  ###
18
18
 
@@ -64,6 +64,7 @@ class RuneBlog
64
64
  Dir.chdir(root) do
65
65
  create_dirs(:data, :drafts, :views, :posts)
66
66
  copy_data(:config, "./data/")
67
+ File.write("data/ROOT", Dir.pwd + "\n")
67
68
  new_sequence
68
69
  end
69
70
  @blog = self.new(root)
@@ -90,10 +91,12 @@ class RuneBlog
90
91
 
91
92
  @root = root_dir
92
93
  read_config
93
- md = Dir.pwd.match(%r[.*/views/(.*?)/])
94
- @view_name = md[1] if md
95
94
  @views = get_views
96
- @view = str2view(@view_name)
95
+ md = Dir.pwd.match(%r[.*/views/(.*?)/])
96
+ if md
97
+ @view_name = md[1]
98
+ @view = str2view(@view_name)
99
+ end
97
100
  @sequence = get_sequence
98
101
  @post_views = []
99
102
  @post_tags = []
@@ -373,7 +376,7 @@ class RuneBlog
373
376
  text << entry
374
377
  end
375
378
  text << "</body></html>"
376
- File.write(@vdir/:remote/file, text)
379
+ File.write(@vdir/:remote/file, text + "\n")
377
380
  return posts.size
378
381
  rescue => err
379
382
  _tmp_error(err)
@@ -385,10 +388,15 @@ class RuneBlog
385
388
  meta = nil
386
389
  views = views + [self.view.to_s]
387
390
  views.uniq!
391
+ p :cnp1
388
392
  Dir.chdir(@root/"posts") do
393
+ p :cnp2
389
394
  post = Post.create(title: title, teaser: teaser, body: body, pubdate: pubdate, views: views)
395
+ p :cnp3
390
396
  post.edit unless testing
397
+ p :cnp4
391
398
  post.build
399
+ p :cnp5
392
400
  meta = post.meta
393
401
  end
394
402
  return meta.num
@@ -416,7 +424,7 @@ class RuneBlog
416
424
  log!(enter: __method__, args: [view], level: 3)
417
425
  raise ArgumentError unless view.is_a?(String) || view.is_a?(RuneBlog::View)
418
426
  x = OpenStruct.new
419
- File.write(@root/"data/VIEW", view.to_s)
427
+ File.write(@root/"data/VIEW", view.to_s + "\n")
420
428
  self.view = view # error checking?
421
429
  end
422
430
 
@@ -479,16 +487,24 @@ class RuneBlog
479
487
  def _post_metadata(draft, pdraft)
480
488
  log!(enter: __method__, args: [draft, pdraft], level: 2)
481
489
  # FIXME store this somewhere
490
+ p :pm1
482
491
  fname = File.basename(draft) # 0001-this-is-a-post.lt3
483
492
  nslug = fname.sub(/.lt3$/, "") # 0001-this-is-a-post
484
493
  aslug = nslug.sub(/\d\d\d\d-/, "") # this-is-a-post
485
494
  pnum = nslug[0..3] # 0001
495
+ p :pm2
486
496
  Dir.chdir(pdraft) do
497
+ p :pm3
487
498
  excerpt = File.read("teaser.txt")
499
+ p :pm4
488
500
  date = _retrieve_metadata(:date)
501
+ p :pm5
489
502
  longdate = ::Date.parse(date).strftime("%B %e, %Y")
503
+ p :pm6
490
504
  title = _retrieve_metadata(:title)
505
+ p :pm7
491
506
  tags = _retrieve_metadata(:tags)
507
+ p :pm8
492
508
  # FIXME simplify
493
509
  vars = <<~LIVE
494
510
  .set post.num = #{pnum}
@@ -508,7 +524,9 @@ class RuneBlog
508
524
  #{longdate}
509
525
  .end
510
526
  LIVE
527
+ p :pm9
511
528
  File.open(pdraft/"vars.lt3", "w") {|f| f.puts vars }
529
+ p :pma
512
530
  end
513
531
  rescue => err
514
532
  _tmp_error(err)
@@ -544,39 +562,54 @@ class RuneBlog
544
562
  pdraft = @root/:posts/nslug
545
563
  remote = @root/:views/view_name/:remote
546
564
  @theme = @root/:views/view_name/:themes/:standard
565
+ p :hp1
547
566
  # Step 1...
548
567
  create_dirs(pdraft)
568
+ p :hp2
549
569
  # FIXME dependencies?
550
570
  xlate cwd: pdraft, src: draft, dst: "guts.html" # , debug: true
571
+ p :hp3
551
572
  _post_metadata(draft, pdraft)
573
+ p :hp4
552
574
  # Step 2...
553
575
  vposts = @root/:views/view_name/:posts
554
576
  copy!(pdraft, vposts) # ??
577
+ p :hp5
555
578
  # Step 3..
556
579
  copy(pdraft/"guts.html", @theme/:post)
557
580
  copy(pdraft/"vars.lt3", @theme/:post)
581
+ p :hp5
558
582
  # Step 4...
559
583
  # FIXME dependencies?
560
584
  xlate cwd: @theme/:post, src: "generate.lt3", force: true,
561
585
  dst: remote/ahtml, copy: @theme/:post # , debug: true
586
+ p :hp7
562
587
  # FIXME dependencies?
563
588
  xlate cwd: @theme/:post, src: "permalink.lt3",
564
589
  dst: remote/:permalink/ahtml # , debug: true
590
+ p :hp8
565
591
  copy_widget_html(view_name)
592
+ p :hp9
566
593
  rescue => err
567
594
  _tmp_error(err)
568
595
  end
569
596
 
570
597
  def generate_post(draft)
571
598
  log!(enter: __method__, args: [draft], level: 1)
599
+ p :gp1
572
600
  views = _get_views(draft)
601
+ p :gp2
573
602
  views.each do |view|
603
+ p :gp3
574
604
  unless self.view?(view)
575
605
  puts "Warning: '#{view}' is not a view"
576
606
  next
577
607
  end
608
+ p :gp4
578
609
  _handle_post(draft, view)
610
+ p :gp5
579
611
  end
612
+ p :gp6
580
613
  rescue => err
581
614
  _tmp_error(err)
582
615
  end
@@ -1,8 +1,10 @@
1
1
 
2
+ require 'pathmagic'
3
+
2
4
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
5
 
4
6
  class RuneBlog
5
- VERSION = "0.2.70"
7
+ VERSION = "0.2.71"
6
8
 
7
9
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
10
  Path = File.dirname(path)
data/test/austin.rb CHANGED
@@ -85,66 +85,66 @@ EXCERPT
85
85
  That's a good thing. But their music isn't always the greatest.
86
86
  BODY
87
87
 
88
- make_post(x, "The new amphitheatre is overrated", <<-EXCERPT, <<-BODY)
89
- It used to be that all major concerts played the Erwin Center.
90
- EXCERPT
91
- .pin around_austin
92
- Now, depending on what you consider "major," blah blah blah...
93
- BODY
94
-
95
- make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
96
- RIP, Hope Gallery
97
- EXCERPT
98
-
99
- .dropcap It's been a while since I was there. They say it was torn down
100
- while I wasn't looking. Never tagged anything there, of course, nor
101
- anywhere else. Spraypainting public places isn't my thing, but in this
102
- case I condoned it because it was sort of there for that purpose.
103
-
104
- This fake entry is a long one so as to demonstrate both drop-caps
105
- (above) and an inset quote. Blah blah blah. Lorem ipsum dolor and
106
- a partridge in a pear tree.
107
-
108
- .inset left 20
109
- Wherever you go, there you are. Last night I saw upon the stair
110
- a little man who was not there. He wasn't there again today; I
111
- wish, I wish he'd go away. As far as we know, our computer has
112
- never had an undetected error.
113
- |On a clean disk, you can seek forever.
114
- And never let it be denied that
115
- pobbles are happier without their toes. And may your snark never
116
- be a boojum. How do you know you aren't dreaming right now? When
117
- you see a butterfly, think of Chuang Tzu.
118
- .end
119
-
120
- Contact light. Houston, this is Tranquility Base. The Eagle has
121
- landed. That's one small step for (a) man, one giant leap for
122
- mankind.
123
-
124
- Here's the PDF of $$link["Ruby for the Old-Time C Programmer"|http://rubyhacker.com/blog2/rubydino.pdf]
125
-
126
- Pity this busy monster, manunkind, not. Pity rather... Listen:
127
- There's a hell of a universe next door; let's go.
128
- BODY
129
-
130
- make_post(x, "The Waller Creek project", <<-EXCERPT, <<-BODY)
131
- Will it ever be finished?
132
- EXCERPT
133
- Blah blah Waller Creek blah blah...
134
- BODY
135
-
136
- make_post(x, "Life on Sabine Street", <<-EXCERPT, <<-BODY)
137
- It's like Pooh Corner, except not.
138
- EXCERPT
139
- This is about Sabine St, blah blah lorem ipsum dolor...
140
- BODY
141
-
142
- make_post(x, "Remember Modest Mouse?", <<-EXCERPT, <<-BODY)
143
- They date to the 90s or before.
144
- EXCERPT
145
- But I first heard of them
146
- in 2005.
147
- BODY
88
+ # make_post(x, "The new amphitheatre is overrated", <<-EXCERPT, <<-BODY)
89
+ # It used to be that all major concerts played the Erwin Center.
90
+ # EXCERPT
91
+ # .pin around_austin
92
+ # Now, depending on what you consider "major," blah blah blah...
93
+ # BODY
94
+ #
95
+ # make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
96
+ # RIP, Hope Gallery
97
+ # EXCERPT
98
+ #
99
+ # .dropcap It's been a while since I was there. They say it was torn down
100
+ # while I wasn't looking. Never tagged anything there, of course, nor
101
+ # anywhere else. Spraypainting public places isn't my thing, but in this
102
+ # case I condoned it because it was sort of there for that purpose.
103
+ #
104
+ # This fake entry is a long one so as to demonstrate both drop-caps
105
+ # (above) and an inset quote. Blah blah blah. Lorem ipsum dolor and
106
+ # a partridge in a pear tree.
107
+ #
108
+ # .inset left 20
109
+ # Wherever you go, there you are. Last night I saw upon the stair
110
+ # a little man who was not there. He wasn't there again today; I
111
+ # wish, I wish he'd go away. As far as we know, our computer has
112
+ # never had an undetected error.
113
+ # |On a clean disk, you can seek forever.
114
+ # And never let it be denied that
115
+ # pobbles are happier without their toes. And may your snark never
116
+ # be a boojum. How do you know you aren't dreaming right now? When
117
+ # you see a butterfly, think of Chuang Tzu.
118
+ # .end
119
+ #
120
+ # Contact light. Houston, this is Tranquility Base. The Eagle has
121
+ # landed. That's one small step for (a) man, one giant leap for
122
+ # mankind.
123
+ #
124
+ # Here's the PDF of $$link["Ruby for the Old-Time C Programmer"|http://rubyhacker.com/blog2/rubydino.pdf]
125
+ #
126
+ # Pity this busy monster, manunkind, not. Pity rather... Listen:
127
+ # There's a hell of a universe next door; let's go.
128
+ # BODY
129
+ #
130
+ # make_post(x, "The Waller Creek project", <<-EXCERPT, <<-BODY)
131
+ # Will it ever be finished?
132
+ # EXCERPT
133
+ # Blah blah Waller Creek blah blah...
134
+ # BODY
135
+ #
136
+ # make_post(x, "Life on Sabine Street", <<-EXCERPT, <<-BODY)
137
+ # It's like Pooh Corner, except not.
138
+ # EXCERPT
139
+ # This is about Sabine St, blah blah lorem ipsum dolor...
140
+ # BODY
141
+ #
142
+ # make_post(x, "Remember Modest Mouse?", <<-EXCERPT, <<-BODY)
143
+ # They date to the 90s or before.
144
+ # EXCERPT
145
+ # But I first heard of them
146
+ # in 2005.
147
+ # BODY
148
148
 
149
149
  debug
150
150
  debug "** generate_index #{bold("around_austin")}"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.70
4
+ version: 0.2.71
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
@@ -77,7 +77,7 @@ files:
77
77
  - bin/blog
78
78
  - bin/mkwidget
79
79
  - data/EDITOR
80
- - data/ROOT
80
+ - data/ROOT.txt
81
81
  - data/VIEW
82
82
  - empty_view/assets/austin-pano.jpg
83
83
  - empty_view/assets/sky2.jpg