runeblog 0.3.20 → 0.3.21

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: 564da6b288bef18302dfeea653099fa7fe119d09f83a53d17203a36fc84c56fa
4
- data.tar.gz: e58a5ef46811db88820a7c8436e59511bdc89e38145e5d8516dfa7ac8878dfae
3
+ metadata.gz: f946568cd1dd92fc6c3f7bfbb605b02eedf12b8725103b617320b564241494d4
4
+ data.tar.gz: 120d8f2af493052ece7fc811f37d08bc175521a9838109cec2671053f6ec4532
5
5
  SHA512:
6
- metadata.gz: d15663f8d0f14e58276cddb83f898cd08db8014d5939b1bab27b8328765545c55a619a4d034a3848956839db1f21765a6cfac4a681136a4c3ada5c0fb223121e
7
- data.tar.gz: 2eb21595baf1cb03dceb7a6d039fa31a473ae54243b6768771a08c7b49de55897bdc391e22386d236bc7d7ee067184e0849645259adf73643ece3e1d9ae369e1
6
+ metadata.gz: e5c951593ebf282712c37fdeb315507233febabae2bb13abbf7d21e491a58bfb9b8a7f8f2d78dafb1877286a35bccacac55df32b84bc4bab3b12ea0eb3f64604
7
+ data.tar.gz: 0ae1ec7ecb6d1f6b6465a534965d0741963f1da3a76c687be6bafb672ee6a3bab801756f84aa116d284989bf943fa3e772df9a186eac8ce89893c2216f125818
@@ -239,14 +239,19 @@ module RuneBlog::REPL
239
239
 
240
240
  def cmd_change_view(arg = nil)
241
241
  if arg.nil?
242
- viewnames = @blog.views.map {|x| x.name }
243
- n = viewnames.find_index(@blog.view.name)
242
+ viewnames = {}
243
+ @blog.views.each do |v|
244
+ name = v.to_s
245
+ title = view2title(name)
246
+ string = "#{'%-25s' % title} #{name}"
247
+ viewnames[string] = name
248
+ end
249
+ n = viewnames.values.find_index(@blog.view.name)
244
250
  name = @blog.view.name
245
- # TODO: Add view description
246
251
  k, name = STDSCR.menu(title: "Views", items: viewnames, curr: n)
247
252
  return if name.nil?
248
253
  @blog.view = name
249
- puts "\n ", fx(name, :bold), "\n"
254
+ # puts "\n ", fx(name, :bold), "\n"
250
255
  return
251
256
  else
252
257
  if @blog.view?(arg)
@@ -330,16 +335,19 @@ module RuneBlog::REPL
330
335
  _tmp_error(err)
331
336
  end
332
337
 
338
+ def view2title(name) # FIXME: crufty as hell
339
+ lines = File.readlines(@blog.root/"views/#{name}/settings/view.txt")
340
+ lines.map!(&:chomp)
341
+ lines = lines.select {|x| x =~ /^title / && x !~ /VIEW_/ }
342
+ title = lines.first.split(" ", 2)[1]
343
+ end
344
+
333
345
  def cmd_list_views
334
346
  puts
335
347
  @blog.views.each do |v|
336
348
  v = v.to_s
349
+ title = view2title(v)
337
350
  v = fx(v, :bold) if v == @blog.view.name
338
- # FIXME: next 3 lines are crufty as hell
339
- lines = File.readlines(@blog.root/"views/#{v}/settings/view.txt")
340
- lines.map!(&:chomp)
341
- lines = lines.select {|x| x =~ /^title / && x !~ /VIEW_/ }
342
- title = lines.first.split(" ", 2)[1]
343
351
  print " ", ('%15s' % v)
344
352
  puts " ", fx(title, Black)
345
353
  end
@@ -1,7 +1,7 @@
1
1
  if !defined?(RuneBlog::Path)
2
2
 
3
3
  class RuneBlog
4
- VERSION = "0.3.20"
4
+ VERSION = "0.3.21"
5
5
 
6
6
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
7
7
  Path = File.dirname(path)
@@ -21,7 +21,7 @@ spec = Gem::Specification.new do |s|
21
21
  s.email = 'rubyhacker@gmail.com'
22
22
  s.executables << "blog"
23
23
  s.add_runtime_dependency 'livetext', '~> 0.9', '>= 0.9.04'
24
- s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.22'
24
+ s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.23'
25
25
 
26
26
  s.add_development_dependency 'minitest', '~> 5.10', '>= 5.10.0'
27
27
 
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.20
4
+ version: 0.3.21
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-03-11 00:00:00.000000000 Z
11
+ date: 2020-03-15 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '0.1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 0.1.22
42
+ version: 0.1.23
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '0.1'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 0.1.22
52
+ version: 0.1.23
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: minitest
55
55
  requirement: !ruby/object:Gem::Requirement