runeblog 0.0.19 → 0.0.20

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/data/VERSION +1 -1
  3. data/lib/runeblog.rb +12 -15
  4. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e1a775d7a2266cf324705bb43a5f4c0b027b4bbb
4
- data.tar.gz: 6ccaa91f9b29cc0306096b71a9ed10177149a168
3
+ metadata.gz: e6850c3b1c5048a79ad24094adfd0b138ab87f09
4
+ data.tar.gz: 0fa28fc42c267a939c4b90b1a9e15ac89fbb4d92
5
5
  SHA512:
6
- metadata.gz: 7b8211572cf28798f56baf01c685800445b8bd7a876999a936116f8cf158f73da0bc3df8292668b65ac24d4f65ea235390b365939b95de84ac94c17dea324a3b
7
- data.tar.gz: 05c70aeedfb2edcfa7b50977d452542f44d746544839a8d9183b7ec0e70c3a25e50228f0584064d201178b1da23ef5065840fc9cd5f24a7c10171573904b61c3
6
+ metadata.gz: f02f50ce9559bfd17fb74d632c81855317d7b77b9fb0f5e29e48cd03c5546b2b16315765618f923d4daa85765caf90d77c53dbf8d281e719499baa6ceaaf842e
7
+ data.tar.gz: 43f5410597ee6f2e2046b2cf7b669432e09c1aa48be1c4a3063a9e2a68480cde974eadfe7a51a93ed2f1b207dbca3b6201884f442be85ae8fe79c03dca777170
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.19 2017-05-06
1
+ RuneBlog v 0.0.20 2017-05-07
data/lib/runeblog.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  class RuneBlog
2
- VERSION = "0.0.19"
2
+ VERSION = "0.0.20"
3
3
 
4
4
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
5
5
  DefaultData = Path + "/../data"
@@ -140,12 +140,10 @@ end
140
140
 
141
141
  def process_post(file)
142
142
  @main ||= Livetext.new
143
- # puts " Processing: #{Dir.pwd}/#{file}"
144
- # path = @config.root + "/src/#{file}"
143
+ puts " Processing: #{Dir.pwd} :: #{file}"
144
+ path = @config.root + "/src/#{file}"
145
145
  @meta = @main.process_file(file)
146
146
  @meta.slug = make_slug(@meta.title, @config.sequence)
147
- # @meta = @main.instance_eval { @meta }
148
- p @meta
149
147
  @meta.slug = file.sub(/.lt3$/, "")
150
148
  @meta
151
149
  end
@@ -154,8 +152,7 @@ end
154
152
 
155
153
  def reload_post(file)
156
154
  @main ||= Livetext.new
157
- process_post("#{@config.root}/src/#{file}")
158
- @meta = @main.instance_eval { @meta }
155
+ @meta = process_post("#{@config.root}/src/#{file}")
159
156
  @meta.slug = file.sub(/.lt3$/, "")
160
157
  @meta
161
158
  end
@@ -230,6 +227,8 @@ end
230
227
 
231
228
  def rebuild
232
229
  files = Dir.entries("#{@config.root}/src/").grep /\d\d\d\d.*.lt3$/
230
+ files.map! {|f| File.basename(f) }
231
+ files.each {|f| p f }
233
232
  files = files.sort.reverse
234
233
  files.each do |file|
235
234
  reload_post(file)
@@ -346,14 +345,14 @@ def remove_post(arg)
346
345
  files = Find.find("#{@config.root}").to_a
347
346
  files = files.grep(/#{tag}/)
348
347
  if files.empty?
349
- puts "\n No such post found"
348
+ puts red("\n No such post found")
350
349
  return
351
350
  end
352
351
  puts
353
352
  files.each {|f| puts " #{f}" }
354
- yn = ask red("\n Delete all these? ")
355
- if yn.downcase == "y"
356
- #-- maybe implement trash later?
353
+ ques = files.size > 1 ? "\n Delete all these? " : "\n Delete? "
354
+ yn = ask red(ques)
355
+ if yn.downcase == "y" #-- maybe implement trash later?
357
356
  system("rm -rf #{files.join(' ')}")
358
357
  puts red("\n Deleted")
359
358
  else
@@ -372,7 +371,7 @@ def list_posts
372
371
  posts = Dir.entries(".").grep(/^0.*/)
373
372
  puts
374
373
  if posts.empty?
375
- puts "No posts"
374
+ puts " No posts"
376
375
  else
377
376
  posts.each {|post| puts " #{post}" }
378
377
  end
@@ -390,7 +389,7 @@ def list_drafts
390
389
  posts = Dir.entries(".").grep(/^0.*.lt3/)
391
390
  puts
392
391
  if posts.empty?
393
- puts "No posts"
392
+ puts " No posts"
394
393
  else
395
394
  posts.each {|post| puts " #{post.sub(/.lt3$/, "")}" }
396
395
  end
@@ -400,5 +399,3 @@ rescue
400
399
  exit
401
400
  end
402
401
 
403
-
404
-
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.19
4
+ version: 0.0.20
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-05-06 00:00:00.000000000 Z
11
+ date: 2017-05-07 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: A blog system based on Ruby and Livetext
14
14
  email: rubyhacker@gmail.com