runeblog 0.0.98 → 0.0.99
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/helpers-repl.rb +8 -6
- data/lib/repl.rb +13 -1
- data/lib/runeblog.rb +1 -1
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8ca7a1a5515f21e6880a0cdff3e457f011cb4ca6ea7f0ec23993eb97dfd702ad
|
4
|
+
data.tar.gz: aaf0eb76d040a016b770b172b46ae86e8aefb7a472c774ad3e13c9f0e8a2674e
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f9f7555b55d88811979ac194df82d099c614dcecf50b3462417599e66dc4b7b48487d0de38aa0fba6d9b5910f66751b504799cc37135091ee738900735c2c568
|
7
|
+
data.tar.gz: 42117eccfeb07b905eab195eaebd6e9313c69ffb79ffbee1978e765f7de74648e09ab9c2c15084abd0e0dc84b2c2c14c9ead35c1e7d8041c4718cff0a1028767
|
data/lib/helpers-repl.rb
CHANGED
@@ -25,6 +25,8 @@ module RuneBlog::REPL
|
|
25
25
|
"cv $name" => :cmd_change_view,
|
26
26
|
"cv" => :cmd_change_view, # 0-arity must come second
|
27
27
|
|
28
|
+
"config" => :cmd_config,
|
29
|
+
|
28
30
|
"list posts" => :cmd_list_posts,
|
29
31
|
"lsp" => :cmd_list_posts,
|
30
32
|
|
@@ -211,25 +213,25 @@ module RuneBlog::REPL
|
|
211
213
|
RuneBlog::Publishing.new(user, server, root, path, proto)
|
212
214
|
end
|
213
215
|
|
214
|
-
def dumb_menu(
|
216
|
+
def dumb_menu(array)
|
215
217
|
# { string => :meth, ... }
|
216
|
-
max =
|
218
|
+
max = array.size
|
217
219
|
puts "\n Select from:" # CHANGE_FOR_CURSES?
|
218
|
-
|
219
|
-
string, meth = *pair
|
220
|
+
array.each.with_index do |string, i|
|
220
221
|
puts " #{red('%2d' % (i+1))} #{string}" # CHANGE_FOR_CURSES?
|
221
222
|
end
|
223
|
+
picked = nil
|
222
224
|
loop do
|
223
225
|
print red("> ") # CHANGE_FOR_CURSES?
|
224
226
|
num = gets.to_i
|
225
227
|
if num.between?(1, max)
|
226
|
-
picked =
|
227
|
-
puts "Calling number #{num} (#{picked})..." # CHANGE_FOR_CURSES?
|
228
|
+
picked = array[num-1]
|
228
229
|
break
|
229
230
|
else
|
230
231
|
puts "Huh? Must be 1 to #{max}" # CHANGE_FOR_CURSES?
|
231
232
|
end
|
232
233
|
end
|
234
|
+
picked
|
233
235
|
end
|
234
236
|
|
235
237
|
### find_asset
|
data/lib/repl.rb
CHANGED
@@ -20,7 +20,19 @@ module RuneBlog::REPL
|
|
20
20
|
return @out
|
21
21
|
end
|
22
22
|
|
23
|
-
def
|
23
|
+
def cmd_config(arg)
|
24
|
+
check_empty(arg)
|
25
|
+
dir = @blog.view.dir
|
26
|
+
items = ["publish",
|
27
|
+
"custom/blog_header.html",
|
28
|
+
"custom/blog_trailer.html",
|
29
|
+
"custom/post_template.html"]
|
30
|
+
puts "\nEdit which file?" # FIXME use @out for testing later
|
31
|
+
fname = dumb_menu(items)
|
32
|
+
system("#{@blog.editor} #{dir}/#{fname}")
|
33
|
+
end
|
34
|
+
|
35
|
+
def cmd_browse(arg)
|
24
36
|
reset_output
|
25
37
|
check_empty(arg)
|
26
38
|
url = @blog.view.publisher.url
|
data/lib/runeblog.rb
CHANGED
data/lib/version.rb
CHANGED