runeblog 0.0.42 → 0.0.43
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/VERSION +1 -1
- data/lib/repl.rb +61 -71
- data/lib/runeblog.rb +1 -1
- metadata +3 -4
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b3fbf51af336c1442a5aa62e13df695d2c2cd318
|
4
|
+
data.tar.gz: 4fa03ce9ff83cc6144cc580f346733b5b8d34916
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 30001b22c7851778c22b3cb7be20c5af16563e89408308f42d6813dfd70d8ddd3c384dc2a7d35feac71aa6bae8631cf938051b3f11254a28d3fe119134e2514f
|
7
|
+
data.tar.gz: 902447ebf5221a2130df2a1f504ab07bc086aee612af57479183e04042f963a8ef1edf9b5a041f5ae8d69b7eefd0bccc1bca24e9b9ef1effd5756dbbb32aa909
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.43 2018-07-31
|
data/lib/repl.rb
CHANGED
@@ -1,5 +1,7 @@
|
|
1
1
|
require 'runeblog'
|
2
2
|
|
3
|
+
require 'ostruct'
|
4
|
+
|
3
5
|
module RuneBlog::REPL
|
4
6
|
|
5
7
|
def clear
|
@@ -27,6 +29,14 @@ module RuneBlog::REPL
|
|
27
29
|
red(slug[0..3])+blue(slug[4..-1])
|
28
30
|
end
|
29
31
|
|
32
|
+
### error
|
33
|
+
|
34
|
+
def error(err, line, file)
|
35
|
+
str = "\n Error: (line #{line} of #{File.basename(file)}) "
|
36
|
+
str << err.to_s
|
37
|
+
puts red(str)
|
38
|
+
puts err.backtrace
|
39
|
+
end
|
30
40
|
|
31
41
|
### ask
|
32
42
|
|
@@ -67,8 +77,7 @@ module RuneBlog::REPL
|
|
67
77
|
end
|
68
78
|
end
|
69
79
|
rescue => err
|
70
|
-
|
71
|
-
puts err.backtrace
|
80
|
+
error(err, __LINE__, __FILE__)
|
72
81
|
end
|
73
82
|
|
74
83
|
### make_slug
|
@@ -92,8 +101,7 @@ module RuneBlog::REPL
|
|
92
101
|
@root = @config.root
|
93
102
|
@config
|
94
103
|
rescue => err
|
95
|
-
|
96
|
-
puts err.backtrace
|
104
|
+
error(err, __LINE__, __FILE__)
|
97
105
|
end
|
98
106
|
|
99
107
|
### create_empty_post
|
@@ -117,8 +125,7 @@ Remainder of post goes here.
|
|
117
125
|
File.open("#@root/src/#@fname", "w") {|f| f.puts @template }
|
118
126
|
@fname
|
119
127
|
rescue => err
|
120
|
-
|
121
|
-
puts err.backtrace
|
128
|
+
error(err, __LINE__, __FILE__)
|
122
129
|
end
|
123
130
|
|
124
131
|
### edit_initial_post
|
@@ -127,8 +134,7 @@ Remainder of post goes here.
|
|
127
134
|
result = system("vi #@root/src/#{file} +8 ")
|
128
135
|
raise "Problem editing #@root/src/#{file}" unless result
|
129
136
|
rescue => err
|
130
|
-
|
131
|
-
puts err.backtrace
|
137
|
+
error(err, __LINE__, __FILE__)
|
132
138
|
end
|
133
139
|
|
134
140
|
### open_remote
|
@@ -142,8 +148,7 @@ Remainder of post goes here.
|
|
142
148
|
result = system("open 'http://#{server}/#{spath}'")
|
143
149
|
raise "Problem opening http://#{server}/#{spath}" unless result
|
144
150
|
rescue => err
|
145
|
-
|
146
|
-
puts err.backtrace
|
151
|
+
error(err, __LINE__, __FILE__)
|
147
152
|
end
|
148
153
|
|
149
154
|
### open_local
|
@@ -152,8 +157,7 @@ Remainder of post goes here.
|
|
152
157
|
result = system("open #{@config.viewdir(@view)}/index.html")
|
153
158
|
raise "Problem opening #{@config.viewdir(@view)}/index.html" unless result
|
154
159
|
rescue => err
|
155
|
-
|
156
|
-
puts err.backtrace
|
160
|
+
error(err, __LINE__, __FILE__)
|
157
161
|
end
|
158
162
|
|
159
163
|
def deploy
|
@@ -186,8 +190,7 @@ Remainder of post goes here.
|
|
186
190
|
File.write("#{vdir}/last_deployed", files)
|
187
191
|
puts red("finished.")
|
188
192
|
rescue => err
|
189
|
-
|
190
|
-
puts err.backtrace
|
193
|
+
error(err, __LINE__, __FILE__)
|
191
194
|
end
|
192
195
|
|
193
196
|
### process_post
|
@@ -203,9 +206,7 @@ Remainder of post goes here.
|
|
203
206
|
@meta.slug = file.sub(/.lt3$/, "")
|
204
207
|
@meta
|
205
208
|
rescue => err
|
206
|
-
|
207
|
-
puts err.backtrace
|
208
|
-
puts
|
209
|
+
error(err, __LINE__, __FILE__)
|
209
210
|
end
|
210
211
|
|
211
212
|
### reload_post
|
@@ -217,7 +218,7 @@ Remainder of post goes here.
|
|
217
218
|
@meta.slug = file.sub(/.lt3$/, "")
|
218
219
|
@meta
|
219
220
|
rescue => err
|
220
|
-
|
221
|
+
error(err, __LINE__, __FILE__)
|
221
222
|
end
|
222
223
|
|
223
224
|
### posting
|
@@ -258,8 +259,7 @@ Remainder of post goes here.
|
|
258
259
|
f.puts @blogtail
|
259
260
|
end
|
260
261
|
rescue => err
|
261
|
-
|
262
|
-
puts err.backtrace
|
262
|
+
error(err, __LINE__, __FILE__)
|
263
263
|
end
|
264
264
|
|
265
265
|
### create_dir
|
@@ -283,43 +283,42 @@ Remainder of post goes here.
|
|
283
283
|
File.write(dir + "index.html", post)
|
284
284
|
generate_index(view)
|
285
285
|
rescue => err
|
286
|
-
|
287
|
-
puts err.backtrace
|
286
|
+
error(err, __LINE__, __FILE__)
|
288
287
|
end
|
289
288
|
|
290
289
|
### find_asset
|
291
290
|
|
292
|
-
|
293
|
-
# STDERR.puts "repl find_asset: @meta = #{@meta.inspect}"
|
294
|
-
|
295
|
-
|
296
|
-
|
297
|
-
|
298
|
-
|
299
|
-
|
300
|
-
|
301
|
-
|
302
|
-
|
303
|
-
|
304
|
-
|
305
|
-
|
306
|
-
|
307
|
-
|
308
|
-
|
309
|
-
|
310
|
-
|
311
|
-
|
312
|
-
|
313
|
-
|
314
|
-
|
315
|
-
|
316
|
-
|
317
|
-
|
318
|
-
|
319
|
-
# STDERR.puts "\n Called find_all_assets with #{list.inspect}"
|
320
|
-
|
321
|
-
|
322
|
-
|
291
|
+
# def find_asset(asset) # , views)
|
292
|
+
# # STDERR.puts "repl find_asset: @meta = #{@meta.inspect}"
|
293
|
+
# views = @meta.views
|
294
|
+
# views.each do |view|
|
295
|
+
# vdir = @config.viewdir(view)
|
296
|
+
# post_dir = "#{vdir}#{@meta.slug}/assets/"
|
297
|
+
# path = post_dir + asset
|
298
|
+
# STDERR.puts " Seeking #{path}"
|
299
|
+
# return path if File.exist?(path)
|
300
|
+
# end
|
301
|
+
# views.each do |view|
|
302
|
+
# dir = @config.viewdir(view) + "/assets/"
|
303
|
+
# path = dir + asset
|
304
|
+
# STDERR.puts " Seeking #{path}"
|
305
|
+
# return path if File.exist?(path)
|
306
|
+
# end
|
307
|
+
# top = @root + "/assets/"
|
308
|
+
# path = top + asset
|
309
|
+
# STDERR.puts " Seeking #{path}"
|
310
|
+
# return path if File.exist?(path)
|
311
|
+
#
|
312
|
+
# return nil
|
313
|
+
# end
|
314
|
+
#
|
315
|
+
# ### find_all_assets
|
316
|
+
#
|
317
|
+
# def find_all_assets(list, views)
|
318
|
+
# # STDERR.puts "\n Called find_all_assets with #{list.inspect}"
|
319
|
+
# list ||= []
|
320
|
+
# list.each {|asset| puts "#{asset} => #{find_asset(asset, views)}" }
|
321
|
+
# end
|
323
322
|
|
324
323
|
### publish_post
|
325
324
|
|
@@ -335,8 +334,7 @@ Remainder of post goes here.
|
|
335
334
|
# assets = find_all_assets(@meta.assets, views)
|
336
335
|
puts
|
337
336
|
rescue => err
|
338
|
-
|
339
|
-
puts err.backtrace
|
337
|
+
error(err, __LINE__, __FILE__)
|
340
338
|
end
|
341
339
|
|
342
340
|
### rebuild_post
|
@@ -345,8 +343,7 @@ Remainder of post goes here.
|
|
345
343
|
reload_post(file)
|
346
344
|
publish_post(@meta) # FIXME ??
|
347
345
|
rescue => err
|
348
|
-
|
349
|
-
puts err.backtrace
|
346
|
+
error(err, __LINE__, __FILE__)
|
350
347
|
end
|
351
348
|
|
352
349
|
### rebuild
|
@@ -358,8 +355,7 @@ Remainder of post goes here.
|
|
358
355
|
files = files.sort.reverse
|
359
356
|
files.each {|file| rebuild_post(file) }
|
360
357
|
rescue => err
|
361
|
-
|
362
|
-
puts err.backtrace
|
358
|
+
error(err, __LINE__, __FILE__)
|
363
359
|
end
|
364
360
|
|
365
361
|
### relink
|
@@ -367,8 +363,7 @@ Remainder of post goes here.
|
|
367
363
|
def relink
|
368
364
|
@config.views.each {|view| generate_index(view) }
|
369
365
|
rescue => err
|
370
|
-
|
371
|
-
puts err.backtrace
|
366
|
+
error(err, __LINE__, __FILE__)
|
372
367
|
end
|
373
368
|
|
374
369
|
# ### publish?
|
@@ -385,8 +380,7 @@ Remainder of post goes here.
|
|
385
380
|
puts
|
386
381
|
@config.views.each {|v| puts " #{v}" }
|
387
382
|
rescue => err
|
388
|
-
|
389
|
-
puts err.backtrace
|
383
|
+
error(err, __LINE__, __FILE__)
|
390
384
|
end
|
391
385
|
|
392
386
|
### change_view
|
@@ -404,8 +398,7 @@ Remainder of post goes here.
|
|
404
398
|
end
|
405
399
|
end
|
406
400
|
rescue => err
|
407
|
-
|
408
|
-
puts err.backtrace
|
401
|
+
error(err, __LINE__, __FILE__)
|
409
402
|
end
|
410
403
|
|
411
404
|
### new_view
|
@@ -425,8 +418,7 @@ Remainder of post goes here.
|
|
425
418
|
File.write(dir + "last_deployed", "Initial creation")
|
426
419
|
@config.views << arg
|
427
420
|
rescue => err
|
428
|
-
|
429
|
-
puts err.backtrace
|
421
|
+
error(err, __LINE__, __FILE__)
|
430
422
|
end
|
431
423
|
|
432
424
|
### import
|
@@ -447,8 +439,7 @@ Remainder of post goes here.
|
|
447
439
|
process_post(@fname)
|
448
440
|
publish_post(@meta) # if publish?
|
449
441
|
rescue => err
|
450
|
-
|
451
|
-
puts err.backtrace
|
442
|
+
error(err, __LINE__, __FILE__)
|
452
443
|
end
|
453
444
|
|
454
445
|
### new_post
|
@@ -465,8 +456,7 @@ Remainder of post goes here.
|
|
465
456
|
process_post(file) #- FIXME handle each view
|
466
457
|
publish_post(@meta) # if publish?
|
467
458
|
rescue => err
|
468
|
-
|
469
|
-
puts err.backtrace
|
459
|
+
error(err, __LINE__, __FILE__)
|
470
460
|
end
|
471
461
|
|
472
462
|
### remove_multiple_posts
|
data/lib/runeblog.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.0.
|
4
|
+
version: 0.0.43
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Hal Fulton
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2018-07-31 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|
@@ -69,9 +69,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
69
69
|
version: '0'
|
70
70
|
requirements: []
|
71
71
|
rubyforge_project:
|
72
|
-
rubygems_version: 2.
|
72
|
+
rubygems_version: 2.2.2
|
73
73
|
signing_key:
|
74
74
|
specification_version: 4
|
75
75
|
summary: A command-line blogging system
|
76
76
|
test_files: []
|
77
|
-
has_rdoc:
|