runeblog 0.3.06 → 0.3.07

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: 70bd6e1889a61c19c606616bcb0a4ace993b9f7cb7c993a9e4c2c41e7f47a7f9
4
- data.tar.gz: c178b2630acfadbeddbbd51dc050bf41cf636372421fdda3b9003991f31c2b26
3
+ metadata.gz: c9c40711649cc90ed5892d256311a01c9841655a1945cc2dcfcc9bd8dd0e77e5
4
+ data.tar.gz: ff3b53cdf4d0f6d7136e31cef2aca74a4843d836d45518909baa082f134ec089
5
5
  SHA512:
6
- metadata.gz: 6c736c15fe20f800cc6393e5ad008983c0cb15eb2e90b1db60ac02361fb3ff65fc526266009d15f9ab1b99324055388bf52c9d487101e2ce6ce3dab1f3b1ba97
7
- data.tar.gz: 7eb2bc828f8969fd15524ec4a010de4ecda475e636dc6fd0b8e4cbc0736def5aaf504db801440059644d1080423807f5abc078e79047d9b19cb8c4b79e336e26
6
+ metadata.gz: 667ae25acb4c5230f9674fc067bbfca36b18562f8bf9f740f066e39621ae3eff9a952309eb28b3ed754c8f4c4acc0cc7a25054db1f7999844c8f49ac6621cb9c
7
+ data.tar.gz: cda360ef27a9733285d4aa0c50f402cd00c385f30f49f40d0fd1d61fc1046aec84dc2b0d8f6bb9e4db018c8f4266eb7381c1e9171ff5096166a7054fda98e8ea
data/bin/blog CHANGED
@@ -25,14 +25,13 @@ end
25
25
  def get_universal
26
26
  univ = "#{@blog.root}/data/universal.lt3"
27
27
  if yesno("Faster initial setup? (no: edit universal.lt3)")
28
- author = ask!(" Author name: ")
29
- site = ask!(" Site/domain: ")
28
+ author = ask!(" Author name: ")
29
+ site = ask!(" Site/domain: ")
30
30
  # Now stash it...
31
31
  str = File.read(univ)
32
32
  str = str.gsub(/AUTHOR/, author)
33
33
  str = str.gsub(/SITE_DOMAIN/, site)
34
34
  File.write(univ, str)
35
- # STDERR.puts "------ universal ------\n#{`cat #{univ}`}\n------------------------"
36
35
  else
37
36
  vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(AUTHOR.*\|SITE.*\)"'
38
37
  edit_file(univ, vim: vim_params)
@@ -41,11 +40,11 @@ end
41
40
 
42
41
  def get_global
43
42
  if yesno("Faster view setup? (no: edit global.lt3)")
44
- view_name = ask!("\n Filename: ")
43
+ view_name = ask!(" Filename: ")
45
44
  @blog.create_view(view_name) # call change_view??
46
- title = ask!(" View title: ")
47
- subtitle = ask!(" Subtitle : ")
48
- domain = ask!(" Domain : ")
45
+ title = ask!(" View title: ")
46
+ subtitle = ask!(" Subtitle : ")
47
+ domain = ask!(" Domain : ")
49
48
 
50
49
  vfile = "#{@blog.root}/views/#{view_name}/settings/view.txt"
51
50
  hash = {/VIEW_NAME/ => view_name,
@@ -54,7 +53,7 @@ def get_global
54
53
  /VIEW_DOMAIN/ => domain}
55
54
  @blog.complete_file(vfile, nil, hash)
56
55
  else
57
- view_name = ask!("\n Filename: ")
56
+ view_name = ask!(" Filename: ")
58
57
  @blog.create_view(view_name) # call change_view??
59
58
  vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(VIEW_.*\|SITE.*\)"'
60
59
  edit_file(@blog.view.dir/"themes/standard/global.lt3", vim: vim_params)
@@ -75,11 +74,10 @@ def get_started
75
74
  puts fx("\n Quick setup complete!", :bold)
76
75
  if yesno("Create your first view now?")
77
76
  get_global
78
- puts "\n View #{@blog.view} created!\n "
77
+ puts fx("\n View #{@blog.view} created!\n ", :bold)
79
78
  end
80
79
  end
81
80
 
82
- puts
83
81
  print fx(" For help", :bold)
84
82
  puts " type h or help."
85
83
  print fx(" Create a view", :bold)
@@ -46,6 +46,7 @@
46
46
  hash = {}
47
47
  lines.each do |line|
48
48
  key, val = line.split(" ", 2)
49
+ val ||= ""
49
50
  hash[key] = val
50
51
  end
51
52
  hash
@@ -327,18 +327,21 @@ module RuneBlog::REPL
327
327
  posts = @blog.posts # current view
328
328
  str = @blog.view.name + ":\n"
329
329
  puts
330
- puts " ", fx(str, :bold)
331
330
  if posts.empty?
332
331
  puts " No posts"
333
332
  else
334
333
  posts.each do |post|
335
334
  base = post.sub(/.lt3$/, "")
336
- num, rest = base[0..3], base[4..-1]
337
- puts " ", fx(num, Red), fx(rest, Blue)
335
+ dir = @blog.root/:posts/base
336
+ meta = nil
337
+ Dir.chdir(dir) { meta = @blog.read_metadata }
338
+ num, title = meta.num, meta.title
339
+ num = '%4d' % num.to_s
340
+ puts " ", fx(num, Red), " ", fx(title, Blue)
338
341
  draft = @blog.root/:drafts/post + ".lt3"
339
- other = @blog._get_views(draft) - [@blog.view.to_s]
342
+ other = meta.views - [@blog.view.to_s]
340
343
  unless other.empty?
341
- print fx(" "*7 + "also in: ", :bold)
344
+ print fx(" "*9 + "also in: ", :bold)
342
345
  puts other.join(", ")
343
346
  end
344
347
  end
@@ -355,11 +358,15 @@ module RuneBlog::REPL
355
358
  puts
356
359
  drafts.each do |draft|
357
360
  base = draft.sub(/.lt3$/, "")
358
- num, rest = base[0..3], base[4..-1]
359
- puts " ", fx(num, Red), fx(rest, Blue)
361
+ dir = @blog.root/:posts/base
362
+ meta = nil
363
+ Dir.chdir(dir) { meta = @blog.read_metadata }
364
+ num, title = meta.num, meta.title
365
+ num = '%4d' % num.to_s
366
+ puts " ", fx(num, Red), " ", fx(title, Blue)
360
367
  other = @blog._get_views(@blog.root/:drafts/draft) - [@blog.view.to_s]
361
368
  unless other.empty?
362
- print fx(" "*7 + "also in: ", :bold)
369
+ print fx(" "*9 + "also in: ", :bold)
363
370
  puts other.join(", ")
364
371
  end
365
372
  end
@@ -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.06"
6
+ VERSION = "0.3.07"
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.06
4
+ version: 0.3.07
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-01 00:00:00.000000000 Z
11
+ date: 2020-01-02 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext