runeblog 0.1.5 → 0.1.6
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +2 -5
- data/lib/helpers-blog.rb +7 -2
- data/lib/post.rb +1 -1
- data/lib/publish.rb +2 -0
- data/lib/repl.rb +9 -3
- data/lib/runeblog.rb +4 -3
- data/lib/version.rb +1 -1
- data/lib/view.rb +4 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 37a61dd4695c47ded548fbb1f3aecf99a644eb63331a0f21df3e573a4ce1c23a
|
4
|
+
data.tar.gz: 8f6aa0e0ad310368a032db1d77f1110611f0f0b05ca01bb6341e4cf3be94ca5b
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f8d304963d27109c3bda13d780d414233a2e1d94547ab1b906cb9c818df68521960dcb2fa06756de9b6b90ebab08d5d85185ca6a6a055855980a4688a75d9389
|
7
|
+
data.tar.gz: eb0e1805f3b02bd08a4e670f05a833cd68fd2492565414d493e93b6d29482c4fac52ec7d0f902c16b33e0c4916217c423511c32a0b133427d39fd65cd1d455ef
|
data/bin/blog
CHANGED
@@ -39,12 +39,9 @@ end
|
|
39
39
|
|
40
40
|
###########
|
41
41
|
|
42
|
-
RubyText.start(log: "blogcmd.txt", fg: Blue, bg: White)
|
43
|
-
RubyText.set(:_echo)
|
42
|
+
RubyText.start(:_echo, :keypad, scroll: true, log: "blogcmd.txt", fg: Blue, bg: White)
|
44
43
|
|
45
|
-
|
46
|
-
|
47
|
-
STDOUT.sync = true
|
44
|
+
# STDOUT.sync = true
|
48
45
|
|
49
46
|
cmd, arg = get_argv
|
50
47
|
|
data/lib/helpers-blog.rb
CHANGED
@@ -19,7 +19,7 @@ module RuneBlog::Helpers
|
|
19
19
|
return vals
|
20
20
|
rescue => err
|
21
21
|
puts "Something hit the fan: #{err}" # CHANGE_FOR_CURSES?
|
22
|
-
puts err.backtrace # CHANGE_FOR_CURSES?
|
22
|
+
puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
|
23
23
|
exit
|
24
24
|
end
|
25
25
|
|
@@ -82,7 +82,7 @@ module RuneBlog::Helpers
|
|
82
82
|
def error(err) # Hmm, this is duplicated
|
83
83
|
str = "\n Error: #{err}"
|
84
84
|
puts str # CHANGE_FOR_CURSES?
|
85
|
-
puts err.backtrace # CHANGE_FOR_CURSES?
|
85
|
+
puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
|
86
86
|
end
|
87
87
|
|
88
88
|
def dump(obj, name)
|
@@ -90,3 +90,8 @@ module RuneBlog::Helpers
|
|
90
90
|
end
|
91
91
|
|
92
92
|
end
|
93
|
+
|
94
|
+
def dump(obj, name) # FIXME scope
|
95
|
+
File.write(name, obj)
|
96
|
+
end
|
97
|
+
|
data/lib/post.rb
CHANGED
data/lib/publish.rb
CHANGED
@@ -30,12 +30,14 @@ class RuneBlog::Publishing
|
|
30
30
|
end
|
31
31
|
|
32
32
|
def publish(files)
|
33
|
+
debug "files = #{files.inspect}"
|
33
34
|
reset_output
|
34
35
|
dir = "#@docroot/#@path"
|
35
36
|
result = system("ssh #@user@#@server -x mkdir #{dir}")
|
36
37
|
list = files.join(' ')
|
37
38
|
cmd = "scp -r #{list} #@user@#@server:#{dir} >/dev/null 2>/tmp/wtf"
|
38
39
|
output! "Publishing #{files.size} files...\n"
|
40
|
+
debug "cmd = #{cmd.inspect} - see /tmp/wtf"
|
39
41
|
result = system(cmd)
|
40
42
|
raise PublishError unless result
|
41
43
|
|
data/lib/repl.rb
CHANGED
@@ -8,7 +8,7 @@ make_exception(:PublishError, "Error during publishing")
|
|
8
8
|
module RuneBlog::REPL
|
9
9
|
|
10
10
|
def edit_file(file)
|
11
|
-
result = system("#{blog.editor} #{file}")
|
11
|
+
result = system("#{@blog.editor} #{file}")
|
12
12
|
raise EditorProblem(file) unless result
|
13
13
|
STDSCR.clear
|
14
14
|
end
|
@@ -119,15 +119,20 @@ module RuneBlog::REPL
|
|
119
119
|
reset_output
|
120
120
|
# Simplify this
|
121
121
|
if arg.nil?
|
122
|
+
viewnames = @blog.views.map {|x| x.name }
|
123
|
+
n = viewnames.find_index(@blog.view.name)
|
124
|
+
k, name = RubyText.menu(c: 30, items: viewnames, curr: n)
|
125
|
+
@blog.view = name
|
122
126
|
output bold(@blog.view)
|
123
|
-
|
127
|
+
puts "\n ", fx(name, :bold), "\n"
|
128
|
+
return [false, @out]
|
124
129
|
else
|
125
130
|
if @blog.view?(arg)
|
126
131
|
@blog.view = arg # reads config
|
127
132
|
output red("View: ") + bold(@blog.view.name.to_s) # FIXME?
|
128
133
|
end
|
129
134
|
end
|
130
|
-
return [
|
135
|
+
return [false, @out]
|
131
136
|
end
|
132
137
|
|
133
138
|
def cmd_new_view(arg)
|
@@ -196,6 +201,7 @@ module RuneBlog::REPL
|
|
196
201
|
check_empty(arg)
|
197
202
|
puts
|
198
203
|
@blog.views.each do |v|
|
204
|
+
debug "v = #{v.inspect}"
|
199
205
|
v = v.to_s
|
200
206
|
v = fx(v, :bold) if v == @blog.view.name
|
201
207
|
print " "
|
data/lib/runeblog.rb
CHANGED
@@ -52,7 +52,7 @@ class RuneBlog
|
|
52
52
|
blog.create_view("test_view")
|
53
53
|
rescue => err
|
54
54
|
puts "Can't create blog: '#{dir}' - #{err}" # CHANGE_FOR_CURSES?
|
55
|
-
puts err.backtrace # CHANGE_FOR_CURSES?
|
55
|
+
puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
|
56
56
|
end
|
57
57
|
|
58
58
|
def initialize # assumes existing blog
|
@@ -85,12 +85,12 @@ class RuneBlog
|
|
85
85
|
case arg
|
86
86
|
when RuneBlog::View
|
87
87
|
@view = arg
|
88
|
-
@view.publisher = read_config(@view.dir + "/publish")
|
88
|
+
@view.publisher = RuneBlog::Publishing.new(read_config(@view.dir + "/publish"))
|
89
89
|
when String
|
90
90
|
new_view = str2view(arg)
|
91
91
|
raise NoSuchView(arg) if new_view.nil?
|
92
92
|
@view = new_view
|
93
|
-
@view.publisher = read_config(@view.dir + "/publish")
|
93
|
+
@view.publisher = RuneBlog::Publishing.new(read_config(@view.dir + "/publish"))
|
94
94
|
else
|
95
95
|
raise CantAssignView(arg.class.to_s)
|
96
96
|
end
|
@@ -174,6 +174,7 @@ class RuneBlog
|
|
174
174
|
post.num
|
175
175
|
rescue => err
|
176
176
|
puts err # error(err) # CHANGE_FOR_CURSES?
|
177
|
+
puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
|
177
178
|
end
|
178
179
|
|
179
180
|
def edit_initial_post(file, testing = false)
|
data/lib/version.rb
CHANGED
data/lib/view.rb
CHANGED
@@ -34,9 +34,12 @@ class RuneBlog::View
|
|
34
34
|
def files(recent = false)
|
35
35
|
vdir = dir()
|
36
36
|
files = [index()]
|
37
|
+
debug "Looking in #{vdir}"
|
37
38
|
others = Dir.entries(vdir).grep(/^\d\d\d\d/)
|
38
39
|
files += others.map {|x| "#{vdir}/#{x}" }
|
39
|
-
|
40
|
+
debug "Found #{files.inspect}"
|
41
|
+
# files.reject! {|f| recent?(f) } if recent
|
42
|
+
debug "Now files = #{files.inspect}"
|
40
43
|
files
|
41
44
|
end
|
42
45
|
|
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.1.
|
4
|
+
version: 0.1.6
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2018-12-
|
11
|
+
date: 2018-12-12 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|