runeblog 0.2.14 → 0.2.15

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: 50083dc0e216b8b22a30023aec14382c066ec694fdbf42e7b815ab1e569151dd
4
- data.tar.gz: fe184284c8dcbdffe9c8145bce826bf0a062d8bfc5634ee55a4a5dd0a713af64
3
+ metadata.gz: e1ecf6f4cbaffb7d77bd5669b64be6f790db0f8cd59b6c7f8a7d1385685b35df
4
+ data.tar.gz: ef364507a3a26dc3c53167b430c8261e9fd4fd244e44978810ff64a960645a96
5
5
  SHA512:
6
- metadata.gz: 19d75028ffe62cf915c7a3dd132d36f999f5e6ae84950e99c5ddb23bde23093674cb9154d59247eb7d302fbdf630dfd0baf3513ca59ea4d02613e21e25577c4a
7
- data.tar.gz: 8e1c58ad7a920faba723802c3b95d15238f1b5f88230f80b7ce86489c85f5d53fa6386d8febd1436120401cfb1a2a3a5cdad81108b3aec33854a741b1751be6a
6
+ metadata.gz: 917b2921787dfdf80eeda5dd4fa02dbca23b7f96798d07328cfa5809c226f2cb5db5c7c08c31eab6cdc40216c67766340951f08b6b007de28a195bb280093363
7
+ data.tar.gz: 1e64d1d1746b7d9939845f2da30da8ad5e70173307d37fcabb22a147d0a1aba9e1098613fe5e082593f3f4033a74ffe8d27a0b3607f7667322a8d949a26e3427
Binary file
@@ -19,7 +19,7 @@ def init_liveblog # FIXME - a lot of this logic sucks
19
19
  @view_name = @blog.view.name
20
20
  @vdir = @blog.view.dir
21
21
  @version = RuneBlog::VERSION
22
- @theme = @vdir + "/themes/standard/"
22
+ @theme = @vdir/:themes/:standard
23
23
  end
24
24
 
25
25
  # FIXME - stale? and livetext are duplicated from helpers-blog
@@ -117,11 +117,12 @@ 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 = "widgets/#{tag}/" # FIXME ???
120
+ top = :widgets/tag # FIXME ???
121
121
  pairs.each do |file, title|
122
+ # took out #{top}#{file}
122
123
  f.puts <<-EOS
123
124
  <li class="list-group-item"> <a href="javascript: void(0)"
124
- onclick="javascript:open_main('#{top}#{file}')">#{title}</a> </li>
125
+ onclick="javascript:open_main('#{file}')">#{title}</a> </li>
125
126
  EOS
126
127
  end
127
128
  f.puts <<-EOS
@@ -134,12 +135,12 @@ end
134
135
  def _write_main(mainfile, pairs, card_title)
135
136
  # HTML for main area (iframe)
136
137
  log!(str: "Creating #{mainfile}.html", pwd: true)
137
- # TTY.puts "Creating #{mainfile}.html - pwd = #{Dir.pwd}"
138
138
  File.open("#{mainfile}.html", "w") do |f|
139
139
  _html_body(f) do
140
140
  f.puts "<h1>#{card_title}</h1>"
141
141
  pairs.each do |file, title|
142
- f.puts %[<a style="text-decoration: none; font-size: 24px" href="#{file}">#{title}</a> <br>]
142
+ main = _main(file)
143
+ f.puts %[<a style="text-decoration: none; font-size: 24px" #{main}>#{title}</a> <br>]
143
144
  end
144
145
  end
145
146
  end
@@ -229,7 +230,7 @@ end
229
230
  def image # primitive so far
230
231
  _debug "img: huh? <img src=#{_args.first}></img>"
231
232
  fname = _args.first
232
- path = "assets/#{fname}"
233
+ path = :assets/fname
233
234
  _out "<img src=#{path}></img>"
234
235
  _optional_blank_line
235
236
  end
@@ -298,7 +299,7 @@ STDERR.puts :cp6
298
299
  @slug = @blog.make_slug(@meta)
299
300
  STDERR.puts :cp7
300
301
  slug_dir = @slug
301
- @postdir = @blog.view.dir + "/posts/#{slug_dir}"
302
+ @postdir = @blog.view.dir/:posts/slug_dir
302
303
  STDERR.puts "--- finalize: pwd = #{Dir.pwd} postdir = #@postdir"
303
304
  STDERR.puts :cp8
304
305
  write_post
@@ -446,7 +447,7 @@ def sidebar
446
447
  _out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
447
448
  _args do |token|
448
449
  tag = token.chomp.strip.downcase
449
- wtag = "widgets/#{tag}"
450
+ wtag = :widgets/tag
450
451
  raise "Can't find #{wtag}" unless Dir.exist?(wtag)
451
452
  Dir.chdir(wtag) do
452
453
  tcard = "#{tag}-card.html"
@@ -515,8 +516,8 @@ def _post_lookup(postid) # side-effect
515
516
  # .. = templates, ../.. = views/thisview
516
517
  slug = title = date = teaser_text = nil
517
518
 
518
- dir_posts = @vdir + "/posts"
519
- posts = Dir.entries(dir_posts).grep(/^\d\d\d\d/).map {|x| dir_posts + "/" + x }
519
+ dir_posts = @vdir/:posts
520
+ posts = Dir.entries(dir_posts).grep(/^\d\d\d\d/).map {|x| dir_posts/x }
520
521
  posts.select! {|x| File.directory?(x) }
521
522
 
522
523
  post = posts.select {|x| File.basename(x).to_i == postid }
@@ -673,7 +674,7 @@ def navbar
673
674
  first = false
674
675
  _out %[<li class="nav-item active"> <a class="nav-link" href="#{href}">#{cdata}<span class="sr-only">(current)</span></a> </li>]
675
676
  else
676
- main = _main("navbar/#{href}")
677
+ main = _main(:navbar/href)
677
678
  _out %[<li class="nav-item"> <a class="nav-link" #{main}>#{cdata}</a> </li>]
678
679
  end
679
680
  end
@@ -0,0 +1,14 @@
1
+ module PathSep
2
+ def /(right)
3
+ s1 = self.to_s.dup
4
+ s2 = right.to_s.dup
5
+ s1 << "/" unless s2.end_with?("/") || s2.start_with?("/")
6
+ path = s1 + s2
7
+ path.gsub!("//", "/")
8
+ path
9
+ end
10
+ end
11
+
12
+ String.include(PathSep)
13
+ Symbol.include(PathSep)
14
+
@@ -10,23 +10,25 @@ require 'view'
10
10
  require 'publish'
11
11
  require 'post'
12
12
 
13
+ require 'pathmagic'
14
+
13
15
  ###
14
16
 
15
17
  class RuneBlog
16
18
 
17
19
  DotDir = ".blogs"
18
20
  ConfigFile = "config"
19
- Themes = RuneBlog::Path + "/../themes"
21
+ Themes = RuneBlog::Path/"../themes"
20
22
 
21
- make_exception(:FileNotFound, "File $1 was not found")
23
+ make_exception(:FileNotFound, "File $1 was not found")
22
24
  make_exception(:BlogRepoAlreadyExists, "Blog repo $1 already exists")
23
- make_exception(:CantAssignView, "$1 is not a view")
24
- make_exception(:ViewAlreadyExists, "View $1 already exists")
25
- make_exception(:DirAlreadyExists, "Directory $1 already exists")
26
- make_exception(:CantCreateDir, "Can't create directory $1")
27
- make_exception(:EditorProblem, "Could not edit $1")
28
- make_exception(:NoSuchView, "No such view: $1")
29
- make_exception(:NoBlogAccessor, "Runeblog.blog is not set")
25
+ make_exception(:CantAssignView, "$1 is not a view")
26
+ make_exception(:ViewAlreadyExists, "View $1 already exists")
27
+ make_exception(:DirAlreadyExists, "Directory $1 already exists")
28
+ make_exception(:CantCreateDir, "Can't create directory $1")
29
+ make_exception(:EditorProblem, "Could not edit $1")
30
+ make_exception(:NoSuchView, "No such view: $1")
31
+ make_exception(:NoBlogAccessor, "Runeblog.blog is not set")
30
32
 
31
33
  class << self
32
34
  attr_accessor :blog
@@ -43,7 +45,7 @@ class RuneBlog
43
45
  def self.create_new_blog_repo(dir = ".blogs")
44
46
  log!(enter: __method__, args: [dir])
45
47
  raise ArgumentError unless dir.is_a?(String) && ! dir.empty?
46
- root_dir = Dir.pwd + "/" + dir
48
+ root_dir = Dir.pwd/dir
47
49
  self.create(dir)
48
50
  rescue => err
49
51
  puts "Can't create blog repo: '#{dir}' - #{err}"
@@ -55,7 +57,7 @@ class RuneBlog
55
57
  # Crude - FIXME later - # What views are there? Publishing, etc.
56
58
  self.blog = self # Weird. Like a singleton - dumbass circular dependency?
57
59
  $_blog = self # Dumber still?
58
- root = Dir.pwd + "/" + root
60
+ root = Dir.pwd/root
59
61
  raise BlogRepoAlreadyExists if Dir.exist?(root)
60
62
  create_dirs(root)
61
63
  Dir.chdir(root) do
@@ -74,7 +76,7 @@ class RuneBlog
74
76
  # Crude - FIXME later - # What views are there? Publishing, etc.
75
77
  self.blog = self # Weird. Like a singleton - dumbass circular dependency?
76
78
  $_blog = self # Dumber still?
77
- root = Dir.pwd + "/" + root
79
+ root = Dir.pwd/root
78
80
  blog = self.new(root)
79
81
  end
80
82
 
@@ -85,7 +87,7 @@ class RuneBlog
85
87
  $_blog = self # Dumber still?
86
88
 
87
89
  @root = root_dir
88
- file = @root + "/" + ConfigFile
90
+ file = @root/ConfigFile
89
91
  errmsg = "No config file! file = #{file.inspect} dir = #{Dir.pwd}"
90
92
  raise errmsg unless File.exist?(file)
91
93
 
@@ -110,7 +112,7 @@ class RuneBlog
110
112
  def process_post(sourcefile)
111
113
  log!(enter: __method__, args: [dir])
112
114
  nslug = sourcefile.sub(/.lt3/, "")
113
- dir = @root + "/posts/#{nslug}"
115
+ dir = @root/:posts/nslug
114
116
  create_dir(dir)
115
117
  xlate cwd: dir, src: sourcefile, debug: true
116
118
  _deploy_local(dir)
@@ -147,7 +149,7 @@ class RuneBlog
147
149
 
148
150
  def _set_publisher
149
151
  log!(enter: __method__)
150
- file = @view.dir + "/publish"
152
+ file = @view.dir/:publish
151
153
  @view.publisher = nil
152
154
  return unless File.exist?(file)
153
155
  @view.publisher = RuneBlog::Publishing.new(read_config(file))
@@ -171,13 +173,13 @@ class RuneBlog
171
173
 
172
174
  def get_sequence
173
175
  log!(enter: __method__)
174
- File.read(root + "/sequence").to_i
176
+ File.read(@root/:sequence).to_i
175
177
  end
176
178
 
177
179
  def next_sequence
178
180
  log!(enter: __method__)
179
181
  @sequence += 1
180
- dump(@sequence, "#@root/sequence")
182
+ dump(@sequence, @root/:sequence)
181
183
  @sequence
182
184
  end
183
185
 
@@ -186,21 +188,21 @@ class RuneBlog
186
188
  v = str2view(v) if v.is_a?(String)
187
189
  raise ArgumentError unless v.nil? || v.is_a?(RuneBlog::View)
188
190
  v ||= @view
189
- @root + "/views/#{v}/"
191
+ return @root/:views/v
190
192
  end
191
193
 
192
194
  def self.exist?
193
195
  log!(enter: __method__)
194
- Dir.exist?(DotDir) && File.exist?(DotDir + "/" + ConfigFile)
196
+ Dir.exist?(DotDir) && File.exist?(DotDir/ConfigFile)
195
197
  end
196
198
 
197
199
  def make_dummy_publish_file(view_name)
198
200
  log!(enter: __method__, args: [view_name])
199
- vdir = "#@root/views/#{view_name}"
201
+ vdir = @root/:views/view_name
200
202
  pub = [:user, :server, :docroot, :path, :proto]
201
203
  pub = pub.map {|x| x.to_s + ": undefined" }
202
204
  pub = pub.join("\n") + "\n"
203
- dump(pub, "#{vdir}/publish")
205
+ dump(pub, vdir/:publish)
204
206
  end
205
207
 
206
208
  def mark_last_published(str)
@@ -233,7 +235,7 @@ class RuneBlog
233
235
  names = self.views.map(&:to_s)
234
236
  bad = names.include?(view_name)
235
237
  raise ViewAlreadyExists(view_name) if bad
236
- vdir = "@root/views/#{view_name}"
238
+ vdir = @root/:views/view_name
237
239
  raise DirAlreadyExists(view_name) if Dir.exist?(vdir)
238
240
  return true # hm?
239
241
  end
@@ -242,8 +244,6 @@ class RuneBlog
242
244
  log!(enter: __method__, args: [view_name])
243
245
  check_valid_new_view(view_name)
244
246
  make_empty_view_tree(view_name)
245
- # xlate cwd: "#@root/views/#{view_name}/themes/standard/blog",
246
- # src: "generate", dst: "../../../remote/index"
247
247
  make_dummy_publish_file(view_name)
248
248
  mark_last_published("Initial creation")
249
249
  add_view(view_name)
@@ -253,7 +253,8 @@ class RuneBlog
253
253
  log!(enter: __method__, args: [name, force])
254
254
  raise ArgumentError unless name.is_a?(String) && ! name.empty?
255
255
  if force
256
- system("rm -rf #@root/views/#{name}")
256
+ vname = @root/:views/name
257
+ system("rm -rf #{vname}")
257
258
  @views -= [str2view(name)]
258
259
  end
259
260
  end
@@ -261,18 +262,17 @@ class RuneBlog
261
262
  def view_files
262
263
  log!(enter: __method__)
263
264
  vdir = self.view.dir
264
- files = ["#{vdir}/index.html"]
265
- files += posts.map {|x| "#{vdir}/#{x}" }
266
- # Huh?
267
- files.reject! {|f| File.mtime(f) < File.mtime("#{vdir}/last_published") }
265
+ files = [vdir/"index.html"]
266
+ files += posts.map {|x| vdir/x }
267
+ files.reject! {|f| File.mtime(f) < File.mtime(vdir/:last_published) }
268
268
  end
269
269
 
270
270
  def post_lookup(postid) # side-effect?
271
271
  log!(enter: __method__, args: [postid])
272
272
  slug = title = date = teaser_text = nil
273
273
 
274
- dir_posts = @vdir + "/posts"
275
- posts = Dir.entries(dir_posts).grep(/^\d\d\d\d/).map {|x| dir_posts + "/" + x }
274
+ dir_posts = @vdir/:posts
275
+ posts = Dir.entries(dir_posts).grep(/^\d\d\d\d/).map {|x| dir_posts/x }
276
276
  posts.select! {|x| File.directory?(x) }
277
277
 
278
278
  post = posts.select {|x| File.basename(x).to_i == postid }
@@ -286,13 +286,13 @@ class RuneBlog
286
286
  log!(enter: __method__, args: [slug])
287
287
  id = slug.to_i
288
288
  text = nil
289
- post_entry_name = @theme + "/blog/post_entry.lt3"
289
+ post_entry_name = @theme/"blog/post_entry.lt3"
290
290
  @_post_entry ||= File.read(post_entry_name)
291
291
  vp = post_lookup(id)
292
292
  nslug, aslug, title, date, teaser_text =
293
293
  vp.nslug, vp.aslug, vp.title, vp.date, vp.teaser_text
294
294
  path = vp.path
295
- url = "#{aslug}.html" # Should be relative to .blogs!! FIXME
295
+ url = aslug + ".html"
296
296
  date = ::Date.parse(date)
297
297
  date = date.strftime("%B %e<br>%Y")
298
298
  text = interpolate(@_post_entry, binding)
@@ -302,9 +302,9 @@ class RuneBlog
302
302
  def collect_recent_posts(file)
303
303
  log!(enter: __method__, args: [file])
304
304
  posts = nil
305
- dir_posts = @vdir + "/posts"
305
+ dir_posts = @vdir/:posts
306
306
  entries = Dir.entries(dir_posts)
307
- posts = entries.grep(/^\d\d\d\d/).map {|x| dir_posts + "/" + x }
307
+ posts = entries.grep(/^\d\d\d\d/).map {|x| dir_posts/x }
308
308
  posts.select! {|x| File.directory?(x) }
309
309
  # directories that start with four digits
310
310
  posts = posts.sort {|a, b| b.to_i <=> a.to_i } # sort descending
@@ -314,7 +314,6 @@ class RuneBlog
314
314
  <head><link rel="stylesheet" href="etc/blog.css"></head>
315
315
  <body>
316
316
  HTML
317
- # posts = _find_recent_posts
318
317
  wanted = [5, posts.size].min # estimate how many we want?
319
318
  enum = posts.each
320
319
  wanted.times do
@@ -323,19 +322,19 @@ class RuneBlog
323
322
  text << teaser(postid) # side effect! calls _out
324
323
  end
325
324
  text << "</body></html>"
326
- File.write("#@vdir/remote/"+file, text) # FIXME ???
327
- iframe_text = <<-HTML
328
- <iframe name="main" style="width: 100vw;height: 100vh;position: relative;"
329
- src='recent.html' width=100% frameborder="0" allowfullscreen>
330
- </iframe>
331
- HTML
325
+ File.write(@vdir/:remote/file, text)
326
+ # iframe_text = <<-HTML
327
+ # <iframe name="main" style="width: 100vw;height: 100vh;position: relative;"
328
+ # src='recent.html' width=100% frameborder="0" allowfullscreen>
329
+ # </iframe>
330
+ # HTML
332
331
  # FIXME ^ serves no purpose??
333
332
  end
334
333
 
335
334
  def create_new_post(title, testing = false, teaser: nil, body: nil, other_views: [])
336
335
  log!(enter: __method__, args: [title, testing, teaser, body, other_views])
337
336
  meta = nil
338
- Dir.chdir("#@root/posts/") do
337
+ Dir.chdir(@root/:posts) do
339
338
  post = Post.create(title: title, teaser: teaser, body: body, other_views: other_views)
340
339
  post.edit unless testing
341
340
  post.build
@@ -350,7 +349,7 @@ class RuneBlog
350
349
  def edit_initial_post(file, testing = false)
351
350
  log!(enter: __method__, args: [file, testing])
352
351
  debug "=== edit_initial_post #{file.inspect} => #{sourcefile}"
353
- sourcefile = "#@root/drafts/#{file}"
352
+ sourcefile = @root/:drafts/file
354
353
  result = system("#@editor #{sourcefile} +8") unless testing
355
354
  raise EditorProblem(sourcefile) unless result
356
355
  process_post(sourcefile)
@@ -361,14 +360,14 @@ class RuneBlog
361
360
 
362
361
  def posts
363
362
  log!(enter: __method__)
364
- dir = self.view.dir + "/posts"
363
+ dir = self.view.dir/:posts
365
364
  posts = Dir.entries(dir).grep(/^\d{4}/)
366
365
  posts
367
366
  end
368
367
 
369
368
  def drafts
370
369
  log!(enter: __method__)
371
- dir = "#@root/drafts"
370
+ dir = @root/:drafts
372
371
  drafts = Dir.entries(dir).grep(/^\d{4}.*/)
373
372
  end
374
373
 
@@ -384,16 +383,16 @@ class RuneBlog
384
383
  def generate_index(view) # FIXME delete?
385
384
  log!(enter: __method__, args: [view], pwd: true, dir: true)
386
385
  raise ArgumentError unless view.is_a?(String) || view.is_a?(RuneBlog::View)
387
- @vdir = @root + "/views/#{view}"
386
+ @vdir = @root/:views/view
388
387
  collect_recent_posts("recent.html")
389
388
  end
390
389
 
391
390
  def generate_view(view) # huh?
392
391
  log!(enter: __method__, args: [view])
393
392
  generate_index(view) # recent posts (recent.html)
394
- vdir = "#@root/views/#{view}"
395
- xlate cwd: "#{vdir}/themes/standard",
396
- src: "blog/generate.lt3", dst: "#{vdir}/remote/index.html"
393
+ vdir = @root/:views/view
394
+ xlate cwd: vdir/:themes/:standard,
395
+ src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
397
396
  end
398
397
 
399
398
  def _get_views(draft)
@@ -411,12 +410,12 @@ class RuneBlog
411
410
  log!(enter: __method__, args: [draft, view])
412
411
  fname = File.basename(draft)
413
412
  noext = fname.sub(/.lt3$/, "")
414
- vdir = "#@root/views/#{view}"
415
- dir = "#{vdir}/posts/#{noext}/"
413
+ vdir = @root/:views/view
414
+ dir = vdir/:posts/noext
416
415
  Dir.mkdir(dir) unless Dir.exist?(dir)
417
416
  system("cp #{draft} #{dir}")
418
417
  viewdir, slugdir, aslug = vdir, dir, noext[5..-1]
419
- theme = viewdir + "/themes/standard"
418
+ theme = viewdir/:themes/:standard
420
419
  [noext, viewdir, slugdir, aslug, theme]
421
420
  end
422
421
 
@@ -429,22 +428,21 @@ class RuneBlog
429
428
  excerpt = File.read("teaser.txt")
430
429
  vars = %[.set title="#{title.chomp}"\n] +
431
430
  %[.set teaser="#{excerpt.chomp}"]
432
- File.open("#{pdraft}/vars.lt3", "w") {|f| f.puts vars }
431
+ File.open(pdraft/"vars.lt3", "w") {|f| f.puts vars }
433
432
  end
434
433
  end
435
434
 
436
435
  def copy_widget_html(view)
437
436
  log!(enter: __method__)
438
- vdir = "#@root/views/#{view}"
439
- remote = vdir + "/remote"
440
- wdir = vdir + "/themes/standard/widgets"
441
- widgets = Dir["#{wdir}/*"].select {|w| File.directory?(w) }
437
+ vdir = @root/:views/view
438
+ remote = vdir/:remote
439
+ wdir = vdir/:themes/:standard/:widgets
440
+ widgets = Dir[wdir/"*"].select {|w| File.directory?(w) }
442
441
  widgets.each do |w|
443
442
  dir = File.basename(w)
444
443
  rem = w.sub(/themes.standard/, "remote")
445
444
  create_dirs(rem)
446
- next unless Dir[w+"/*"].any? {|x| x =~ /html$/ }
447
- # STDERR.puts "---- cp #{w}/*html #{rem}"
445
+ next unless Dir[w/"*"].any? {|x| x =~ /html$/ }
448
446
  system("cp #{w}/*html #{rem}")
449
447
  end
450
448
  end
@@ -456,24 +454,24 @@ class RuneBlog
456
454
  nslug = fname.sub(/.lt3$/, "") # 0001-this-is-a-post
457
455
  aslug = nslug.sub(/\d\d\d\d-/, "") # this-is-a-post
458
456
  ahtml = aslug + ".html" # this-is-a-post.html
459
- pdraft = "#@root/posts/#{nslug}"
460
- remote = "#@root/views/#{view}/remote"
461
- @theme = "#@root/views/#{view}/themes/standard"
457
+ pdraft = @root/:posts/nslug
458
+ remote = @root/:views/view/:remote
459
+ @theme = @root/:views/view/:themes/:standard
462
460
  # Step 1...
463
461
  create_dirs(pdraft)
464
462
  xlate cwd: pdraft, src: draft, dst: "guts.html"
465
463
  _post_metadata(draft, pdraft)
466
464
  # Step 2...
467
- vposts = "#@root/views/#{view}/posts/"
465
+ vposts = @root/:views/view/:posts
468
466
  copy!(pdraft, vposts) # ??
469
467
  # Step 3..
470
- copy(pdraft + "/guts.html", "#@theme/post")
471
- copy(pdraft + "/vars.lt3", "#@theme/post")
468
+ copy(pdraft/"guts.html", @theme/:post)
469
+ copy(pdraft/"vars.lt3", @theme/:post)
472
470
  # Step 4...
473
- xlate cwd: "#{@theme}/post", src: "generate.lt3",
474
- dst: "#{remote}/#{ahtml}", copy: "#{@theme}/post"
475
- xlate cwd: "#{@theme}/post", src: "permalink.lt3",
476
- dst: "#{remote}/permalink/#{ahtml}"
471
+ xlate cwd: @theme/:post, src: "generate.lt3",
472
+ dst: remote/ahtml, copy: @theme/:post
473
+ xlate cwd: @theme/:post, src: "permalink.lt3",
474
+ dst: remote/:permalink/ahtml
477
475
  copy_widget_html(view)
478
476
  end
479
477
 
@@ -500,7 +498,7 @@ class RuneBlog
500
498
  self.make_slug(meta)
501
499
  check_meta(meta, "index_entry3")
502
500
  # FIXME clean up and generalize
503
- ref = "#{view}/#{meta.slug}/index.html"
501
+ ref = view/meta.slug/"index.html"
504
502
  <<-HTML
505
503
  <font size=-1>#{meta.date}&nbsp;&nbsp;</font> <br>
506
504
  <font size=+2 color=blue><a href=../#{ref} style="text-decoration: none">#{meta.title}</font></a>
@@ -546,7 +544,7 @@ class RuneBlog
546
544
  def undelete_post(num)
547
545
  log!(enter: __method__, args: [num])
548
546
  raise ArgumentError unless num.is_a?(Integer)
549
- files = Find.find("#@root/views/").to_a
547
+ files = Find.find(@root/:views).to_a
550
548
  tag = prefix(num)
551
549
  list = files.select {|x| File.directory?(x) and x =~ /_#{tag}/ }
552
550
  return nil if list.empty?
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.2.14"
5
+ VERSION = "0.2.15"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -29,7 +29,7 @@ spec = Gem::Specification.new do |s|
29
29
  test = Find.find("test").to_a
30
30
  misc = %w[./README.lt3 ./README.md ./runeblog.gemspec]
31
31
 
32
- system("tar zcvf empty_view.tgz empty_view")
32
+ # system("tar zcvf empty_view.tgz empty_view")
33
33
 
34
34
  s.files = main + misc + test + ["empty_view.tgz"]
35
35
  s.homepage = 'https://github.com/Hal9000/runeblog'
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.14
4
+ version: 0.2.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
@@ -69,6 +69,7 @@ files:
69
69
  - lib/helpers-repl.rb
70
70
  - lib/liveblog.rb
71
71
  - lib/logging.rb
72
+ - lib/pathmagic.rb
72
73
  - lib/post.rb
73
74
  - lib/publish.rb
74
75
  - lib/repl.rb