runeblog 0.0.63 → 0.0.64
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/runeblog.rb +37 -7
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 257ad84648e005ad01f71886994183bd9f98ecb5
|
4
|
+
data.tar.gz: 06bfe5ebcdfdabc497bd47c9d6191c4a460f7e1f
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 7aa6da6a32b8fe50b20c7b9ef64a28f5ff325c16a7eed7582ff08d9b116a0dd265961c00a1bd2745c8001bc07645a63ee02d01337b5766e36c6293d85933ec8e
|
7
|
+
data.tar.gz: 663840e9aa0f0b4a53a885ad8b460f9a7a18ba2dfae752ae03d90acd5dc58061fb79add1ae3787f31130baa09a2d1b66d85c2aa7ec29752d69230dabc8de5c90
|
data/data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
RuneBlog v 0.0.
|
1
|
+
RuneBlog v 0.0.64 2018-09-21
|
data/lib/runeblog.rb
CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
|
|
3
3
|
require 'livetext'
|
4
4
|
|
5
5
|
class RuneBlog
|
6
|
-
VERSION = "0.0.
|
6
|
+
VERSION = "0.0.64"
|
7
7
|
|
8
8
|
Path = File.expand_path(File.join(File.dirname(__FILE__)))
|
9
9
|
DefaultData = Path + "/../data"
|
@@ -148,12 +148,12 @@ EOS
|
|
148
148
|
end
|
149
149
|
|
150
150
|
def change_view(view)
|
151
|
-
@view = view
|
151
|
+
@view = view # error checking?
|
152
152
|
end
|
153
153
|
|
154
154
|
def process_post(file)
|
155
155
|
@main ||= Livetext.new
|
156
|
-
@main.main.output = File.new("/tmp/WHOA","w")
|
156
|
+
@main.main.output = File.new("/tmp/WHOA","w") # FIXME srsly?
|
157
157
|
path = @root + "/src/#{file}"
|
158
158
|
@meta = @main.process_file(path, binding)
|
159
159
|
raise "process_file returned nil" if @meta.nil?
|
@@ -167,10 +167,7 @@ EOS
|
|
167
167
|
end
|
168
168
|
|
169
169
|
def publish_post(meta)
|
170
|
-
|
171
|
-
# First gather the views
|
172
|
-
views = meta.views
|
173
|
-
views.each {|view| link_post_view(view) }
|
170
|
+
meta.views.each {|view| link_post_view(view) }
|
174
171
|
# assets = find_all_assets(@meta.assets, views)
|
175
172
|
nil
|
176
173
|
rescue => err
|
@@ -254,6 +251,7 @@ EOS
|
|
254
251
|
list = files_by_id(num)
|
255
252
|
result = system("rm -rf #{list.join(' ')}")
|
256
253
|
error_cant_delete(files) unless result
|
254
|
+
# FIXME - update index/etc
|
257
255
|
end
|
258
256
|
|
259
257
|
def post_exists?(num)
|
@@ -299,3 +297,35 @@ EOS
|
|
299
297
|
end
|
300
298
|
|
301
299
|
end
|
300
|
+
|
301
|
+
#######
|
302
|
+
|
303
|
+
class RuneBlog::Post
|
304
|
+
|
305
|
+
attr_reader :id, :title, :date, :views, :num, :slug
|
306
|
+
|
307
|
+
def self.files(num, root)
|
308
|
+
files = Find.find(root).to_a
|
309
|
+
result = files.grep(/#{tag(num)}-/)
|
310
|
+
result
|
311
|
+
end
|
312
|
+
|
313
|
+
def initialize(title, view)
|
314
|
+
@title = title
|
315
|
+
@view = view
|
316
|
+
@num, @slug = make_slug
|
317
|
+
end
|
318
|
+
|
319
|
+
private
|
320
|
+
|
321
|
+
def make_slug(postnum = nil)
|
322
|
+
postnum ||= RuneBlog.next_sequence
|
323
|
+
num = tag(postnum) # FIXME can do better
|
324
|
+
slug = @title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
|
325
|
+
[postnum, "#{num}-#{slug}"]
|
326
|
+
end
|
327
|
+
|
328
|
+
def tag(num)
|
329
|
+
"#{'%04d' % num}"
|
330
|
+
end
|
331
|
+
end
|
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.64
|
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-09-
|
11
|
+
date: 2018-09-21 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: livetext
|