runeblog 0.1.30 → 0.1.31

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: dfed05ef1c5eb502d0f6769c95388f1f5b1b01e222c49fa6f57fd63e85303e82
4
- data.tar.gz: 298cb71465d7fd9e180846f907834d613823fad2483e24283c795ef9f0d74485
3
+ metadata.gz: 52ebaa843a818ec3dce17752ed00138eb70815de1d6682575f03b7f1439fd257
4
+ data.tar.gz: 5fd897754f908d1743941bde6d481cdcd6b3b076f0e1f2ff764c72e762dc1dc9
5
5
  SHA512:
6
- metadata.gz: 56c51aab79afdd45313fc5f1e15940372bb2465409eba613b5e8f57115e61cea280efe888f18e85a0e8d9040a225868ac1e04c4d8a32a37b1c5c7f3d4ff583eb
7
- data.tar.gz: 24be0b1d1a612de9a5c226cb4bd3256271437e975223309358a542c33e3dff34912dd197751691e38775f45010b77e088f8aea8367db2b8fe0c96a0c500ac778
6
+ metadata.gz: 27556932f85692ca16dd0b2121eac9a564361cf0224d6a285b00c6b15e2e8af8df8572a979dd876a2395259cee780b93784216e0e0c41c932092150295b7f50d
7
+ data.tar.gz: d38d93b97e66cec00907b910b660fb1abf08ab1398879269a52f39218df106dde7ecda20d528f242b53566cc8b560f2e38f83cfd07aa388bb70af5bda5ab15e1
data/bin/blog CHANGED
@@ -11,7 +11,7 @@ include RuneBlog::REPL
11
11
 
12
12
  def mainloop
13
13
  print fx("blog> ", Red, :bold)
14
- cmd = STDSCR.gets(history: @cmdhist)
14
+ cmd = STDSCR.gets(history: @cmdhist, tab: @tabcom)
15
15
  cmd_quit(nil) if cmd.nil? # ^D
16
16
  cmd.chomp!
17
17
  return if cmd.empty? # CR does nothing
@@ -43,6 +43,8 @@ end
43
43
 
44
44
  puts fx("\n RuneBlog", :bold), fx(" v #{RuneBlog::VERSION}\n", Red)
45
45
  @cmdhist = []
46
+ @tabcom = RuneBlog::REPL::Patterns.keys
47
+ @tabcom.map! {|x| x.sub(/ \$.*/, " ") }
46
48
  loop { mainloop }
47
49
  sleep 0.2
48
50
  system("tput clear")
data/lib/helpers-repl.rb CHANGED
@@ -18,6 +18,8 @@ module RuneBlog::REPL
18
18
 
19
19
  "new view $name" => :cmd_new_view,
20
20
 
21
+ "customize" => :cmd_customize,
22
+
21
23
  "new post" => :cmd_new_post,
22
24
  "p" => :cmd_new_post,
23
25
  "post" => :cmd_new_post,
data/lib/post.rb CHANGED
@@ -16,8 +16,8 @@ class RuneBlog::Post
16
16
  end
17
17
 
18
18
  def self.load(post)
19
- # FIXME weird logic here
20
19
  raise NoBlogAccessor if RuneBlog.blog.nil?
20
+ # "post" is a slug
21
21
  pdir = RuneBlog.blog.view.dir + "/" + post
22
22
  verify(Dir.exist?(pdir) => "Directory #{pdir} not found")
23
23
  meta = nil
@@ -128,7 +128,8 @@ class RuneBlog::Post
128
128
  # FIXME what if title changes? slug should change?
129
129
  meta.views = views # FIXME
130
130
 
131
- meta.views.each do |view_name| # Create dir using slug (index.html, metadata?)
131
+ meta.views.each do |view_name|
132
+ # Create dir using slug (index.html, metadata?)
132
133
  vdir = "#{@blog.root}/views/#{view_name}/"
133
134
  dir = vdir + meta.slug + "/"
134
135
  create_dir(dir) unless Dir.exist?(dir)
data/lib/publish.rb CHANGED
@@ -26,7 +26,7 @@ class RuneBlog::Publishing
26
26
  end
27
27
 
28
28
  def url
29
- url = "#@proto://#@server/#@path"
29
+ url = "#@proto://#@server/#@path/#{@blog.view.name}"
30
30
  end
31
31
 
32
32
  def system!(str)
@@ -38,10 +38,11 @@ debug "Failed!\n " if ! rc
38
38
 
39
39
  def publish(files, assets=[])
40
40
  dir = "#@docroot/#@path"
41
- result = system!("ssh #@user@#@server -x mkdir -p #{dir}")
41
+ view_name = @blog.view.name
42
+ result = system!("ssh #@user@#@server -x mkdir -p #{dir}/#{view_name}")
42
43
  result = system!("ssh #@user@#@server -x mkdir -p #{dir}/assets")
43
44
  files.each do |file|
44
- dest = "#@user@#@server:#{dir}"
45
+ dest = "#@user@#@server:#{dir}/#{view_name}"
45
46
  file.gsub!(/\/\//, "/") # weird... :-/
46
47
  dest.gsub!(/\/\//, "/") # weird... :-/
47
48
  cmd = "scp -r #{file} #{dest} >/dev/null 2>/tmp/wtf"
data/lib/repl.rb CHANGED
@@ -47,6 +47,19 @@ module RuneBlog::REPL
47
47
  edit_file("#{dir}/#{fname}")
48
48
  end
49
49
 
50
+ def cmd_customize(arg, testing = false)
51
+ # add extra views? add tags?
52
+ Dir.chdir(@blog.root + "/views/" + @blog.view.name)
53
+ others = @blog.views - [@blog.view]
54
+ others.map!(&:name)
55
+ viewlist = STDSCR.multimenu(items: others)
56
+ puts "\n #{viewlist.inspect}\n "
57
+ tags = File.readlines("tagpool").map(&:chomp)
58
+ tags << "[NEW TAG]"
59
+ taglist = STDSCR.multimenu(items: tags)
60
+ puts "\n #{taglist.inspect}\n "
61
+ end
62
+
50
63
  def cmd_browse(arg, testing = false)
51
64
  reset_output
52
65
  check_empty(arg)
@@ -308,6 +321,8 @@ module RuneBlog::REPL
308
321
 
309
322
  list views List all views available
310
323
  lsv Same as: list views
324
+
325
+ customize Change set of tags, extra views
311
326
 
312
327
  p, post Create a new post
313
328
  new post Same as post (create a post)
data/lib/runeblog.rb CHANGED
@@ -131,9 +131,9 @@ class RuneBlog
131
131
  x = RuneBlog::Default
132
132
  create_dir('custom')
133
133
  create_dir('assets')
134
- # FIXME dump method??
135
134
  pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
136
- dump(pub, "publish") # FIXME publish
135
+ dump(pub, "publish")
136
+ dump("", "tagpool")
137
137
  dump(x::BlogHeader, "custom/blog_header.html")
138
138
  dump(x::BlogTrailer, "custom/blog_trailer.html")
139
139
  dump("Initial creation", "last_published")
@@ -294,8 +294,8 @@ class RuneBlog
294
294
  process_post(file)
295
295
  # FIXME this is broken now
296
296
  self.views.each do |view|
297
- p view.inspect
298
- getch
297
+ # p view.inspect
298
+ # getch
299
299
  generate_index(view)
300
300
  end
301
301
  rescue => err
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.30"
3
+ VERSION = "0.1.31"
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.30
4
+ version: 0.1.31
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-20 00:00:00.000000000 Z
11
+ date: 2019-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext