runeblog 0.2.95 → 0.2.96

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a8c06b3d51a33a85b3420099bf6f6c40e3ac38bdc80b2c2ea5a77de81936f280
4
- data.tar.gz: a28b089f368d4941418ace35fba818f13d7458362863002ab25d9ebefdfae706
3
+ metadata.gz: 43bbc2d314d9a90cd34f558050a736ed58423f95576b0e32c3e36fc1405d756d
4
+ data.tar.gz: fcb2d941bff2c4c0bb3e609b347f1afcf9a13bb8073b2868a1af6d07c0883332
5
5
  SHA512:
6
- metadata.gz: ffd6c82a51c01169b5a045d3f8c2a4f3f2db2230458c8cc4e7eff2740a0d3a0cf424a198a3187a888dd92b3c4976dd41597bae012514b3829c4921ad8750ef04
7
- data.tar.gz: b47ac4fd2c6733a5433cf83d6c11c71f8b41bd71681826fadc9f4f98f57338fccc45491babbac7389f51cdd2927b04dee07f85aecfe68c8c75af0807ad03bd67
6
+ metadata.gz: 0a6446ceda937da5da353cc0b1259c1ad54743b936e36c4f45fadf2cc4e8def5ee2d8f227ef4f2c5e63e192eabd27134ddfd36de533364fe35d4177d45d335b9
7
+ data.tar.gz: 59c9fbab3e634c7fc99e147211b35e893b48cf6930deb331cba3cb1dbf36807bd746d8579c006fd27cd87ce5bd26eb34318b31e6c3c2b9580ae8c9b9856522e4
@@ -0,0 +1,7 @@
1
+ admins 767352779
2
+ appid 1176481582378716
3
+ version v2.4
4
+ xfbml true
5
+ share true
6
+ width 450
7
+ faces true
@@ -2,20 +2,25 @@ class Livetext::Functions
2
2
 
3
3
  def facebook_init
4
4
  fb_appid = _var("facebook.appid")
5
+ xfbml = _var("facebook.xfbml")
6
+ ver = _var("facebook.version")
7
+ width = _var("facebook.width")
8
+ share = _var("facebook.share")
9
+ faces = _var("facebook.faces")
5
10
  <<~HTML
6
11
  window.fbAsyncInit = function() {
7
12
  FB.init({
8
13
  appId : '#{fb_appid}',
9
- xfbml : true,
10
- version : 'v2.4'
14
+ xfbml : #{xfbml},
15
+ version : '#{ver}'
11
16
  });
12
17
  };
13
18
  HTML
14
19
  end
15
20
 
16
21
  =begin
17
- <!-- Needed: btw what is 'content'?
18
- <meta property='fb:admins' content='767352779'/>
22
+ <!-- Needed:
23
+ <meta property='fb:admins' content='$facebook.admins'/>
19
24
  <meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
20
25
  <meta property='og:type' content='article'/>
21
26
  <meta property='og:title' content='#{title}'/>
@@ -27,9 +32,9 @@ class Livetext::Functions
27
32
  def facebook_likes
28
33
  <<~HTML
29
34
  <div class='fb-like'
30
- data-share='true'
31
- data-width='450'
32
- data-show-faces='true'>
35
+ data-share='#{share}'
36
+ data-width='#{width}'
37
+ data-show-faces='#{faces}'>
33
38
  </div>
34
39
  HTML
35
40
  end
@@ -1,9 +1,11 @@
1
+ .variables facebook credentials.txt
2
+
1
3
  <script>
2
4
  window.fbAsyncInit = function() {
3
5
  FB.init({
4
- appId : '1176481582378716',
5
- xfbml : true,
6
- version : 'v2.4'
6
+ appId : '$facebook.appid',
7
+ xfbml : $facebook.xfbml,
8
+ version : '$facebook.ver'
7
9
  });
8
10
  };
9
11
 
@@ -2,7 +2,7 @@
2
2
  import re
3
3
  import praw
4
4
 
5
- f = open("reddit/config.txt", "r")
5
+ f = open("reddit/credentials.txt", "r")
6
6
  lines = f.readlines()
7
7
  f.close()
8
8
 
@@ -0,0 +1,3 @@
1
+ user hal_fulton # via
2
+ related hal_fulton
3
+ count false
@@ -13,8 +13,8 @@ class Livetext::Functions
13
13
  -->
14
14
  =end
15
15
 
16
- def twitter_share
17
- name, title, url = "", "", "" # FIXME
16
+ def twitter_share(title, url)
17
+ name = _var("twitter.user")
18
18
  <<~HTML
19
19
  <a href='https://twitter.com/share'
20
20
  class='twitter-share-button'
@@ -26,7 +26,7 @@ class Livetext::Functions
26
26
  end
27
27
 
28
28
  def twitter_follow
29
- name = "hal_fulton" # FIXME
29
+ name = _var("twitter.user")
30
30
  <<~HTML
31
31
  <a href='https://twitter.com/#{name}' class='twitter-follow-button' data-show-count='false'>Follow @#{name}</a>
32
32
  HTML
data/lib/helpers-blog.rb CHANGED
@@ -33,8 +33,8 @@ module RuneBlog::Helpers
33
33
  when :config
34
34
  files = %w[ROOT VIEW EDITOR universal.lt3 global.lt3]
35
35
  files.each {|file| copy(data + "/" + file, dest) }
36
- when :extra
37
- copy!(extra, dest)
36
+ when :extra # FIXME remove later
37
+ # copy!(extra, dest)
38
38
  end
39
39
  end
40
40
 
data/lib/repl.rb CHANGED
@@ -1,6 +1,7 @@
1
1
  require 'runeblog'
2
2
  require 'ostruct'
3
3
  require 'helpers-repl' # FIXME structure
4
+ require 'pathmagic'
4
5
 
5
6
  make_exception(:PublishError, "Error during publishing")
6
7
  make_exception(:EditorProblem, "Could not edit $1")
@@ -378,10 +379,15 @@ module RuneBlog::REPL
378
379
  v = v.to_s
379
380
  v = fx(v, :bold) if v == @blog.view.name
380
381
  output v + "\n"
381
- puts " ", v unless testing
382
+ # FIXME: next 3 lines are crufty as hell
383
+ lines = File.readlines(@blog.root/"views/#{v}/themes/standard/global.lt3")
384
+ lines = lines.select {|x| x =~ /^blog / && x !~ /VIEW_/ }
385
+ title = lines.first.split(" ", 2)[1]
386
+ print " ", ('%15s' % v) unless testing
387
+ puts " ", fx(title, :black) unless testing
382
388
  end
383
389
  puts unless testing
384
- @out
390
+ # @out
385
391
  end
386
392
 
387
393
  def cmd_list_posts(arg, testing = false)
@@ -400,6 +406,12 @@ module RuneBlog::REPL
400
406
  base = post.sub(/.lt3$/, "")
401
407
  num, rest = base[0..3], base[4..-1]
402
408
  puts " ", fx(num, Red), fx(rest, Blue) unless testing
409
+ draft = @blog.root/:drafts/post + ".lt3"
410
+ other = @blog._get_views(draft) - [@blog.view.to_s]
411
+ unless other.empty?
412
+ print fx(" "*7 + "also in: ", :bold)
413
+ puts other.join(", ")
414
+ end
403
415
  end
404
416
  end
405
417
  puts unless testing
@@ -420,6 +432,11 @@ module RuneBlog::REPL
420
432
  base = draft.sub(/.lt3$/, "")
421
433
  num, rest = base[0..3], base[4..-1]
422
434
  puts " ", fx(num, Red), fx(rest, Blue) unless testing
435
+ other = @blog._get_views(@blog.root/:drafts/draft) - [@blog.view.to_s]
436
+ unless other.empty?
437
+ print fx(" "*7 + "also in: ", :bold)
438
+ puts other.join(", ")
439
+ end
423
440
  end
424
441
  end
425
442
  puts unless testing
@@ -3,7 +3,7 @@ if !defined?(RuneBlog::Path)
3
3
  # if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
4
4
 
5
5
  class RuneBlog
6
- VERSION = "0.2.95"
6
+ VERSION = "0.2.96"
7
7
 
8
8
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
9
9
  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.95
4
+ version: 0.2.96
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-12-22 00:00:00.000000000 Z
11
+ date: 2019-12-24 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -94,14 +94,16 @@ files:
94
94
  - empty_view/config/exper/meta.html
95
95
  - empty_view/config/exper/s2.html
96
96
  - empty_view/config/exper/varmint.rb
97
+ - empty_view/config/facebook/credentials.txt
97
98
  - empty_view/config/facebook/facebook.rb
98
99
  - empty_view/config/facebook/fb.html
99
- - empty_view/config/facebook/fb.js
100
- - empty_view/config/reddit/config.txt
100
+ - empty_view/config/facebook/fb.js.lt3
101
+ - empty_view/config/reddit/credentials.txt
101
102
  - empty_view/config/reddit/notes.txt
102
103
  - empty_view/config/reddit/reddit_post_url.py
103
104
  - empty_view/config/reddit/redpost.rb
104
105
  - empty_view/config/reddit/the-graffiti-wall.html
106
+ - empty_view/config/twitter/credentials.txt
105
107
  - empty_view/config/twitter/tw.html
106
108
  - empty_view/config/twitter/tw.js
107
109
  - empty_view/config/twitter/twitter.rb