runeblog 0.3.18 → 0.3.23
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +77 -53
- data/data/global.lt3 +3 -3
- data/data/universal.lt3 +2 -0
- data/empty_view/data/GIT_IS_DUMB +0 -0
- data/empty_view/themes/standard/banner/top.lt3 +1 -1
- data/empty_view/themes/standard/blog/generate.lt3 +1 -1
- data/empty_view/themes/standard/etc/blog.css.lt3 +3 -1
- data/empty_view/themes/standard/etc/github.css +209 -0
- data/empty_view/themes/standard/post/generate.lt3 +8 -5
- data/empty_view/themes/standard/post/permalink.lt3 +1 -1
- data/lib/exceptions.rb +37 -0
- data/lib/helpers-blog.rb +6 -4
- data/lib/helpers-repl.rb +2 -6
- data/lib/liveblog.rb +108 -31
- data/lib/lowlevel.rb +23 -7
- data/lib/menus.rb +5 -3
- data/lib/newpost.rb +82 -0
- data/lib/post.rb +6 -5
- data/lib/processing.rb +23 -2
- data/lib/publish.rb +3 -1
- data/lib/repl.rb +68 -26
- data/lib/runeblog.rb +94 -57
- data/lib/runeblog_version.rb +2 -15
- data/lib/view.rb +22 -3
- data/runeblog.gemspec +2 -2
- metadata +13 -9
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e8c5908c63aea98d2cc29ab782e11b83361d3d866bda7d0c902afb1cfdc70226
|
4
|
+
data.tar.gz: 7740ee4f471a6addeaea6a48394e02aa53ae30be129b9761d1b1b9eb316de7a3
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9421dacd34f38911af55054966a341563a70f791bc5fc080f949ad9f1724ae32b15b8163b30985546e3666a127ab87b3a33b731a31a21bf546c832011d006245
|
7
|
+
data.tar.gz: c1571f0a8f8109bc9ce3603142bb8f4b02117606aada8f8931eb9ec6e694ffe094ca2218ce618f37011ceea2da5291edfa8e83f9d7fa64e743bb8dd0483a31f1
|
data/bin/blog
CHANGED
@@ -27,8 +27,12 @@ end
|
|
27
27
|
def get_universal
|
28
28
|
univ = "#{@blog.root}/data/universal.lt3"
|
29
29
|
if yesno("Faster initial setup? (no: edit universal.lt3)")
|
30
|
-
|
31
|
-
|
30
|
+
# author = ask!(" Author name: ")
|
31
|
+
# site = ask!(" Site/domain: ")
|
32
|
+
# Temporarily, for speed:
|
33
|
+
author, site = "Hal Fulton", "somedomain.com"
|
34
|
+
puts " Author name: #{author}"
|
35
|
+
puts " Site/domain: #{site}"
|
32
36
|
# Now stash it...
|
33
37
|
str = File.read(univ)
|
34
38
|
str = str.gsub(/AUTHOR/, author)
|
@@ -41,22 +45,16 @@ def get_universal
|
|
41
45
|
end
|
42
46
|
|
43
47
|
def get_global
|
48
|
+
view_name = ask!(" Filename: ")
|
49
|
+
@blog.create_view(view_name) # call change_view??
|
44
50
|
if yesno("Faster view setup? (no: edit global.lt3)")
|
45
|
-
view_name = ask!(" Filename: ")
|
46
|
-
@blog.create_view(view_name) # call change_view??
|
47
51
|
title = ask!(" View title: ")
|
48
52
|
subtitle = ask!(" Subtitle : ")
|
49
53
|
domain = ask!(" Domain : ")
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
/VIEW_TITLE/ => title,
|
54
|
-
/VIEW_SUBTITLE/ => subtitle,
|
55
|
-
/VIEW_DOMAIN/ => domain}
|
56
|
-
@blog.complete_file(vfile, nil, hash)
|
54
|
+
modify_view_global(view_name)
|
55
|
+
modify_view_settings(name: view_name, title: title, subtitle: subtitle,
|
56
|
+
domain: domain)
|
57
57
|
else
|
58
|
-
view_name = ask!(" Filename: ")
|
59
|
-
@blog.create_view(view_name) # call change_view??
|
60
58
|
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(VIEW_.*\|SITE.*\)"'
|
61
59
|
edit_file(@blog.view.dir/"themes/standard/global.lt3", vim: vim_params)
|
62
60
|
end
|
@@ -109,7 +107,8 @@ def mainloop
|
|
109
107
|
puts "Don't understand '#{cmd.inspect}'\n "
|
110
108
|
end
|
111
109
|
rescue => err
|
112
|
-
puts err
|
110
|
+
puts err.to_s
|
111
|
+
puts "Pausing..."; gets
|
113
112
|
end
|
114
113
|
|
115
114
|
def cmdline_preview
|
@@ -159,57 +158,82 @@ def handle_cmdline
|
|
159
158
|
exit
|
160
159
|
end
|
161
160
|
|
162
|
-
|
163
|
-
|
164
|
-
|
165
|
-
ver
|
166
|
-
|
167
|
-
|
168
|
-
|
169
|
-
|
170
|
-
|
161
|
+
def check_ruby_version
|
162
|
+
major, minor = RUBY_VERSION.split(".").values_at(0,1)
|
163
|
+
ver = major.to_i*10 + minor.to_i
|
164
|
+
unless ver >= 24
|
165
|
+
RubyText.stop
|
166
|
+
sleep 0.2
|
167
|
+
puts "Needs Ruby 2.4 or greater"
|
168
|
+
exit
|
169
|
+
end
|
171
170
|
end
|
172
171
|
|
173
|
-
|
172
|
+
def reopen_stderr
|
173
|
+
errfile = File.new("stderr.out", "w")
|
174
|
+
STDERR.reopen(errfile)
|
175
|
+
end
|
174
176
|
|
175
|
-
|
177
|
+
def set_fgbg
|
178
|
+
# read a .rubytext file here?? Call it something else?
|
179
|
+
home = ENV['HOME']
|
180
|
+
@fg, @bg = Blue, White ## FIXME!! try_read_config("#{home}/.rubytext", fg: Blue, bg: White)
|
181
|
+
@fg = @fg.downcase.to_sym
|
182
|
+
@bg = @bg.downcase.to_sym
|
176
183
|
|
177
|
-
|
178
|
-
|
184
|
+
RubyText.start(:_echo, :keypad, scroll: true, log: "binblog.txt", fg: @fg, bg: @bg)
|
185
|
+
end
|
179
186
|
|
180
|
-
|
181
|
-
|
182
|
-
|
183
|
-
|
184
|
-
|
187
|
+
def create_new_repo?
|
188
|
+
new_repo = false
|
189
|
+
if ! RuneBlog.exist?
|
190
|
+
exit unless yesno("No blog repo found. Create new one?")
|
191
|
+
RuneBlog.create_new_blog_repo
|
192
|
+
puts fx(" Blog repo successfully created.", :bold)
|
193
|
+
new_repo = true
|
194
|
+
end
|
185
195
|
|
186
|
-
|
196
|
+
@blog = RuneBlog.new
|
197
|
+
get_started if new_repo
|
198
|
+
rescue => err
|
199
|
+
STDERR.puts "Error - #{err.to_s}"
|
200
|
+
STDERR.puts err.backtrace
|
201
|
+
end
|
187
202
|
|
203
|
+
def print_intro
|
204
|
+
print fx(" For help", :bold)
|
205
|
+
puts " type h or help.\n "
|
188
206
|
|
189
|
-
|
190
|
-
if ! RuneBlog.exist?
|
191
|
-
exit unless yesno("No blog repo found. Create new one?")
|
192
|
-
RuneBlog.create_new_blog_repo
|
193
|
-
puts fx(" Blog repo successfully created.", :bold)
|
194
|
-
new_repo = true
|
207
|
+
puts fx("\n RuneBlog", :bold), fx(" v #{RuneBlog::VERSION}\n", Red)
|
195
208
|
end
|
196
209
|
|
197
|
-
|
198
|
-
|
210
|
+
def cmd_history_etc
|
211
|
+
@cmdhist = []
|
212
|
+
@tabcom = RuneBlog::REPL::Patterns.keys.uniq - RuneBlog::REPL::Abbr.keys
|
213
|
+
@tabcom.map! {|x| x.sub(/ [\$\>].*/, "") + " " }
|
214
|
+
@tabcom.sort!
|
215
|
+
end
|
199
216
|
|
200
|
-
|
201
|
-
|
217
|
+
def exit_repl
|
218
|
+
# RubyText.stop
|
219
|
+
sleep 0.2
|
220
|
+
puts
|
221
|
+
end
|
202
222
|
|
203
|
-
|
223
|
+
### Main
|
204
224
|
|
205
|
-
|
206
|
-
@tabcom = RuneBlog::REPL::Patterns.keys.uniq - RuneBlog::REPL::Abbr.keys
|
207
|
-
@tabcom.map! {|x| x.sub(/ [\$\>].*/, "") + " " }
|
208
|
-
@tabcom.sort!
|
209
|
-
|
210
|
-
loop { mainloop }
|
225
|
+
include RuneBlog::Helpers # for try_read_config
|
211
226
|
|
212
|
-
|
213
|
-
sleep 0.2
|
214
|
-
puts
|
227
|
+
reopen_stderr
|
215
228
|
|
229
|
+
check_ruby_version
|
230
|
+
handle_cmdline unless ARGV.empty?
|
231
|
+
set_fgbg
|
232
|
+
print_intro
|
233
|
+
# STDERR.puts "cp 6 - pause"; gets
|
234
|
+
create_new_repo?
|
235
|
+
# STDERR.puts "cp 7 - pause"; gets
|
236
|
+
cmd_history_etc
|
237
|
+
# STDERR.puts "cp 8 - pause"; gets
|
238
|
+
loop { mainloop }
|
239
|
+
exit_repl
|
data/data/global.lt3
CHANGED
@@ -3,11 +3,11 @@
|
|
3
3
|
. <variable> <value>
|
4
4
|
. --------------------------------------------------
|
5
5
|
|
6
|
-
.variables view
|
6
|
+
.variables view ../settings/view.txt
|
7
7
|
|
8
|
-
.variables recent
|
8
|
+
.variables recent ../settings/recent.txt
|
9
9
|
|
10
|
-
.variables publish
|
10
|
+
.variables publish ../settings/publish.txt
|
11
11
|
|
12
12
|
.variables
|
13
13
|
host http://SITE
|
data/data/universal.lt3
CHANGED
File without changes
|
@@ -0,0 +1,209 @@
|
|
1
|
+
.highlight table td { padding: 5px; }
|
2
|
+
.highlight table pre { margin: 0; }
|
3
|
+
.highlight .cm {
|
4
|
+
color: #999988;
|
5
|
+
font-style: italic;
|
6
|
+
}
|
7
|
+
.highlight .cp {
|
8
|
+
color: #999999;
|
9
|
+
font-weight: bold;
|
10
|
+
}
|
11
|
+
.highlight .c1 {
|
12
|
+
color: #999988;
|
13
|
+
font-style: italic;
|
14
|
+
}
|
15
|
+
.highlight .cs {
|
16
|
+
color: #999999;
|
17
|
+
font-weight: bold;
|
18
|
+
font-style: italic;
|
19
|
+
}
|
20
|
+
.highlight .c, .highlight .ch, .highlight .cd, .highlight .cpf {
|
21
|
+
color: #999988;
|
22
|
+
font-style: italic;
|
23
|
+
}
|
24
|
+
.highlight .err {
|
25
|
+
color: #a61717;
|
26
|
+
background-color: #e3d2d2;
|
27
|
+
}
|
28
|
+
.highlight .gd {
|
29
|
+
color: #000000;
|
30
|
+
background-color: #ffdddd;
|
31
|
+
}
|
32
|
+
.highlight .ge {
|
33
|
+
color: #000000;
|
34
|
+
font-style: italic;
|
35
|
+
}
|
36
|
+
.highlight .gr {
|
37
|
+
color: #aa0000;
|
38
|
+
}
|
39
|
+
.highlight .gh {
|
40
|
+
color: #999999;
|
41
|
+
}
|
42
|
+
.highlight .gi {
|
43
|
+
color: #000000;
|
44
|
+
background-color: #ddffdd;
|
45
|
+
}
|
46
|
+
.highlight .go {
|
47
|
+
color: #888888;
|
48
|
+
}
|
49
|
+
.highlight .gp {
|
50
|
+
color: #555555;
|
51
|
+
}
|
52
|
+
.highlight .gs {
|
53
|
+
font-weight: bold;
|
54
|
+
}
|
55
|
+
.highlight .gu {
|
56
|
+
color: #aaaaaa;
|
57
|
+
}
|
58
|
+
.highlight .gt {
|
59
|
+
color: #aa0000;
|
60
|
+
}
|
61
|
+
.highlight .kc {
|
62
|
+
color: #000000;
|
63
|
+
font-weight: bold;
|
64
|
+
}
|
65
|
+
.highlight .kd {
|
66
|
+
color: #000000;
|
67
|
+
font-weight: bold;
|
68
|
+
}
|
69
|
+
.highlight .kn {
|
70
|
+
color: #000000;
|
71
|
+
font-weight: bold;
|
72
|
+
}
|
73
|
+
.highlight .kp {
|
74
|
+
color: #000000;
|
75
|
+
font-weight: bold;
|
76
|
+
}
|
77
|
+
.highlight .kr {
|
78
|
+
color: #000000;
|
79
|
+
font-weight: bold;
|
80
|
+
}
|
81
|
+
.highlight .kt {
|
82
|
+
color: #445588;
|
83
|
+
font-weight: bold;
|
84
|
+
}
|
85
|
+
.highlight .k, .highlight .kv {
|
86
|
+
color: #000000;
|
87
|
+
font-weight: bold;
|
88
|
+
}
|
89
|
+
.highlight .mf {
|
90
|
+
color: #009999;
|
91
|
+
}
|
92
|
+
.highlight .mh {
|
93
|
+
color: #009999;
|
94
|
+
}
|
95
|
+
.highlight .il {
|
96
|
+
color: #009999;
|
97
|
+
}
|
98
|
+
.highlight .mi {
|
99
|
+
color: #009999;
|
100
|
+
}
|
101
|
+
.highlight .mo {
|
102
|
+
color: #009999;
|
103
|
+
}
|
104
|
+
.highlight .m, .highlight .mb, .highlight .mx {
|
105
|
+
color: #009999;
|
106
|
+
}
|
107
|
+
.highlight .sb {
|
108
|
+
color: #d14;
|
109
|
+
}
|
110
|
+
.highlight .sc {
|
111
|
+
color: #d14;
|
112
|
+
}
|
113
|
+
.highlight .sd {
|
114
|
+
color: #d14;
|
115
|
+
}
|
116
|
+
.highlight .s2 {
|
117
|
+
color: #d14;
|
118
|
+
}
|
119
|
+
.highlight .se {
|
120
|
+
color: #d14;
|
121
|
+
}
|
122
|
+
.highlight .sh {
|
123
|
+
color: #d14;
|
124
|
+
}
|
125
|
+
.highlight .si {
|
126
|
+
color: #d14;
|
127
|
+
}
|
128
|
+
.highlight .sx {
|
129
|
+
color: #d14;
|
130
|
+
}
|
131
|
+
.highlight .sr {
|
132
|
+
color: #009926;
|
133
|
+
}
|
134
|
+
.highlight .s1 {
|
135
|
+
color: #d14;
|
136
|
+
}
|
137
|
+
.highlight .ss {
|
138
|
+
color: #990073;
|
139
|
+
}
|
140
|
+
.highlight .s, .highlight .sa, .highlight .dl {
|
141
|
+
color: #d14;
|
142
|
+
}
|
143
|
+
.highlight .na {
|
144
|
+
color: #008080;
|
145
|
+
}
|
146
|
+
.highlight .bp {
|
147
|
+
color: #999999;
|
148
|
+
}
|
149
|
+
.highlight .nb {
|
150
|
+
color: #0086B3;
|
151
|
+
}
|
152
|
+
.highlight .nc {
|
153
|
+
color: #445588;
|
154
|
+
font-weight: bold;
|
155
|
+
}
|
156
|
+
.highlight .no {
|
157
|
+
color: #008080;
|
158
|
+
}
|
159
|
+
.highlight .nd {
|
160
|
+
color: #3c5d5d;
|
161
|
+
font-weight: bold;
|
162
|
+
}
|
163
|
+
.highlight .ni {
|
164
|
+
color: #800080;
|
165
|
+
}
|
166
|
+
.highlight .ne {
|
167
|
+
color: #990000;
|
168
|
+
font-weight: bold;
|
169
|
+
}
|
170
|
+
.highlight .nf, .highlight .fm {
|
171
|
+
color: #990000;
|
172
|
+
font-weight: bold;
|
173
|
+
}
|
174
|
+
.highlight .nl {
|
175
|
+
color: #990000;
|
176
|
+
font-weight: bold;
|
177
|
+
}
|
178
|
+
.highlight .nn {
|
179
|
+
color: #555555;
|
180
|
+
}
|
181
|
+
.highlight .nt {
|
182
|
+
color: #000080;
|
183
|
+
}
|
184
|
+
.highlight .vc {
|
185
|
+
color: #008080;
|
186
|
+
}
|
187
|
+
.highlight .vg {
|
188
|
+
color: #008080;
|
189
|
+
}
|
190
|
+
.highlight .vi {
|
191
|
+
color: #008080;
|
192
|
+
}
|
193
|
+
.highlight .nv, .highlight .vm {
|
194
|
+
color: #008080;
|
195
|
+
}
|
196
|
+
.highlight .ow {
|
197
|
+
color: #000000;
|
198
|
+
font-weight: bold;
|
199
|
+
}
|
200
|
+
.highlight .o {
|
201
|
+
color: #000000;
|
202
|
+
font-weight: bold;
|
203
|
+
}
|
204
|
+
.highlight .w {
|
205
|
+
color: #bbbbbb;
|
206
|
+
}
|
207
|
+
.highlight {
|
208
|
+
background-color: #f8f8f8;
|
209
|
+
}.highlight { font-family: courier; white-space: pre }
|