runeblog 0.3.17 → 0.3.18

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: d17e951cf12388a3cd71091a7e8a014bcc71d3e08d08a6001b91deb8b545bdf5
4
- data.tar.gz: e76a74b9751d248c1bc71387bfc684376f6b130e641b856bb94ef5715b948062
3
+ metadata.gz: d935e36229c36cdae337b72491aad4151824b5c083a48d36f5c73f6a069cc10e
4
+ data.tar.gz: 742a6d8a782a39dc0897f4ce9d73d8e6b091c8dceb3f96230c990e556e20d994
5
5
  SHA512:
6
- metadata.gz: 237fc6eca980f18aff1fc950831d7579b944727a587e23ea3fae538b5e8a222d8299432b4ad16a1f0371702fbd82fdb63d4d057146fedc9edb146a74711ae2dc
7
- data.tar.gz: 331ba90a0ef26f7e34bcc9358776259eeac2a90aadeb0a311050a4e94d97c4fbd4035ad3464141c58fff4a61541d55d24079cbbfad36e9ff510171be08fe707d
6
+ metadata.gz: 68fdf37438b0fe6f4de20616896a5ad4d9e9a54d5287d079e318b8751b844e748ab261cec1f4f54e8f7bc3970a2dad280fed7a64cd3854c0672f55e8d3d6146d
7
+ data.tar.gz: 5fd8d900cb5de28bdd51fe6d7f9700bf563ace134536e7c4097e36b7ed88520c687f4f6add2ac057677a87716697c5852717a56798a1199cb42a2118f14a034d
data/bin/blog CHANGED
@@ -91,15 +91,16 @@ end
91
91
  def mainloop
92
92
  info = @blog.view || "no view"
93
93
  print fx("[#{info}] ", Red, :bold)
94
- cmd = STDSCR.gets(history: @cmdhist, tab: @tabcom)
95
- case
96
- when cmd == RubyText::Keys::Escape
94
+ cmd = STDSCR.gets(history: @cmdhist, tab: @tabcom, capture: [" "])
95
+ case cmd
96
+ when " ", RubyText::Keys::Escape
97
+ Dir.chdir(@blog.view.dir)
97
98
  show_top_menu
98
99
  puts
99
100
  return
100
- when cmd == RubyText::Keys::CtlD # ^D
101
+ when RubyText::Keys::CtlD # ^D
101
102
  cmd_quit
102
- when cmd.is_a?(String)
103
+ when String
103
104
  cmd.chomp!
104
105
  return if cmd.empty? # CR does nothing
105
106
  invoking = RuneBlog::REPL.choose_method(cmd)
@@ -5,11 +5,42 @@ require 'repl'
5
5
 
6
6
  Menu = OpenStruct.new
7
7
 
8
+ def edit(str)
9
+ proc { edit_file(str) }
10
+ end
11
+
8
12
  notimp = proc { RubyText.splash("Not implemented yet") }
9
13
 
10
14
  top_about = proc { RubyText.splash("RuneBlog v #{RuneBlog::VERSION}") }
11
15
  top_help = proc { RubyText.splash(RuneBlog::REPL::Help.gsub(/[{}]/, " ")) }
12
16
 
17
+
18
+ # dir = @blog.view.dir/"themes/standard/"
19
+
20
+ std = "themes/standard"
21
+
22
+ Menu.top_config = {
23
+ "Variables (general)" => edit("#{std}/global.lt3"),
24
+ " View-specific" => edit("settings/view.txt"),
25
+ " Recent posts" => edit("settings/recent.txt"),
26
+ " Publishing" => edit("settings/publish.txt"),
27
+ "Configuration: enable/disable" => edit("settings/features.txt"),
28
+ " Reddit" => edit("config/reddit/credentials.txt"),
29
+ " Facebook" => edit("config/facebook/credentials.txt"),
30
+ " Twitter" => edit("config/twitter/credentials.txt"),
31
+ "View: generator" => edit("#{std}/blog/generate.lt3"),
32
+ " HEAD info" => edit("#{std}/blog/head.lt3"),
33
+ " Layout " => edit("#{std}/blog/index.lt3"),
34
+ " Recent-posts entry" => edit("#{std}/blog/post_entry.lt3"),
35
+ " Banner: Description" => edit("#{std}/blog/banner.lt3"),
36
+ " Text portion" => edit("#{std}/banner/top.lt3"),
37
+ "Generator for a post" => edit("#{std}/post/generate.lt3"),
38
+ " HEAD info for post" => edit("#{std}/post/head.lt3"),
39
+ " Content for post" => edit("#{std}/post/index.lt3"),
40
+ "Global CSS" => edit("#{std}/etc/blog.css.lt3"),
41
+ "External JS/CSS (Bootstrap, etc.)" => edit("/etc/externals.lt3")
42
+ }
43
+
13
44
  Menu.top_build = {
14
45
  Rebuild: proc { cmd_rebuild },
15
46
  Preview: proc { cmd_preview },
@@ -20,20 +51,19 @@ Menu.top_build = {
20
51
 
21
52
  Menu.top_items = {
22
53
  About: top_about,
23
- Views: notimp,
54
+ # Views: notimp,
24
55
  Build: proc { STDSCR.menu(items: Menu.top_build) },
25
- Config: notimp,
56
+ Config: proc { STDSCR.menu(items: Menu.top_config) },
26
57
  Help: top_help,
27
58
  Quit: proc { cmd_quit }
28
59
  }
29
60
 
30
61
  def show_top_menu
62
+ r, c = STDSCR.rc
31
63
  STDSCR.topmenu(items: Menu.top_items)
64
+ STDSCR.go r-1, 0
32
65
  end
33
66
 
34
- # about_items
35
-
36
-
37
67
  =begin
38
68
  About (version)
39
69
  Help
@@ -86,30 +116,3 @@ end
86
116
 
87
117
  }
88
118
 
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,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.17"
6
+ VERSION = "0.3.18"
7
7
 
8
8
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
9
9
  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.21'
24
+ s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.22'
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.17
4
+ version: 0.3.18
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-02-03 00:00:00.000000000 Z
11
+ date: 2020-02-06 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.21
42
+ version: 0.1.22
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.21
52
+ version: 0.1.22
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: minitest
55
55
  requirement: !ruby/object:Gem::Requirement