runeblog 0.1.86 → 0.1.88

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: ba9b860dd117682b59ecd6b7c6f1fcc10272b7a1e556ac98c3f3206dbfe3bed3
4
- data.tar.gz: 7ddc0c9c23b85eeac21c63cd673340ccf2a17f79d2e8a668627f39fb67602cab
3
+ metadata.gz: 9e46979242ed8767ec2ef126cf345067bfa290e5b8730bb12fbc2aaa9f2cb470
4
+ data.tar.gz: e420c52a7a3e19b3def738c66fe7fd128d70d01864951e10327499542a173e8a
5
5
  SHA512:
6
- metadata.gz: cd69ba907ebcf89687c6e1549b72f47ce5173ca38c8e5eec6d795e82b7c4a123c9d8557efe953389a97d90b97d0906f0d03386651e8ba448cd4971fca351e488
7
- data.tar.gz: 94c47ec9b446b857991776d1b147817310344f5f25daddeff1735b5439438425f8703ed9f9df6093463d2f2326cd90d63f47ac601f98fe9b11436d64a8523db2
6
+ metadata.gz: a7f392d33a2be29e265f3bbeef0c3a4c8a4aeb9c6481f664ef22bc9ff4cc52d578af7d236a758e870f0680472ff2f74171a490c35ec4f36e3fa0194210c602cc
7
+ data.tar.gz: a46054951a8b79c0fbc1b409bfb23c2743362711fda79ee7ef7b226575f6306c8990f08cb12ef50b8bedcec584d314abf321dd0ea12a4fdc0fb50d0e4a7e0db7
data/lib/liveblog.rb CHANGED
@@ -8,16 +8,14 @@ require 'runeblog'
8
8
  errfile = File.new("liveblog.out", "w")
9
9
  STDERR.reopen(errfile)
10
10
 
11
- =begin
12
- 123:def title # side-effect
13
- 133:def pubdate # side-effect
14
- 153:def tags # side-effect
15
- 160:def views # side-effect
16
- 167:def pin # side-effect
17
- 218:def write_post # side-effect
18
- 393:def main # side-effect
19
- 491:def _post_lookup(postid) # side-effect
20
- =end
11
+ # def title # side-effect
12
+ # def pubdate # side-effect
13
+ # def tags # side-effect
14
+ # def views # side-effect
15
+ # def pin # side-effect
16
+ # def write_post # side-effect
17
+ # def main # side-effect
18
+ # def _post_lookup(postid) # side-effect
21
19
 
22
20
  def init_liveblog # FIXME - a lot of this logic sucks
23
21
  here = Dir.pwd
@@ -224,7 +222,6 @@ def teaser
224
222
  raise "'post' was not called" unless @meta
225
223
  @meta.teaser = _body_text
226
224
  _out @meta.teaser + "\n"
227
- STDERR.puts "TEASER cwd = #{Dir.pwd}"
228
225
  # FIXME
229
226
  end
230
227
 
@@ -362,7 +359,6 @@ end
362
359
  def main # side-effect
363
360
  _out %[<div class="col-lg-9 col-md-9 col-sm-9 col-xs-12">]
364
361
  which = _args[0]
365
- STDERR.puts "--- inside #main: which = #{which.inspect}"
366
362
  case which
367
363
  when "recent_posts"
368
364
  all_teasers
@@ -498,50 +494,57 @@ def _teaser(slug)
498
494
  text
499
495
  end
500
496
 
497
+ def _card_generic(card_title:, middle:, extra: "")
498
+ front = <<-HTML
499
+ <div class="card #{extra} mb-3">
500
+ <div class="card-body">
501
+ <h5 class="card-title">#{card_title}</h5>
502
+ HTML
503
+
504
+ tail = <<-HTML
505
+ </div>
506
+ </div>
507
+ HTML
508
+ text = front + middle + tail
509
+ _out text + "\n "
510
+ end
501
511
 
502
512
  def card_iframe
503
- title = _data
504
- lines = _body
513
+ title, lines = _data, _body
514
+ lines.map!(&:chomp)
505
515
  url = lines[0].chomp
506
516
  stuff = lines[1..-1].join(" ") # FIXME later
507
- text = <<-HTML
508
- <div class="card mb-3">
509
- <div class="card-body">
510
- <h5 class="card-title">#{title}</h5>
511
- <iframe src="#{url}" #{stuff}
512
- style="border: 0" height="350"
513
- frameborder="0" scrolling="no">
514
- </iframe>
515
- </div>
516
- </div>
517
+ middle = <<-HTML
518
+ <iframe src="#{url}" #{stuff}
519
+ style="border: 0" height="350"
520
+ frameborder="0" scrolling="no">
521
+ </iframe>
517
522
  HTML
518
- _out text
519
- rescue
520
- puts @live.body
523
+
524
+ _card_generic(card_title: title, middle: middle, extra: "bg-dark text-white")
525
+
521
526
  end
522
527
 
523
528
  def card1
524
- card_title = _data
525
- lines = _body
529
+ title, lines = _data, _body
526
530
  lines.map!(&:chomp)
531
+
527
532
  card_text = lines[0]
528
533
  url, target, classname, cdata = lines[1].split(",", 4)
529
- text = <<-HTML
530
- <div class="card bg-dark text-white mb-3">
531
- <div class="card-body">
532
- <h5 class="card-title">#{card_title}</h5>
533
- <p class="card-text">#{card_text}</p>
534
- <a href="#{url}" target="#{target}" class="#{classname}">#{cdata}</a>
535
- </div>
536
- </div>
534
+
535
+ middle = <<-HTML
536
+ <p class="card-text">#{card_text}</p>
537
+ <a href="#{url}" target="#{target}" class="#{classname}">#{cdata}</a>
537
538
  HTML
538
- _out text + "\n "
539
- rescue
540
- puts @live.body
539
+
540
+ _card_generic(card_title: title, middle: middle, extra: "bg-dark text-white")
541
541
  end
542
542
 
543
543
  def card2
544
544
  card_title = _data
545
+
546
+ # FIXME is this wrong??
547
+
545
548
  open = <<-HTML
546
549
  <div class="card mb-3">
547
550
  <div class="card-body">
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.1.86"
5
+ VERSION = "0.1.88"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
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.86
4
+ version: 0.1.88
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton