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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 01a59a40806ea47e4c1050698e94fe48047c853357b2dd8dcc7519973d7969ed
4
- data.tar.gz: f63c02e9da788ef463339a9cf9f0e0a3502975e7a1eaedd3bda935f53f9ab2fd
3
+ metadata.gz: d56c583d5c56cb0677103fb74bfa9a88b5bba7a20ecee2ac759ae2eac2eaae2d
4
+ data.tar.gz: 8a13ccf8eb72166107b7432cf6f738110310f6dfddfc0a3303bc88c7d5362fd6
5
5
  SHA512:
6
- metadata.gz: 71bf1ca60168bcb5297271eacd173f3f70e1447ac575c0d3e034ae0a3884024fdca117c4780cc401f48a5c73095864b15616253c1d8d4b0453aeac4a2d8a9875
7
- data.tar.gz: 2034c163ca26b8215d9f9e5fa9debf3024924fdc506791868615ff791446ccb10fbbfb48b264ad277c4b2f3d6ed0116c30dd32a5dd84191e093592ee5d9ca1a4
6
+ metadata.gz: 5ef2c59f399c79478050fcf181e18dfce27d46c546ec0510b674416e9f103f2a67b104c20ac64870aff1e79131d472ebadb6a64aa29fa4c0c004ea3ba3728872
7
+ data.tar.gz: 7ba1d1ae569d9075e44b1dbec69e53ef29ca6a42971e3b16f560f2563f012f1ecdb9686ebeb343b1f5212e61392f3a1ca34eec863487e0b6eb0dc2735650a56a
data/data/standard.tgz CHANGED
Binary file
data/lib/helpers-repl.rb CHANGED
@@ -102,6 +102,7 @@ module RuneBlog::REPL
102
102
  Regexes.each_pair do |rx, meth|
103
103
  m = cmd.match(rx)
104
104
  result = m ? m.to_a : nil
105
+ p [result, rx, meth]
105
106
  next unless result
106
107
  found = meth
107
108
  params = m[1]
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::Livetext.new(STDOUT)
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
- dir = "#@root/views/#{arg}/"
163
- raise DirAlreadyExists(dir) if Dir.exist?(dir)
164
- create_dir(dir)
162
+ vdir = "#@root/views/#{arg}/"
163
+ raise DirAlreadyExists(vdir) if Dir.exist?(vdir)
164
+ create_dir(vdir)
165
165
  up = Dir.pwd
166
- Dir.chdir(dir)
166
+
167
+ Dir.chdir(vdir)
167
168
  x = RuneBlog::Default
168
169
  create_dir('themes')
169
- create_dir("local")
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
- # Output view
284
- posts.map! do |post|
285
- meta = nil
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
- File.open("#{vdir}/index.html", "w") do |f|
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
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.69"
3
+ VERSION = "0.1.70"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
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")
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.1.69
4
+ version: 0.1.70
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton