runeblog 0.2.33 → 0.2.34
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +1 -1
- data/empty_view.tgz +0 -0
- data/lib/helpers-repl.rb +2 -6
- data/lib/repl.rb +14 -35
- data/lib/runeblog.rb +8 -6
- data/lib/runeblog_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: 31cb042c2e6bebe0faa230063ffafe7ee7c43a8a0cf0011d9600657a0caa3f04
|
4
|
+
data.tar.gz: cc1c14af581ec7b3817b4e73556778bd4a483fc676be5f7a051df250bfb17be4
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c6be26fb941033a3d737a17825ef64b5f3fbb188d227b4f5f6f22eff1e5a98cfc35857218f75ed5b0e6377cfd99c6df79f20853b3c602195c58a54e4aca681fe
|
7
|
+
data.tar.gz: 981e83cbaeeb52325c3c60f134b5e8d637907729e2ad8b8119fe2460599c9cf9668c762b8d24110c44c98fc78074c49c89d3bec3e8d3770f370f685810cc8f89
|
data/bin/blog
CHANGED
data/empty_view.tgz
CHANGED
Binary file
|
data/lib/helpers-repl.rb
CHANGED
@@ -18,7 +18,6 @@ module RuneBlog::REPL
|
|
18
18
|
|
19
19
|
"new view $name" => :cmd_new_view,
|
20
20
|
|
21
|
-
# "customize" => :cmd_customize,
|
22
21
|
"tags" => :cmd_tags,
|
23
22
|
"import" => :cmd_import,
|
24
23
|
|
@@ -41,11 +40,9 @@ module RuneBlog::REPL
|
|
41
40
|
"list assets" => :cmd_list_assets,
|
42
41
|
"lsa" => :cmd_list_assets,
|
43
42
|
|
44
|
-
"
|
43
|
+
"delete >postid" => :cmd_remove_post,
|
45
44
|
"undel $postid" => :cmd_undelete_post,
|
46
45
|
|
47
|
-
"kill >postid" => :cmd_kill,
|
48
|
-
|
49
46
|
"edit $postid" => :cmd_edit_post,
|
50
47
|
"ed $postid" => :cmd_edit_post,
|
51
48
|
"e $postid" => :cmd_edit_post,
|
@@ -54,8 +51,6 @@ module RuneBlog::REPL
|
|
54
51
|
|
55
52
|
"browse" => :cmd_browse,
|
56
53
|
|
57
|
-
"relink" => :cmd_relink,
|
58
|
-
|
59
54
|
"rebuild" => :cmd_rebuild,
|
60
55
|
|
61
56
|
"publish" => :cmd_publish,
|
@@ -108,6 +103,7 @@ module RuneBlog::REPL
|
|
108
103
|
end
|
109
104
|
meth = found || :cmd_INVALID
|
110
105
|
params = cmd if meth == :cmd_INVALID
|
106
|
+
puts "choose: #{[meth, params].inspect}"
|
111
107
|
[meth, params]
|
112
108
|
end
|
113
109
|
|
data/lib/repl.rb
CHANGED
@@ -131,23 +131,7 @@ module RuneBlog::REPL
|
|
131
131
|
reset_output
|
132
132
|
check_empty(arg)
|
133
133
|
puts unless testing
|
134
|
-
|
135
|
-
if files.empty?
|
136
|
-
msg = "No files changed"
|
137
|
-
output! msg
|
138
|
-
puts "\n #{msg}\n " unless testing
|
139
|
-
return @out
|
140
|
-
end
|
141
|
-
files.each {|file| @blog.rebuild_post(file) }
|
142
|
-
@blog.dirty_views.each {|view| generate_index(view) } # All views for now?
|
143
|
-
File.write("#{@blog.root}/drafts/last_rebuild", Time.now)
|
144
|
-
@out
|
145
|
-
end
|
146
|
-
|
147
|
-
def cmd_relink(arg, testing = false)
|
148
|
-
reset_output
|
149
|
-
check_empty(arg)
|
150
|
-
@blog.relink
|
134
|
+
@blog.generate_view(@blog.view)
|
151
135
|
@out
|
152
136
|
end
|
153
137
|
|
@@ -195,12 +179,19 @@ module RuneBlog::REPL
|
|
195
179
|
puts err.backtrace.join("\n")
|
196
180
|
end
|
197
181
|
|
198
|
-
def
|
182
|
+
def _remove_post(arg, testing=false)
|
183
|
+
id = get_integer(arg)
|
184
|
+
result = @blog.remove_post(id)
|
185
|
+
puts "Post #{id} not found" if result.nil?
|
186
|
+
end
|
187
|
+
|
188
|
+
def cmd_remove_post(arg, testing = false)
|
189
|
+
puts "arg = #{arg.inspect} is a #{arg.class}"
|
199
190
|
reset_output
|
200
191
|
args = arg.split
|
201
192
|
args.each do |x|
|
202
193
|
# FIXME
|
203
|
-
ret =
|
194
|
+
ret = _remove_post(x.to_i, false)
|
204
195
|
puts ret
|
205
196
|
output ret
|
206
197
|
end
|
@@ -209,16 +200,6 @@ module RuneBlog::REPL
|
|
209
200
|
|
210
201
|
#-- FIXME affects linking, building, publishing...
|
211
202
|
|
212
|
-
def cmd_remove_post(arg, testing = false)
|
213
|
-
reset_output
|
214
|
-
id = get_integer(arg)
|
215
|
-
result = @blog.remove_post(id)
|
216
|
-
output! "Post #{id} not found" if result.nil?
|
217
|
-
@out
|
218
|
-
end
|
219
|
-
|
220
|
-
#-- FIXME affects linking, building, publishing...
|
221
|
-
|
222
203
|
def cmd_edit_post(arg, testing = false)
|
223
204
|
reset_output
|
224
205
|
id = get_integer(arg)
|
@@ -357,26 +338,24 @@ module RuneBlog::REPL
|
|
357
338
|
list views List all views available
|
358
339
|
lsv Same as: list views
|
359
340
|
|
360
|
-
|
361
|
-
|
341
|
+
* config Edit the publish file or the templates
|
342
|
+
* customize (BUGGY) Change set of tags, extra views
|
362
343
|
|
363
344
|
p, post Create a new post
|
364
345
|
new post Same as post (create a post)
|
365
346
|
|
366
|
-
|
347
|
+
* import ASSETS Import assets (images, etc.)
|
367
348
|
|
368
349
|
lsp, list posts List posts in current view
|
369
350
|
|
370
351
|
lsd, list drafts List all posts regardless of view
|
371
352
|
|
372
|
-
|
373
|
-
kill ID ID ID... Remove multiple posts
|
353
|
+
delete ID [ID...] Remove multiple posts
|
374
354
|
undelete ID Undelete a post
|
375
355
|
edit ID Edit a post
|
376
356
|
|
377
357
|
preview Look at current (local) view in browser
|
378
358
|
browse Look at current (published) view in browser
|
379
|
-
relink Regenerate index for all views
|
380
359
|
rebuild Regenerate all posts and relink
|
381
360
|
publish Publish (current view)
|
382
361
|
ssh Login to remote server
|
data/lib/runeblog.rb
CHANGED
@@ -296,6 +296,7 @@ class RuneBlog
|
|
296
296
|
log!(enter: __method__, args: [slug])
|
297
297
|
id = slug.to_i
|
298
298
|
text = nil
|
299
|
+
@theme = @view.dir/"themes/standard"
|
299
300
|
post_entry_name = @theme/"blog/post_entry.lt3"
|
300
301
|
xlate src: post_entry_name, dst: "/tmp/post_entry.html" # , debug: true
|
301
302
|
@_post_entry ||= File.read("/tmp/post_entry.html")
|
@@ -397,12 +398,17 @@ class RuneBlog
|
|
397
398
|
log!(enter: __method__, args: [view])
|
398
399
|
generate_index(view) # recent posts (recent.html)
|
399
400
|
vdir = @root/:views/view
|
401
|
+
@theme = @root/:views/view/:themes/:standard
|
400
402
|
xlate cwd: vdir/"themes/standard/etc",
|
401
403
|
src: "blog.css.lt3", copy: vdir/"remote/etc/blog.css" # , debug: true
|
402
404
|
xlate cwd: vdir/"themes/standard",
|
403
405
|
src: "blog/generate.lt3", dst: vdir/:remote/"index.html"
|
404
406
|
copy("#{vdir}/assets/*", "#{vdir}/remote/assets/")
|
405
|
-
|
407
|
+
rescue => err
|
408
|
+
puts err
|
409
|
+
puts err.backtrace.join("\n")
|
410
|
+
print "Pause... "
|
411
|
+
gets
|
406
412
|
end
|
407
413
|
|
408
414
|
def _get_views(draft)
|
@@ -494,11 +500,6 @@ class RuneBlog
|
|
494
500
|
end
|
495
501
|
end
|
496
502
|
|
497
|
-
def relink # FIXME no longer used?
|
498
|
-
log!(enter: __method__)
|
499
|
-
self.views.each {|view| generate_index(view) }
|
500
|
-
end
|
501
|
-
|
502
503
|
def index_entry(view, meta)
|
503
504
|
log!(enter: __method__, args: [view, meta])
|
504
505
|
debug "=== index_entry #{view.to_s.inspect} #{meta.num} #{meta.title.inspect}"
|
@@ -538,6 +539,7 @@ class RuneBlog
|
|
538
539
|
def remove_post(num)
|
539
540
|
log!(enter: __method__, args: [num])
|
540
541
|
raise ArgumentError unless num.is_a?(Integer)
|
542
|
+
# FIXME update original draft .views
|
541
543
|
tag = prefix(num)
|
542
544
|
files = Find.find(self.view.dir).to_a
|
543
545
|
list = files.select {|x| File.directory?(x) and x =~ /#{tag}/ }
|
data/lib/runeblog_version.rb
CHANGED