runeblog 0.1.58 → 0.1.59

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: 4f376297ea03864aff5f5702d7c05e256029e18c9d808f6cfdd13edd2c8526a6
4
- data.tar.gz: eca093ea7e23fc72c669fda9d0c9dc705fa9640628f17911d40105e8ed62319c
3
+ metadata.gz: a9609df6651bdbbca80999137759619281518ebb4d77d08d177c8d1bff9c1b22
4
+ data.tar.gz: fa0f3619b0d306fb7df03e8015056aea57e547ebcd94dd022154cd7caa252f18
5
5
  SHA512:
6
- metadata.gz: 65a5b558786216cbcac20af1fcc98c95898497636ad346b2c415899eed232848534ca6a86be626dc9d9a0d3493392cbba395968f9642c94b1b57f93296bf93db
7
- data.tar.gz: 21765b0dd0e25577bc16fb1a420721f1323eade54367c8f868a5f50c4d87b338c087a1e4737b0adfb8c4a2e5506430c41ec09b838e2da2421254bd7a9c6fab18
6
+ metadata.gz: 7a378779a948cc365d0c42982f7aea41b0d08effb2699447411cd8ccb234b738e5af27a2341eaf177cac9193c21b141ef8aed4a27efc84e5aa1e6f3091256073
7
+ data.tar.gz: 352e5c1c504d476c5919d73b6df4fd22f9bf62f6c81888f0d13d54084401aaa3d26032c7bf8d15da21c3d8c7f8b81d55446fd3128f1cf9681e03c0597d72fda4
data/lib/default.rb CHANGED
@@ -2,7 +2,7 @@ class RuneBlog::Default
2
2
 
3
3
  # This will all become much more generic later.
4
4
 
5
- NewBlogHeader = <<-TEXT # Can't do this yet!!
5
+ BlogTemplate = <<-TEXT
6
6
  .mixin liveblog
7
7
 
8
8
  .title Fake Blog, Fake Title, Fake Author
@@ -24,33 +24,7 @@ NewBlogHeader = <<-TEXT # Can't do this yet!!
24
24
  </tr>
25
25
  </table>
26
26
  .hr
27
- TEXT
28
-
29
- BlogHeader = <<-TEXT
30
- <html>
31
- <body>
32
- <title>Fake Blog, Fake Title, Fake Author</title>
33
- <table cellpadding=4>
34
- <tr>
35
- <td>
36
- <img src=assets/fakeimage.jpg width=400 height=300>
37
- </td>
38
- <td valign=top>
39
- <h2>Yet another blog...</h2>
40
- <h3>by Kilgore Trout</h3>
41
- <br> <br>
42
- If you're the kind of person who likes this sort of thing,
43
- then this is the sort of thing a person like you will like.
44
- <br> <br>
45
- Don't you feel more like you do now than before you read this?
46
- </td>
47
- </tr>
48
- </table>
49
- <hr>
50
- TEXT
51
-
52
- BlogTrailer = <<-TEXT
53
- <!-- no blog trailer -->
27
+ TEASERS
54
28
  TEXT
55
29
 
56
30
  def RuneBlog.post_template(title: "No title", date: nil, view: "test_view",
data/lib/liveblog.rb CHANGED
@@ -38,14 +38,14 @@ end
38
38
 
39
39
  # Move elsewhere later
40
40
 
41
- def h1; _puts "<h1>#{@_data}</h1>"; end
42
- def h2; _puts "<h2>#{@_data}</h2>"; end
43
- def h3; _puts "<h3>#{@_data}</h3>"; end
44
- def h4; _puts "<h4>#{@_data}</h4>"; end
45
- def h5; _puts "<h5>#{@_data}</h5>"; end
46
- def h6; _puts "<h6>#{@_data}</h6>"; end
41
+ def h1; _out "<h1>#{@_data}</h1>"; end
42
+ def h2; _out "<h2>#{@_data}</h2>"; end
43
+ def h3; _out "<h3>#{@_data}</h3>"; end
44
+ def h4; _out "<h4>#{@_data}</h4>"; end
45
+ def h5; _out "<h5>#{@_data}</h5>"; end
46
+ def h6; _out "<h6>#{@_data}</h6>"; end
47
47
 
48
- def hr; _puts "<hr>"; end
48
+ def hr; _out "<hr>"; end
49
49
 
50
50
 
51
51
  ### inset
@@ -140,6 +140,7 @@ end
140
140
  def image # primitive so far
141
141
  _debug "img: huh? <img src=#{_args.first}></img>"
142
142
  fname = _args.first
143
+ puts "image fname = #{fname}"
143
144
  path = "../assets/#{fname}"
144
145
  @body << "<img src=#{path}></img>"
145
146
  _optional_blank_line
@@ -235,8 +236,7 @@ end
235
236
 
236
237
  def finalize
237
238
  if @blog.nil?
238
- puts @body
239
- return
239
+ return @body
240
240
  end
241
241
  @slug = @blog.make_slug(@meta)
242
242
  @postdir = @blog.view.dir + "/#@slug"
data/lib/repl.rb CHANGED
@@ -39,8 +39,7 @@ module RuneBlog::REPL
39
39
  check_empty(arg)
40
40
  dir = @blog.view.dir
41
41
  items = ["publish",
42
- "templates/blog_header.html",
43
- "templates/blog_trailer.html",
42
+ "templates/blogview.lt3",
44
43
  "templates/post_template.html"]
45
44
  num, fname = STDSCR.menu(title: "Edit file:", items: items)
46
45
  edit_file("#{dir}/#{fname}")
data/lib/runeblog.rb CHANGED
@@ -142,10 +142,17 @@ class RuneBlog
142
142
  view = RuneBlog::View.new(arg)
143
143
  self.view = view
144
144
  Livetext.parameters = [RuneBlog.blog, 0]
145
- live = Livetext.new
146
- meta = live.transform(x::NewBlogHeader)
147
- dump(x::BlogHeader, "templates/blog_header.html")
148
- dump(x::BlogTrailer, "templates/blog_trailer.html")
145
+ devnull = File.new("/dev/null", "w")
146
+ live = Livetext.new(devnull)
147
+ meta = live.transform(x::BlogTemplate)
148
+ puts x::BlogTemplate
149
+ puts
150
+ puts meta
151
+ puts
152
+ puts "---"
153
+ dump(meta, "templates/blogview.lt3")
154
+ # dump(x::BlogHeader, "templates/blog_header.html")
155
+ # dump(x::BlogTrailer, "templates/blog_trailer.html")
149
156
  dump("Initial creation", "last_published")
150
157
  Dir.chdir(up)
151
158
  @views << view
@@ -244,12 +251,14 @@ class RuneBlog
244
251
 
245
252
  # Add view header/trailer
246
253
  head = tail = nil
254
+ @blogview = nil
247
255
  Dir.chdir(vdir) do
248
- head = File.read("templates/blog_header.html")
249
- tail = File.read("templates/blog_trailer.html")
256
+ @blogview = File.read("templates/blogview.lt3")
257
+ # head = File.read("templates/blog_header.html")
258
+ # tail = File.read("templates/blog_trailer.html")
250
259
  end
251
- @bloghead = interpolate(head)
252
- @blogtail = interpolate(tail)
260
+ # @bloghead = interpolate(head)
261
+ # @blogtail = interpolate(tail)
253
262
 
254
263
  # Output view
255
264
  posts.map! do |post|
@@ -266,9 +275,10 @@ class RuneBlog
266
275
  end
267
276
 
268
277
  File.open("#{vdir}/index.html", "w") do |f|
269
- f.puts @bloghead
270
- posts.each {|post| f.puts index_entry(view, post) }
271
- f.puts @blogtail
278
+ teasers = ""
279
+ posts.each {|post| teasers << index_entry(view, post) }
280
+ text = @blogview.sub(/TEASERS/, teasers)
281
+ f.puts text
272
282
  end
273
283
  rescue => err
274
284
  error(err)
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.58"
3
+ VERSION = "0.1.59"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
data/runeblog.gemspec CHANGED
@@ -20,7 +20,7 @@ spec = Gem::Specification.new do |s|
20
20
  s.authors = ["Hal Fulton"]
21
21
  s.email = 'rubyhacker@gmail.com'
22
22
  s.executables << "blog"
23
- s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.66'
23
+ s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.69'
24
24
  s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.16'
25
25
 
26
26
  # Files...
data/test/make_blog.rb CHANGED
@@ -38,7 +38,7 @@ x.create_view("alpha_view")
38
38
  if File.exist?("publish")
39
39
  system("cp publish .blog/data_test/views/alpha_view/publish")
40
40
  end
41
- puts "inside make_blog: pwd = #{Dir.pwd}"
41
+ # puts "inside make_blog: pwd = #{Dir.pwd}"
42
42
  system("cp test/fakeimage.jpg .blog/data_test/assets/")
43
43
  system("cp test/fakeimage.jpg .blog/data_test/views/alpha_view/assets/")
44
44
 
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.1.58
4
+ version: 0.1.59
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-04-10 00:00:00.000000000 Z
11
+ date: 2019-04-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.8'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.8.66
22
+ version: 0.8.69
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.8'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.8.66
32
+ version: 0.8.69
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rubytext
35
35
  requirement: !ruby/object:Gem::Requirement