runeblog 0.1.31 → 0.1.32

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: 52ebaa843a818ec3dce17752ed00138eb70815de1d6682575f03b7f1439fd257
4
- data.tar.gz: 5fd897754f908d1743941bde6d481cdcd6b3b076f0e1f2ff764c72e762dc1dc9
3
+ metadata.gz: 4060bfbf1baa5f509e4da338e926c7606ec44d802fc15b843e9a5fc0c1738b7f
4
+ data.tar.gz: c2c35413fa8ce15f6858646adc872ebb501d31b7153ca81c6f5900841d165b02
5
5
  SHA512:
6
- metadata.gz: 27556932f85692ca16dd0b2121eac9a564361cf0224d6a285b00c6b15e2e8af8df8572a979dd876a2395259cee780b93784216e0e0c41c932092150295b7f50d
7
- data.tar.gz: d38d93b97e66cec00907b910b660fb1abf08ab1398879269a52f39218df106dde7ecda20d528f242b53566cc8b560f2e38f83cfd07aa388bb70af5bda5ab15e1
6
+ metadata.gz: 35cd25e62e26a81fbb4c070d606787c5274e3d3692e17d03da3cfd80d64f8b14d4519f0ade9d99e57a7ca1be6dc46faf040e610542491d3a1b3177d09a193644
7
+ data.tar.gz: b7c9af176b3a9fba7c8f06c6047a5a0c8a1bda5856a4ec2c1fecc524d7ff3d44f54b52f7dae36235a4af6b2d46e37704de16de0cfd450aa74dfac82cb3e75a6d
data/lib/default.rb CHANGED
@@ -34,14 +34,16 @@ BlogTrailer = <<-TEXT
34
34
  TEXT
35
35
 
36
36
  def RuneBlog.post_template(title: "No title", date: nil, view: "test_view",
37
- teaser: "No teaser", body: "No body")
37
+ teaser: "No teaser", body: "No body", tags: [], views: [])
38
+ viewlist = (views + [view.to_s]).join(" ")
39
+ taglist = tags.join(" ")
38
40
  <<-TEXT
39
41
  .mixin liveblog
40
42
 
41
43
  .title #{title}
42
44
  .pubdate #{date}
43
- .views #{view}
44
- .tags
45
+ .views #{viewlist}
46
+ .tags #{taglist}
45
47
 
46
48
  .teaser
47
49
  #{teaser}
data/lib/helpers-repl.rb CHANGED
@@ -19,6 +19,7 @@ module RuneBlog::REPL
19
19
  "new view $name" => :cmd_new_view,
20
20
 
21
21
  "customize" => :cmd_customize,
22
+ "tags" => :cmd_tags,
22
23
 
23
24
  "new post" => :cmd_new_post,
24
25
  "p" => :cmd_new_post,
data/lib/post.rb CHANGED
@@ -97,7 +97,8 @@ class RuneBlog::Post
97
97
 
98
98
  def create_draft
99
99
  html = RuneBlog.post_template(title: @meta.title, date: @meta.pubdate,
100
- view: @meta.view, teaser: @meta.teaser, body: @meta.body)
100
+ view: @meta.view, teaser: @meta.teaser, body: @meta.body,
101
+ views: @blog.post_views, tags: @blog.post_tags)
101
102
  srcdir = "#{@blog.root}/src/"
102
103
  verify(Dir.exist?(srcdir) => "#{srcdir} not found",
103
104
  @meta.slug.is_a?(String) => "slug #{@meta.slug.inspect} is invalid")
data/lib/repl.rb CHANGED
@@ -53,11 +53,16 @@ module RuneBlog::REPL
53
53
  others = @blog.views - [@blog.view]
54
54
  others.map!(&:name)
55
55
  viewlist = STDSCR.multimenu(items: others)
56
- puts "\n #{viewlist.inspect}\n "
56
+ @blog.post_views = viewlist
57
57
  tags = File.readlines("tagpool").map(&:chomp)
58
- tags << "[NEW TAG]"
58
+ return if tags.empty?
59
59
  taglist = STDSCR.multimenu(items: tags)
60
- puts "\n #{taglist.inspect}\n "
60
+ @blog.post_tags = taglist
61
+ end
62
+
63
+ def cmd_tags(arg, testing = false)
64
+ Dir.chdir(@blog.root + "/views/" + @blog.view.name)
65
+ edit_file("tagpool")
61
66
  end
62
67
 
63
68
  def cmd_browse(arg, testing = false)
data/lib/runeblog.rb CHANGED
@@ -34,6 +34,8 @@ class RuneBlog
34
34
  attr_reader :root, :views, :sequence, :editor
35
35
  attr_accessor :view # overridden
36
36
 
37
+ attr_accessor :post_views, :post_tags
38
+
37
39
  include Helpers
38
40
 
39
41
  def self.create_new_blog(dir = ".blog/data")
@@ -64,6 +66,8 @@ class RuneBlog
64
66
  @views = get_views
65
67
  @view = str2view(@view_name)
66
68
  @sequence = get_sequence
69
+ @post_views = []
70
+ @post_tags = []
67
71
  end
68
72
 
69
73
  def view?(name)
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.31"
3
+ VERSION = "0.1.32"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
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.1.31
4
+ version: 0.1.32
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-01-23 00:00:00.000000000 Z
11
+ date: 2019-01-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext