runeblog 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/bin/blog +2 -1
- data/lib/helpers-blog.rb +1 -0
- data/lib/helpers-repl.rb +20 -31
- data/lib/publish.rb +1 -1
- data/lib/repl.rb +24 -21
- data/lib/runeblog.rb +2 -0
- data/lib/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: c8624c0cbf8355cc824d03ff97e2b60cd04e871bde7394731535e32504aa05ee
|
4
|
+
data.tar.gz: 0f5323f78c46f801000269eff914eb024d2f8539b44531822d779c1549581f95
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5cae9b867b30214856bb457b9cfc7d434691dc24aaeda63505d96c2377251e2280f28638dbd33360c762b41eb9d9ab8f6997170b9cea8db5921e8580e46347a9
|
7
|
+
data.tar.gz: 824f8c428bed47e17bd373f63c4a69644d80d13277083a738ec635bf7ace2b836d7d96beac1b6119e46c0a70e27d929a5c4e197699687f603794c5beab048c58
|
data/bin/blog
CHANGED
@@ -20,7 +20,7 @@ end
|
|
20
20
|
|
21
21
|
def mainloop
|
22
22
|
print fx("blog> ", Red)
|
23
|
-
cmd = STDSCR.gets
|
23
|
+
cmd = STDSCR.gets(history: @cmdhist)
|
24
24
|
cmd_quit(nil) if cmd.nil? # ^D
|
25
25
|
cmd.chomp!
|
26
26
|
return if cmd.empty? # CR does nothing
|
@@ -56,6 +56,7 @@ end
|
|
56
56
|
|
57
57
|
if cmd.nil? # REPL
|
58
58
|
puts fx("\n RuneBlog", :bold), fx(" v #{RuneBlog::VERSION}\n", Red)
|
59
|
+
@cmdhist = []
|
59
60
|
loop { mainloop }
|
60
61
|
sleep 0.2
|
61
62
|
system("tput clear")
|
data/lib/helpers-blog.rb
CHANGED
data/lib/helpers-repl.rb
CHANGED
@@ -272,36 +272,25 @@ module RuneBlog::REPL
|
|
272
272
|
|
273
273
|
### find_asset
|
274
274
|
|
275
|
-
#
|
276
|
-
# # STDERR.puts "repl find_asset: @meta = #{@meta.inspect}"
|
277
|
-
# views = @meta.views
|
278
|
-
# views.each do |view|
|
279
|
-
# vdir = @config.viewdir(view)
|
280
|
-
# post_dir = "#{vdir}#{@meta.slug}/assets/"
|
281
|
-
# path = post_dir + asset
|
282
|
-
# STDERR.puts " Seeking #{path}"
|
283
|
-
# return path if File.exist?(path)
|
284
|
-
# end
|
285
|
-
# views.each do |view|
|
286
|
-
# dir = @config.viewdir(view) + "/assets/"
|
287
|
-
# path = dir + asset
|
288
|
-
# STDERR.puts " Seeking #{path}"
|
289
|
-
# return path if File.exist?(path)
|
290
|
-
# end
|
291
|
-
# top = @root + "/assets/"
|
292
|
-
# path = top + asset
|
293
|
-
# STDERR.puts " Seeking #{path}"
|
294
|
-
# return path if File.exist?(path)
|
295
|
-
#
|
296
|
-
# return nil
|
297
|
-
# end
|
298
|
-
#
|
299
|
-
# ### find_all_assets
|
300
|
-
#
|
301
|
-
# def find_all_assets(list, views)
|
302
|
-
# # STDERR.puts "\n Called find_all_assets with #{list.inspect}"
|
303
|
-
# list ||= []
|
304
|
-
# list.each {|asset| puts "#{asset} => #{find_asset(asset, views)}" }
|
305
|
-
# end
|
275
|
+
# FIXME is this per-post?
|
306
276
|
|
277
|
+
def find_asset(asset_name) # , views)
|
278
|
+
search_path = proc do |path|
|
279
|
+
full_path = path + asset_name
|
280
|
+
return full_path if File.exist?(full_path)
|
281
|
+
end
|
282
|
+
views = @meta.views
|
283
|
+
views.each do |view| search_path.call("#{view.dir}/#{@meta.slug}/assets/") end
|
284
|
+
views.each do |view| search_path.call(view.dir + "/assets/") end
|
285
|
+
search_path.call(@root + "/assets/", asset_name)
|
286
|
+
# If all fail... return nil
|
287
|
+
return nil
|
288
|
+
end
|
289
|
+
|
290
|
+
### find_all_assets
|
291
|
+
|
292
|
+
def find_all_assets(list, views)
|
293
|
+
list ||= []
|
294
|
+
list.each {|asset| puts "#{asset} => #{find_asset(asset, views)}" }
|
295
|
+
end
|
307
296
|
end
|
data/lib/publish.rb
CHANGED
data/lib/repl.rb
CHANGED
@@ -69,37 +69,41 @@ module RuneBlog::REPL
|
|
69
69
|
end
|
70
70
|
|
71
71
|
def cmd_publish(arg) # FIXME non-string return expected in caller?
|
72
|
+
puts
|
72
73
|
reset_output
|
73
74
|
check_empty(arg)
|
74
75
|
unless @blog.view.can_publish?
|
76
|
+
puts "Can't publish without entries in #{@blog.view.name}/publish"
|
75
77
|
output! "Can't publish without entries in #{@blog.view.name}/publish"
|
76
|
-
return [
|
77
|
-
end
|
78
|
-
@blog.view.publish
|
79
|
-
user, server, sroot, spath = *@publish[@blog.view]
|
80
|
-
if files.empty? # FIXME baloney
|
81
|
-
output! "No files to publish"
|
82
|
-
return [true, @out]
|
78
|
+
return [false, @out]
|
83
79
|
end
|
84
|
-
|
85
|
-
|
86
|
-
|
87
|
-
|
88
|
-
|
89
|
-
|
90
|
-
|
91
|
-
|
92
|
-
|
93
|
-
|
94
|
-
|
95
|
-
|
80
|
+
RubyText.spinner { @blog.view.publish }
|
81
|
+
# user, server, sroot, spath = *@publish[@blog.view]
|
82
|
+
# if files.empty? # FIXME baloney
|
83
|
+
# output! "No files to publish"
|
84
|
+
# return [true, @out]
|
85
|
+
# end
|
86
|
+
|
87
|
+
# output "Files:"
|
88
|
+
# files.each {|f| output " #{f}\n" }
|
89
|
+
# output_newline
|
90
|
+
# dir = "#{sroot}/#{spath}"
|
91
|
+
# # FIXME - may or may not already exist
|
92
|
+
# result = system("ssh root@#{server} mkdir -p #{dir}")
|
93
|
+
#
|
94
|
+
# cmd = "scp -r #{files.join(' ')} root@#{server}:#{dir} >/dev/null 2>&1"
|
95
|
+
# output! "Publishing #{files.size} files...\n"
|
96
|
+
# result = system(cmd)
|
97
|
+
# raise PublishError unless result
|
96
98
|
|
97
99
|
dump(files, "#{vdir}/last_published")
|
100
|
+
puts " ...finished"
|
98
101
|
output! "...finished.\n"
|
99
|
-
return [
|
102
|
+
return [false, @out]
|
100
103
|
end
|
101
104
|
|
102
105
|
def cmd_rebuild(arg)
|
106
|
+
debug "Starting cmd_rebuild..."
|
103
107
|
reset_output
|
104
108
|
check_empty(arg)
|
105
109
|
puts # CHANGE_FOR_CURSES?
|
@@ -201,7 +205,6 @@ module RuneBlog::REPL
|
|
201
205
|
check_empty(arg)
|
202
206
|
puts
|
203
207
|
@blog.views.each do |v|
|
204
|
-
debug "v = #{v.inspect}"
|
205
208
|
v = v.to_s
|
206
209
|
v = fx(v, :bold) if v == @blog.view.name
|
207
210
|
print " "
|
data/lib/runeblog.rb
CHANGED
@@ -298,6 +298,7 @@ class RuneBlog
|
|
298
298
|
end
|
299
299
|
|
300
300
|
def rebuild_post(file)
|
301
|
+
debug "Called rebuild_post(#{file.inspect})"
|
301
302
|
raise ArgumentError unless file.is_a?(String)
|
302
303
|
@meta = process_post(file)
|
303
304
|
@meta.views.each do |view|
|
@@ -350,6 +351,7 @@ class RuneBlog
|
|
350
351
|
end
|
351
352
|
|
352
353
|
def make_slug(title, postnum = nil)
|
354
|
+
debug "title = #{title.inspect} (#{title.class})"
|
353
355
|
raise ArgumentError unless title.is_a?(String)
|
354
356
|
postnum ||= self.next_sequence
|
355
357
|
num = '%04d' % postnum # FIXME can do better
|
data/lib/version.rb
CHANGED
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.11
|
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-20 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
74
74
|
version: '0'
|
75
75
|
requirements: []
|
76
76
|
rubyforge_project:
|
77
|
-
rubygems_version: 2.
|
77
|
+
rubygems_version: 2.7.7
|
78
78
|
signing_key:
|
79
79
|
specification_version: 4
|
80
80
|
summary: A command-line blogging system
|