runeblog 0.3.16 → 0.3.17

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: 8d6961e05ec2e2b61542ec6d149bf2af83f77d8870549707bdde78764fbce0aa
4
- data.tar.gz: 9e58ad2e2a60078de58c82fba9ce656b255836f38ac36840131e31ec864b4e7e
3
+ metadata.gz: d17e951cf12388a3cd71091a7e8a014bcc71d3e08d08a6001b91deb8b545bdf5
4
+ data.tar.gz: e76a74b9751d248c1bc71387bfc684376f6b130e641b856bb94ef5715b948062
5
5
  SHA512:
6
- metadata.gz: cb5a93d9fabf6ad9e16c433590ee58a4b15946873ad7e50cb051159eb03694dcd3c4b31abc9d7cb0854216b18caee832d888a4ef44ed999f6a81a2311b995fab
7
- data.tar.gz: 85e551c444ca1099de08e4885c2d657b8564e482bca77a5b3fac4733826248c1726217c06b371625a30317149d87b25a98614bd441c88b3b9e1f82856a2260df
6
+ metadata.gz: 237fc6eca980f18aff1fc950831d7579b944727a587e23ea3fae538b5e8a222d8299432b4ad16a1f0371702fbd82fdb63d4d057146fedc9edb146a74711ae2dc
7
+ data.tar.gz: 331ba90a0ef26f7e34bcc9358776259eeac2a90aadeb0a311050a4e94d97c4fbd4035ad3464141c58fff4a61541d55d24079cbbfad36e9ff510171be08fe707d
data/bin/blog CHANGED
@@ -5,6 +5,8 @@
5
5
  require 'runeblog'
6
6
  require 'rubytext'
7
7
 
8
+ require 'menus'
9
+
8
10
  require 'repl'
9
11
 
10
12
  include RuneBlog::REPL
@@ -90,11 +92,21 @@ def mainloop
90
92
  info = @blog.view || "no view"
91
93
  print fx("[#{info}] ", Red, :bold)
92
94
  cmd = STDSCR.gets(history: @cmdhist, tab: @tabcom)
93
- cmd_quit if cmd.nil? # ^D
94
- cmd.chomp!
95
- return if cmd.empty? # CR does nothing
96
- invoking = RuneBlog::REPL.choose_method(cmd)
97
- ret = send(*invoking)
95
+ case
96
+ when cmd == RubyText::Keys::Escape
97
+ show_top_menu
98
+ puts
99
+ return
100
+ when cmd == RubyText::Keys::CtlD # ^D
101
+ cmd_quit
102
+ when cmd.is_a?(String)
103
+ cmd.chomp!
104
+ return if cmd.empty? # CR does nothing
105
+ invoking = RuneBlog::REPL.choose_method(cmd)
106
+ ret = send(*invoking)
107
+ else
108
+ puts "Don't understand '#{cmd.inspect}'\n "
109
+ end
98
110
  rescue => err
99
111
  puts err
100
112
  end
@@ -382,14 +382,6 @@ def pubdate
382
382
  _optional_blank_line
383
383
  end
384
384
 
385
- def image # primitive so far
386
- _debug "img: huh? <img src=#{_args.first}></img>"
387
- fname = _args.first
388
- path = :assets/fname
389
- _out "<img src=#{path}></img>"
390
- _optional_blank_line
391
- end
392
-
393
385
  def tags
394
386
  raise "'post' was not called" unless @meta
395
387
  _debug "args = #{_args}"
@@ -0,0 +1,115 @@
1
+
2
+ require 'ostruct'
3
+ require 'rubytext'
4
+ require 'repl'
5
+
6
+ Menu = OpenStruct.new
7
+
8
+ notimp = proc { RubyText.splash("Not implemented yet") }
9
+
10
+ top_about = proc { RubyText.splash("RuneBlog v #{RuneBlog::VERSION}") }
11
+ top_help = proc { RubyText.splash(RuneBlog::REPL::Help.gsub(/[{}]/, " ")) }
12
+
13
+ Menu.top_build = {
14
+ Rebuild: proc { cmd_rebuild },
15
+ Preview: proc { cmd_preview },
16
+ Publish: proc { cmd_publish },
17
+ Browse: proc { cmd_browse },
18
+ ssh: proc { cmd_ssh }
19
+ }
20
+
21
+ Menu.top_items = {
22
+ About: top_about,
23
+ Views: notimp,
24
+ Build: proc { STDSCR.menu(items: Menu.top_build) },
25
+ Config: notimp,
26
+ Help: top_help,
27
+ Quit: proc { cmd_quit }
28
+ }
29
+
30
+ def show_top_menu
31
+ STDSCR.topmenu(items: Menu.top_items)
32
+ end
33
+
34
+ # about_items
35
+
36
+
37
+ =begin
38
+ About (version)
39
+ Help
40
+ Views
41
+ New view
42
+ (select)
43
+ Posts
44
+ New post
45
+ (select)
46
+ Drafts
47
+ (select) hmm...
48
+ Widgets
49
+ (select)
50
+ Assets
51
+
52
+ Build
53
+ rebuild
54
+ preview
55
+ publish
56
+ browse
57
+ ssh
58
+
59
+ quit
60
+ =end
61
+
62
+ {
63
+
64
+ "tags" => :cmd_tags,
65
+ "import" => :cmd_import,
66
+
67
+ "config" => :cmd_config,
68
+
69
+ "install $widget" => :cmd_install_widget,
70
+ "enable $widget" => :cmd_enable_widget,
71
+ "disable $widget" => :cmd_disable_widget,
72
+ "update $widget" => :cmd_update_widget,
73
+ "manage $widget" => :cmd_manage,
74
+
75
+ "list assets" => :cmd_list_assets,
76
+ "lsa" => :cmd_list_assets,
77
+
78
+ "pages" => :cmd_pages,
79
+
80
+ "delete >postid" => :cmd_remove_post,
81
+ "undel $postid" => :cmd_undelete_post,
82
+
83
+ "edit $postid" => :cmd_edit_post,
84
+ "ed $postid" => :cmd_edit_post,
85
+ "e $postid" => :cmd_edit_post,
86
+
87
+ }
88
+
89
+ # def cmd_config
90
+ # hash = {"Variables (general)" => "global.lt3",
91
+ # " View-specific" => "../../settings/view.txt",
92
+ # " Recent posts" => "../../settings/recent.txt",
93
+ # " Publishing" => "../../settings/publish.txt",
94
+ # "Configuration: enable/disable" => "../../settings/features.txt",
95
+ # " Reddit" => "../../config/reddit/credentials.txt",
96
+ # " Facebook" => "../../config/facebook/credentials.txt",
97
+ # " Twitter" => "../../config/twitter/credentials.txt",
98
+ # "View: generator" => "blog/generate.lt3",
99
+ # " HEAD info" => "blog/head.lt3",
100
+ # " Layout " => "blog/index.lt3",
101
+ # " Recent-posts entry" => "blog/post_entry.lt3",
102
+ # " Banner: Description" => "blog/banner.lt3",
103
+ # " Text portion" => "banner/top.lt3",
104
+ # "Generator for a post" => "post/generate.lt3",
105
+ # " HEAD info for post" => "post/head.lt3",
106
+ # " Content for post" => "post/index.lt3",
107
+ # "Global CSS" => "etc/blog.css.lt3",
108
+ # "External JS/CSS (Bootstrap, etc.)" => "/etc/externals.lt3"
109
+ # }
110
+ #
111
+ # dir = @blog.view.dir/"themes/standard/"
112
+ # num, target = STDSCR.menu(title: "Edit file:", items: hash)
113
+ # edit_file(dir/target)
114
+ # end
115
+ #
@@ -3,6 +3,8 @@ require 'ostruct'
3
3
  require 'helpers-repl' # FIXME structure
4
4
  require 'pathmagic'
5
5
 
6
+ require 'menus'
7
+
6
8
  make_exception(:PublishError, "Error during publishing")
7
9
  make_exception(:EditorProblem, "Could not edit $1")
8
10
 
@@ -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.16"
6
+ VERSION = "0.3.17"
7
7
 
8
8
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
9
9
  Path = File.dirname(path)
@@ -20,8 +20,8 @@ spec = Gem::Specification.new do |s|
20
20
  s.authors = ["Hal Fulton"]
21
21
  s.email = 'rubyhacker@gmail.com'
22
22
  s.executables << "blog"
23
- s.add_runtime_dependency 'livetext', '~> 0.9', '>= 0.9.02'
24
- s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.20'
23
+ s.add_runtime_dependency 'livetext', '~> 0.9', '>= 0.9.04'
24
+ s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.21'
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.16
4
+ version: 0.3.17
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-29 00:00:00.000000000 Z
11
+ date: 2020-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.9'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.9.02
22
+ version: 0.9.04
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.9'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.9.02
32
+ version: 0.9.04
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rubytext
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '0.1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 0.1.20
42
+ version: 0.1.21
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.20
52
+ version: 0.1.21
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: minitest
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -148,6 +148,7 @@ files:
148
148
  - lib/liveblog.rb
149
149
  - lib/logging.rb
150
150
  - lib/lowlevel.rb
151
+ - lib/menus.rb
151
152
  - lib/pathmagic.rb
152
153
  - lib/post.rb
153
154
  - lib/processing.rb