runeblog 0.2.61 → 0.2.62

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: 65a0fbb53ba0184ee98c700924397a7054684add4f5516508410cfdbbfb742cd
4
- data.tar.gz: fa4a3f7a744cf1ec29203ee172d111800a1bf0f6402a99fe07a05053dc8b7f86
3
+ metadata.gz: fe49e283ad5e20a9b78d6aba39cd7a8ac16140808e99e58976568143390c1656
4
+ data.tar.gz: 433a53274f650079da5854ef70a6b539ec4c558dcab0f02da495eea91b537231
5
5
  SHA512:
6
- metadata.gz: e6b1a30fb4f7d2682747516d099915d232d49a48c26bfe7c42ea8d33cce49ee27cab3d488b636ad24abeafb239f79ecbe92790019077d48ac59d484e0a0c2f5b
7
- data.tar.gz: bc0f11f41b53e6cf625d85e84adf52bb13317417f303041fac1dc5974120433348a38924932d35ce3cc65034945fa6e9247ba9efd4e1b86643e1372e6ab04e46
6
+ metadata.gz: 6b66d544078f5bb178c54aa8eb9bf42e0b74ddb85755ff3d9e41a4cc7a34d2dd7a17568d7a0ad9302817a9aa5453ee9abe77ba036950b98e5301b2eef3f7fd6b
7
+ data.tar.gz: cc8b4d721b32056750c855e27861c01c6bc4e229c03704756a4f99a8549c98bdb9c887c8fd2f91b5a7fce6f4adc47d8b3d594290cf82357c7736951f4ce8a4ff
@@ -7,9 +7,7 @@ class ::RuneBlog::Widget
7
7
  def initialize(repo)
8
8
  @blog = repo
9
9
  @datafile = "list.data"
10
- # f = File.new("/tmp/mehhh", "w")
11
10
  @lines = File.exist?(@datafile) ? File.readlines(@datafile) : []
12
- # f.puts #{@lines.inspect} in #{Dir.pwd}"
13
11
  File.open("/tmp/mehhh", "w") {|f| f.puts "#{@lines.inspect} in #{Dir.pwd}" }
14
12
  end
15
13
 
@@ -50,7 +48,7 @@ class ::RuneBlog::Widget
50
48
  mainfile = "#{tag}-main"
51
49
  File.open("#{mainfile}.html", "w") do |f|
52
50
  _html_body(f, css) do
53
- f.puts "<!-- #{@lines.inspect} in #{Dir.pwd} -->"
51
+ f.puts "<!-- #{@lines.inspect} in #{Dir.pwd} -->"
54
52
  f.puts "<h1>#{card_title}</h1><br><hr>"
55
53
  @links.each do |title, file|
56
54
  title = title.gsub(/\\/, "") # kludge
@@ -480,7 +480,18 @@ def pinned_rebuild
480
480
  widget = code.new(@blog)
481
481
  widget.build
482
482
  end
483
- _include_file wtag/"pinned-card.html"
483
+ # _include_file wtag/"pinned-card.html"
484
+ end
485
+ end
486
+ end
487
+
488
+ def _handle_standard_widget(tag)
489
+ wtag = :widgets/tag
490
+ code = _load_local(tag)
491
+ if code
492
+ Dir.chdir(wtag) do
493
+ widget = code.new(@blog)
494
+ widget.build
484
495
  end
485
496
  end
486
497
  end
@@ -494,7 +505,7 @@ def sidebar
494
505
 
495
506
  _out %[<div class="col-lg-3 col-md-3 col-sm-3 col-xs-12">]
496
507
 
497
- standard = %w[pinned pages links]
508
+ standard = %w[pinned pages links news]
498
509
 
499
510
  _body do |token|
500
511
  tag = token.chomp.strip.downcase
@@ -502,27 +513,18 @@ def sidebar
502
513
  raise "Can't find #{wtag}" unless Dir.exist?(wtag)
503
514
  tcard = "#{tag}-card.html"
504
515
 
505
- code = _load_local(tag)
506
- if code
507
- if ["news", "pages", "links", "pinned"].include? tag
508
- Dir.chdir(wtag) do
509
- widget = code.new(@blog)
510
- widget.build
516
+ case
517
+ when standard.include?(tag)
518
+ _handle_standard_widget(tag)
519
+ when tag == "ad"
520
+ num = rand(1..4)
521
+ img = "widgets/ad/ad#{num}.png"
522
+ src, dst = img, @root/:views/@view_name/"remote/widgets/ad/"
523
+ system!("cp #{src} #{dst}") # , show: true)
524
+ File.open(wtag/"vars.lt3", "w") do |f|
525
+ f.puts ".set ad.image = #{img}"
511
526
  end
512
- end
513
- _include_file wtag/tcard
514
- next
515
- end
516
-
517
- if tag == "ad"
518
- num = rand(1..4)
519
- img = "widgets/ad/ad#{num}.png"
520
- src, dst = img, @root/:views/@view_name/"remote/widgets/ad/"
521
- system!("cp #{src} #{dst}") # , show: true)
522
- File.open(wtag/"vars.lt3", "w") do |f|
523
- f.puts ".set ad.image = #{img}"
524
- end
525
- xlate cwd: wtag, src: tag, dst: tcard, force: true # , deps: depend # , debug: true
527
+ xlate cwd: wtag, src: tag, dst: tcard, force: true # , deps: depend # , debug: true
526
528
  end
527
529
 
528
530
  _include_file wtag/tcard
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.2.61"
5
+ VERSION = "0.2.62"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
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.2.61
4
+ version: 0.2.62
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-11-12 00:00:00.000000000 Z
11
+ date: 2019-11-18 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext