runeblog 0.0.30 → 0.0.31

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: ca084cb0f44eb31904d67f7383c9f0283c0c2808
4
- data.tar.gz: 35ba1e215e33565207549b71f50f10e414de0d64
3
+ metadata.gz: 723dfcd02942dab4992da211a1319c819fb37477
4
+ data.tar.gz: 463da39549a74e0ded3f38f39b8c5dd187252265
5
5
  SHA512:
6
- metadata.gz: 8f638fde1609ad5b567a2989d434de1f542c72bced11a6177acb87cdb69188734d2ac785f38f6919201836d772f3e2d9d1f653cd85e69e344b49f9f06b7d5af6
7
- data.tar.gz: a8e4b677be56cbfb942fef36cfac5c92fa0fc08b08086fc69be7b9bd8e596cd0dfc79fd78c3ac2adaa155f7e24ede32594a4c54a04020586fd81ceac3aea2a5d
6
+ metadata.gz: cab5fb3f93542e90bdb38642452d3add274cc7df132340bbbb1155aee2c7711b83ac9a9153adcaf812fcd438a5f8351f36baa190b02c8978ae843149534752d3
7
+ data.tar.gz: 67ac663301af71c279bf064eb055257ac620b79879a68b4ee38b2704f496250f6c6cba0fc2abba0a2ebff74b10fafd72658f28bb777a2b303b3ce5b0af2993fe
data/bin/blog CHANGED
@@ -98,6 +98,10 @@ def parse_cmd
98
98
  raise "Too many arguments" if @words.size > 2
99
99
  @meth = :remove_post
100
100
  @arg = need_arg(1)
101
+ when "e", "edit"
102
+ raise "Too many arguments" if @words.size > 2
103
+ @meth = :edit_post
104
+ @arg = need_arg(1)
101
105
  when "list"
102
106
  case @words[1]
103
107
  when "views"
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.30 2017-05-11
1
+ RuneBlog v 0.0.31 2017-05-11
data/lib/repl.rb CHANGED
@@ -110,9 +110,9 @@ module RuneBlog::REPL
110
110
  @fname
111
111
  end
112
112
 
113
- ### edit_post
113
+ ### edit_initial_post
114
114
 
115
- def edit_post(file)
115
+ def edit_initial_post(file)
116
116
  system("vi #@root/src/#{file} +8 ")
117
117
  end
118
118
 
@@ -249,6 +249,14 @@ module RuneBlog::REPL
249
249
  puts
250
250
  end
251
251
 
252
+ ### rebuild_post
253
+
254
+ def rebuild_post(file)
255
+ reload_post(file)
256
+ link_post(@meta) # FIXME ??
257
+ publish_post
258
+ end
259
+
252
260
  ### rebuild
253
261
 
254
262
  def rebuild
@@ -256,19 +264,13 @@ module RuneBlog::REPL
256
264
  files = Dir.entries("#@root/src/").grep /\d\d\d\d.*.lt3$/
257
265
  files.map! {|f| File.basename(f) }
258
266
  files = files.sort.reverse
259
- files.each do |file|
260
- reload_post(file)
261
- link_post(@meta)
262
- publish_post
263
- end
267
+ files.each {|file| rebuild_post(file) }
264
268
  end
265
269
 
266
270
  ### relink
267
271
 
268
272
  def relink
269
- @config.views.each do |view|
270
- generate_index(view)
271
- end
273
+ @config.views.each {|view| generate_index(view) }
272
274
  end
273
275
 
274
276
  ### publish?
@@ -335,7 +337,7 @@ module RuneBlog::REPL
335
337
  @slug = make_slug(@title)
336
338
  @fname = @slug + ".lt3"
337
339
  system("cp #{name} #@root/src/#@fname")
338
- edit_post(@fname)
340
+ edit_initial_post(@fname)
339
341
  process_post(@fname)
340
342
  if publish?
341
343
  link_post(@meta)
@@ -352,7 +354,7 @@ module RuneBlog::REPL
352
354
  @date = Time.now.strftime("%Y-%m-%d")
353
355
 
354
356
  file = create_empty_post
355
- edit_post(file)
357
+ edit_initial_post(file)
356
358
  # file = @root + "/src/" + file
357
359
  process_post(file) #- FIXME handle each view
358
360
  if publish?
@@ -389,6 +391,33 @@ module RuneBlog::REPL
389
391
  puts
390
392
  end
391
393
 
394
+ ### edit_post
395
+
396
+ #-- FIXME affects linking, building, deployment...
397
+
398
+ def edit_post(arg)
399
+ id = Integer(arg) rescue raise("'#{arg}' is not an integer")
400
+ tag = "#{'%04d' % id}-"
401
+ files = Find.find(@root+"/src").to_a
402
+ files = files.grep(/#{tag}/)
403
+ files = files.map {|f| File.basename(f) }
404
+ if files.size > 1
405
+ puts red("Multiple files: #{files}")
406
+ return
407
+ end
408
+ if files.empty?
409
+ puts red("\n No such post found")
410
+ return
411
+ end
412
+
413
+ file = files.first
414
+ system("vi #@root/src/#{file}")
415
+ rebuild_post(file)
416
+ rescue => err
417
+ puts err
418
+ puts
419
+ end
420
+
392
421
  ### list_posts
393
422
 
394
423
  def list_posts
data/lib/runeblog.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.0.30"
3
+ VERSION = "0.0.31"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  DefaultData = Path + "/../data"
data/runeblog.gemspec CHANGED
@@ -14,6 +14,7 @@ Gem::Specification.new do |s|
14
14
  s.authors = ["Hal Fulton"]
15
15
  s.email = 'rubyhacker@gmail.com'
16
16
  s.executables << "blog"
17
+ s.add_runtime_dependency "livetext", [">= 0.8.18"]
17
18
 
18
19
  # Files...
19
20
  main = Find.find("bin").to_a +
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.30
4
+ version: 0.0.31
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
@@ -9,7 +9,21 @@ autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
11
  date: 2017-05-11 00:00:00.000000000 Z
12
- dependencies: []
12
+ dependencies:
13
+ - !ruby/object:Gem::Dependency
14
+ name: livetext
15
+ requirement: !ruby/object:Gem::Requirement
16
+ requirements:
17
+ - - ">="
18
+ - !ruby/object:Gem::Version
19
+ version: 0.8.18
20
+ type: :runtime
21
+ prerelease: false
22
+ version_requirements: !ruby/object:Gem::Requirement
23
+ requirements:
24
+ - - ">="
25
+ - !ruby/object:Gem::Version
26
+ version: 0.8.18
13
27
  description: A blog system based on Ruby and Livetext
14
28
  email: rubyhacker@gmail.com
15
29
  executables: