runeblog 0.1.69 → 0.1.70
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/data/standard.tgz +0 -0
- data/lib/helpers-repl.rb +1 -0
- data/lib/post.rb +1 -2
- data/lib/runeblog.rb +17 -37
- data/lib/runeblog_version.rb +1 -1
- data/test/make_blog.rb +0 -5
- 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: d56c583d5c56cb0677103fb74bfa9a88b5bba7a20ecee2ac759ae2eac2eaae2d
|
4
|
+
data.tar.gz: 8a13ccf8eb72166107b7432cf6f738110310f6dfddfc0a3303bc88c7d5362fd6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 5ef2c59f399c79478050fcf181e18dfce27d46c546ec0510b674416e9f103f2a67b104c20ac64870aff1e79131d472ebadb6a64aa29fa4c0c004ea3ba3728872
|
7
|
+
data.tar.gz: 7ba1d1ae569d9075e44b1dbec69e53ef29ca6a42971e3b16f560f2563f012f1ecdb9686ebeb343b1f5212e61392f3a1ca34eec863487e0b6eb0dc2735650a56a
|
data/data/standard.tgz
CHANGED
Binary file
|
data/lib/helpers-repl.rb
CHANGED
data/lib/post.rb
CHANGED
@@ -121,11 +121,10 @@ class RuneBlog::Post
|
|
121
121
|
end
|
122
122
|
|
123
123
|
def build
|
124
|
-
STDERR.puts "BUILD: #{RuneBlog.constants.sort.inspect}"
|
125
124
|
debug "=== build"
|
126
125
|
views = @meta.views
|
127
126
|
text = File.read(@draft)
|
128
|
-
livetext = Livetext
|
127
|
+
livetext = Livetext.new(STDOUT)
|
129
128
|
Livetext.parameters = [@blog, @meta.num, livetext]
|
130
129
|
meta = livetext.process_text(text)
|
131
130
|
raise RuneBlog::LivetextError(@draft) if meta.nil?
|
data/lib/runeblog.rb
CHANGED
@@ -159,22 +159,26 @@ class RuneBlog
|
|
159
159
|
names = self.views.map(&:to_s)
|
160
160
|
raise ViewAlreadyExists(arg) if names.include?(arg)
|
161
161
|
|
162
|
-
|
163
|
-
raise DirAlreadyExists(
|
164
|
-
create_dir(
|
162
|
+
vdir = "#@root/views/#{arg}/"
|
163
|
+
raise DirAlreadyExists(vdir) if Dir.exist?(vdir)
|
164
|
+
create_dir(vdir)
|
165
165
|
up = Dir.pwd
|
166
|
-
|
166
|
+
|
167
|
+
Dir.chdir(vdir)
|
167
168
|
x = RuneBlog::Default
|
168
169
|
create_dir('themes')
|
169
|
-
|
170
|
+
# create_dir("local")
|
170
171
|
create_dir("generated")
|
171
|
-
|
172
|
-
Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz 2>/dev/null") }
|
172
|
+
create_dir("generated/blog")
|
173
173
|
create_dir('assets')
|
174
|
+
|
175
|
+
Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz 2>/dev/null") }
|
174
176
|
pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
|
175
177
|
dump(pub, "publish")
|
178
|
+
|
176
179
|
view = RuneBlog::View.new(arg)
|
177
180
|
self.view = view
|
181
|
+
p "---- pwd = #{Dir.pwd}"
|
178
182
|
system("livetext themes/standard/generate.lt3 >generated/blog/index.html 2>generated/blog/index.err")
|
179
183
|
dump("Initial creation", "last_published")
|
180
184
|
Dir.chdir(up)
|
@@ -265,41 +269,17 @@ class RuneBlog
|
|
265
269
|
end
|
266
270
|
|
267
271
|
def generate_index(view)
|
272
|
+
# FIXME This is currently very wrong.
|
273
|
+
|
268
274
|
# puts " generate_index view = #{view.to_s}"
|
269
275
|
debug "=== generate_index view = #{view.to_s}"
|
270
276
|
raise ArgumentError unless view.is_a?(String) || view.is_a?(RuneBlog::View)
|
271
|
-
# Gather all posts, create list
|
272
|
-
vdir = "#@root/views/#{view}"
|
273
|
-
posts = Dir.entries(vdir).grep /^\d{4}/
|
274
|
-
posts = posts.sort.reverse
|
275
|
-
|
276
|
-
# Add view header/trailer
|
277
|
-
head = tail = nil
|
278
|
-
@blogview = nil
|
279
|
-
Dir.chdir(vdir) do
|
280
|
-
@blogview = File.read("themes/standard/blogview.lt3")
|
281
|
-
end
|
282
277
|
|
283
|
-
|
284
|
-
|
285
|
-
|
286
|
-
pdir = vdir + "/" + post
|
287
|
-
Dir.chdir(pdir) do
|
288
|
-
meta = read_config("metadata.txt")
|
289
|
-
meta.num = post.to_i # first 4 digits
|
290
|
-
check_meta(meta, "gen_index")
|
291
|
-
meta.teaser = File.read("teaser.txt")
|
292
|
-
meta.body = File.read("body.txt")
|
293
|
-
end
|
294
|
-
meta # block return
|
295
|
-
end
|
278
|
+
vdir = self.view.dir
|
279
|
+
up = Dir.pwd
|
280
|
+
Dir.chdir(vdir)
|
296
281
|
|
297
|
-
|
298
|
-
teasers = ""
|
299
|
-
posts.each {|post| teasers << index_entry(view, post) }
|
300
|
-
text = @blogview.sub(/TEASERS/, teasers)
|
301
|
-
f.puts text
|
302
|
-
end
|
282
|
+
system("livetext themes/standard/generate.lt3 >generated/blog/index.html 2>generated/blog/index.err")
|
303
283
|
rescue => err
|
304
284
|
error(err)
|
305
285
|
exit
|
data/lib/runeblog_version.rb
CHANGED
data/test/make_blog.rb
CHANGED
@@ -5,7 +5,6 @@ ver = major.to_i*10 + minor.to_i
|
|
5
5
|
abort "Need Ruby 2.4 or greater" unless ver >= 24
|
6
6
|
|
7
7
|
require 'global'
|
8
|
-
# require 'rubytext'
|
9
8
|
require 'repl'
|
10
9
|
|
11
10
|
def getch
|
@@ -29,8 +28,6 @@ def show_lines(text)
|
|
29
28
|
str
|
30
29
|
end
|
31
30
|
|
32
|
-
STDERR.puts :cp01
|
33
|
-
|
34
31
|
system("rm -rf .blogs")
|
35
32
|
RuneBlog.create_new_blog_repo('test_view', ".blogs/data")
|
36
33
|
x = RuneBlog.new
|
@@ -40,8 +37,6 @@ x.create_view("alpha_view")
|
|
40
37
|
if File.exist?("publish")
|
41
38
|
system("cp publish .blogs/data/views/alpha_view/publish")
|
42
39
|
end
|
43
|
-
# puts "inside make_blog: pwd = #{Dir.pwd}"
|
44
|
-
system("cp test/fakeimage.jpg .blogs/data/assets/")
|
45
40
|
system("cp test/fakeimage.jpg .blogs/data/views/alpha_view/assets/")
|
46
41
|
|
47
42
|
x.create_view("beta_view")
|