runeblog 0.1.75 → 0.1.76

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: 0470ad7c94aa5cb9de8da34f2939c4dcab2f763da6c2dafb21ef2cf7e736b4c2
4
- data.tar.gz: e254ba0ab1d45cea175e1e74e2d00c2dde7889f407c544f41d226342e8a6411f
3
+ metadata.gz: 9820213ad610c3b8f8372fc6ba3e4b276a171e0fcf45392713c862d968aedafe
4
+ data.tar.gz: e55b2c905d49352cac5d38b663e02857082277c21dd32644f8cb010c6aa7b054
5
5
  SHA512:
6
- metadata.gz: 99fe9e5f8b55e3fa7831adc49ca9a32ea26ea842a927fa497cc70c611f80c8c8cd60f83d83dcfaa5501d392cdedd528d16a5b018b342ef33009f9a621399b1d8
7
- data.tar.gz: 89109d824983f4f2d342ac1e1f5a29d233776f38a68387045053f86a4dcef2217740818daa448cfe6fef8389285307c2c196a8347dce55581a58f7b49a9e9861
6
+ metadata.gz: 6c277ed7f2e698c0750b60cb914f4ad161b1e189d322f1bf28275f59df38196bd219cc5ad2d165a7f2f50242107385a27aa17bfd8cf7b9db4018a64b6b0022c4
7
+ data.tar.gz: e888d0b904dbd275a4fd5befe62fb7af5723aed24c7b4a3883e5e6515939883a4f2e8f51640353be60615a618cdc3fdf3421a8bef1d938840a7e32ac49f59ea1
Binary file
@@ -0,0 +1,69 @@
1
+ def RuneBlog.teaser_template(title: "No title", date:, view: "test_view",
2
+ teaser: "No teaser", body: "No body", slug:)
3
+ <<-TEXT
4
+ <html>
5
+
6
+ <body>
7
+
8
+ <script>
9
+ window.fbAsyncInit = function() {
10
+ FB.init({
11
+ appId : '1176481582378716',
12
+ xfbml : true,
13
+ version : 'v2.4'
14
+ });
15
+ };
16
+
17
+ (function(d, s, id){
18
+ var js, fjs = d.getElementsByTagName(s)[0];
19
+ if (d.getElementById(id)) {return;}
20
+ js = d.createElement(s); js.id = id;
21
+ js.src = '//connect.facebook.net/en_US/sdk.js';
22
+ fjs.parentNode.insertBefore(js, fjs);
23
+ }(document, 'script', 'facebook-jssdk'));
24
+ </script>
25
+ <!-- meta property='fb:admins' content='767352779' /> -->
26
+ <meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
27
+ <meta property='og:type' content='article'/>
28
+ <meta property='og:title' content='#{title}'/>
29
+ <meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
30
+ <meta property='og:description' content='#{teaser}'/>
31
+
32
+ <table bgcolor=#eeeeee cellspacing=5>
33
+ <tr>
34
+ <td valign=top>
35
+ <br> <font size=+2 color=red>#{title}</font> <br> #{date}
36
+ </td>
37
+ <td width=2% bgcolor=red></td>
38
+ <td valign=top>
39
+ <a href='https://twitter.com/share'
40
+ class='twitter-share-button'
41
+ data-text='#{title}'
42
+ data-url='#{'url'}'
43
+ data-via='hal_fulton'
44
+ data-related='hal_fulton'>Tweet</a>
45
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
46
+ <br>
47
+ <a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
48
+ <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
49
+
50
+ <br>
51
+ <div
52
+ class='fb-like'
53
+ data-share='true'
54
+ data-width='450'
55
+ data-show-faces='true'>
56
+ </div>
57
+ </td>
58
+ </tr>
59
+ </table>
60
+ <hr>
61
+
62
+ #{body}
63
+
64
+ <hr>
65
+ <a href="http://rubyhacker.com/blog2" style="text-decoration: none">Back</a>
66
+ <a href="http://rubyhacker.com" style="text-decoration: none">Home</a>
67
+ TEXT
68
+ end
69
+
@@ -2,30 +2,6 @@ class RuneBlog::Default
2
2
 
3
3
  # This will all become much more generic later.
4
4
 
5
- BlogTemplate = <<-TEXT
6
- .mixin liveblog
7
-
8
- .title Fake Blog, Fake Title, Fake Author
9
-
10
- <table>
11
- <tr>
12
- <td>
13
- .image fakeimage.jpg
14
- </td>
15
- <td valign=top>
16
- .h3 Yet another blog...
17
- .h4 by Kilgore Trout
18
- .br 2
19
- If you're the kind of person who likes this sort of thing,
20
- then this is the sort of thing a person like you will like.
21
- .br 2
22
- Don't you feel more like you do now than before you read this?
23
- </td>
24
- </tr>
25
- </table>
26
- .hr
27
- TEASERS
28
- TEXT
29
5
 
30
6
  def RuneBlog.post_template(title: "No title", date: nil, view: "test_view",
31
7
  teaser: "No teaser", body: "No body", tags: ["untagged"],
@@ -53,73 +29,7 @@ TEXT
53
29
 
54
30
  end
55
31
 
56
- def RuneBlog.teaser_template(title: "No title", date:, view: "test_view",
57
- teaser: "No teaser", body: "No body", slug:)
58
- <<-TEXT
59
- <html>
60
-
61
- <body>
62
-
63
- <script>
64
- window.fbAsyncInit = function() {
65
- FB.init({
66
- appId : '1176481582378716',
67
- xfbml : true,
68
- version : 'v2.4'
69
- });
70
- };
71
-
72
- (function(d, s, id){
73
- var js, fjs = d.getElementsByTagName(s)[0];
74
- if (d.getElementById(id)) {return;}
75
- js = d.createElement(s); js.id = id;
76
- js.src = '//connect.facebook.net/en_US/sdk.js';
77
- fjs.parentNode.insertBefore(js, fjs);
78
- }(document, 'script', 'facebook-jssdk'));
79
- </script>
80
- <!-- meta property='fb:admins' content='767352779' /> -->
81
- <meta property='og:url' content='http://rubyhacker.com/blog2/#{slug}.html'/>
82
- <meta property='og:type' content='article'/>
83
- <meta property='og:title' content='#{title}'/>
84
- <meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
85
- <meta property='og:description' content='#{teaser}'/>
86
-
87
- <table bgcolor=#eeeeee cellspacing=5>
88
- <tr>
89
- <td valign=top>
90
- <br> <font size=+2 color=red>#{title}</font> <br> #{date}
91
- </td>
92
- <td width=2% bgcolor=red></td>
93
- <td valign=top>
94
- <a href='https://twitter.com/share'
95
- class='twitter-share-button'
96
- data-text='#{title}'
97
- data-url='#{'url'}'
98
- data-via='hal_fulton'
99
- data-related='hal_fulton'>Tweet</a>
100
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
101
- <br>
102
- <a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
103
- <script>!function(d,s,id){var js,fjs=d.getElementsByTagName(s)[0],p=/^http:/.test(d.location)?'http':'https';if(!d.getElementById(id)){js=d.createElement(s);js.id=id;js.src=p+'://platform.twitter.com/widgets.js';fjs.parentNode.insertBefore(js,fjs);}}(document, 'script', 'twitter-wjs');</script>
104
-
105
- <br>
106
- <div
107
- class='fb-like'
108
- data-share='true'
109
- data-width='450'
110
- data-show-faces='true'>
111
- </div>
112
- </td>
113
- </tr>
114
- </table>
115
- <hr>
32
+ end
116
33
 
117
- #{body}
118
34
 
119
- <hr>
120
- <a href="http://rubyhacker.com/blog2" style="text-decoration: none">Back</a>
121
- <a href="http://rubyhacker.com" style="text-decoration: none">Home</a>
122
- TEXT
123
- end
124
35
 
125
- end
@@ -17,6 +17,8 @@ class RuneBlog
17
17
  end
18
18
  end
19
19
 
20
+ # Refactor, move stuff elsewhere?
21
+
20
22
  def make_exception(sym, str)
21
23
  return if Object.constants.include?(sym)
22
24
  Object.const_set(sym, StandardError.dup)
@@ -135,6 +135,7 @@ module RuneBlog::REPL
135
135
  end
136
136
 
137
137
  def flush_output(initial = "")
138
+ CantOpen
138
139
  @out ||= ""
139
140
  puts @out
140
141
  reset_output
@@ -1,7 +1,6 @@
1
1
  require 'helpers-blog'
2
- require 'runeblog'
3
-
4
- make_exception(:NoBlogAccessor, "Runeblog.blog is not set")
2
+ # require 'runeblog'
3
+ require 'global'
5
4
 
6
5
  class RuneBlog::Post
7
6
 
@@ -71,7 +70,6 @@ class RuneBlog::Post
71
70
  end
72
71
 
73
72
  def self.create(title, teaser = "", body = "")
74
- # STDERR.puts "-- create: teaser = #{teaser.inspect} body = #{body.inspect}"
75
73
  debug "=== Post.create #{title.inspect} pwd = #{Dir.pwd}"
76
74
  post = self.new
77
75
  post.new_metadata(title.chomp, teaser.chomp, body.chomp)
@@ -83,13 +81,11 @@ class RuneBlog::Post
83
81
  end
84
82
 
85
83
  def new_metadata(title, teaser = nil, body = nil)
86
- # STDERR.puts "-- new_meta: teaser = #{teaser.inspect} body = #{body.inspect}"
87
84
  verify(title.is_a?(String) => "Title #{title.inspect} is not a string")
88
85
  meta = OpenStruct.new
89
86
  meta.title = title
90
87
  meta.teaser ||= teaser
91
88
  meta.body ||= body
92
- # STDERR.puts "-- new_meta2: teaser = #{meta.teaser.inspect} body = #{meta.body.inspect}"
93
89
  meta.pubdate = Time.now.strftime("%Y-%m-%d")
94
90
  meta.date = meta.pubdate # fix later
95
91
  meta.views = [@blog.view.to_s]
@@ -101,6 +97,7 @@ class RuneBlog::Post
101
97
  end
102
98
 
103
99
  def create_draft
100
+ # FIXME obsolete
104
101
  # STDERR.puts "-- create_draft: teaser = #{@meta.teaser.inspect} body = #{@meta.body.inspect}"
105
102
  viewhome = @blog.view.publisher.url
106
103
  html = RuneBlog.post_template(title: @meta.title, date: @meta.pubdate,
@@ -127,7 +124,7 @@ class RuneBlog::Post
127
124
  debug "=== build"
128
125
  views = @meta.views
129
126
  text = File.read(@draft)
130
- STDERR.puts "-- build: draft = #{@draft.inspect}"
127
+ # STDERR.puts "-- build: draft = #{@draft.inspect}"
131
128
  livetext = Livetext.new(STDOUT)
132
129
  Livetext.parameters = [@blog, @meta.num, livetext]
133
130
  meta = livetext.process_text(text)
@@ -1,5 +1,6 @@
1
1
  require 'helpers-blog'
2
- require 'runeblog'
2
+ # require 'runeblog'
3
+ require 'global'
3
4
 
4
5
  class RuneBlog::Publishing
5
6
  attr_reader :user, :server, :docroot, :path
@@ -32,17 +33,10 @@ class RuneBlog::Publishing
32
33
 
33
34
  def system!(str)
34
35
  rc = system(str)
35
- debug "Running: #{str}"
36
- debug "Failed!\n " if ! rc
37
36
  rc
38
37
  end
39
38
 
40
- # Could not copy
41
- # /Users/Hal/Dropbox/files/runeblog/.blogs/data/views/alpha_view/index.html to
42
- # root@rubyhacker.com:/var/www/testblog/alpha_view
43
-
44
39
  def publish(files, assets=[])
45
- STDERR.puts "-- publish: files = #{files.inspect} assets = #{assets.inspect}"
46
40
  dir = "#@docroot/#@path"
47
41
  view_name = @blog.view.name
48
42
  viewpath = "#{dir}/#{view_name}"
@@ -1,4 +1,5 @@
1
- require 'runeblog'
1
+ # require 'runeblog'
2
+ require 'global'
2
3
  require 'ostruct'
3
4
  require 'helpers-repl' # FIXME structure
4
5
 
@@ -400,3 +401,4 @@ module RuneBlog::REPL
400
401
  end
401
402
 
402
403
  end
404
+
@@ -26,6 +26,8 @@ class RuneBlog
26
26
  make_exception(:EditorProblem, "Could not edit $1")
27
27
  make_exception(:NoSuchView, "No such view: $1")
28
28
  make_exception(:LivetextError, "Livetext#process_file returned nil for $1")
29
+ make_exception(:NoBlogAccessor, "Runeblog.blog is not set")
30
+
29
31
 
30
32
  class << self
31
33
  attr_accessor :blog
@@ -169,7 +171,7 @@ class RuneBlog
169
171
  create_dir("generated")
170
172
  create_dir('assets')
171
173
 
172
- Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz 2>/dev/null") }
174
+ Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz >/dev/null 2>&1") }
173
175
  system("cp themes/standard/blog/assets/* assets/")
174
176
 
175
177
  pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
@@ -182,7 +184,7 @@ class RuneBlog
182
184
  vdir = self.view.dir
183
185
  dir0 = "#{vdir}/themes/standard/blog"
184
186
  dir1 = "#{vdir}/generated"
185
- system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/index.err")
187
+ system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/errors.txt")
186
188
  dump("Initial creation", "last_published")
187
189
  Dir.chdir(up)
188
190
  @views << view
@@ -279,7 +281,7 @@ class RuneBlog
279
281
  vdir = self.view.dir
280
282
  dir0 = "#{vdir}/themes/standard/blog"
281
283
  dir1 = "#{vdir}/generated"
282
- system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/index.err")
284
+ system("livetext #{dir0}/generate.lt3 >#{dir1}/index.html 2>#{dir1}/errors.txt")
283
285
  rescue => err
284
286
  error(err)
285
287
  exit
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.75"
3
+ VERSION = "0.1.76"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
@@ -1,5 +1,6 @@
1
1
  require 'helpers-blog'
2
- require 'runeblog'
2
+ # require 'runeblog'
3
+ require 'global'
3
4
 
4
5
  class RuneBlog::View
5
6
  attr_reader :name, :state
@@ -39,17 +40,13 @@ class RuneBlog::View
39
40
  vdir = dir()
40
41
  files = [local_index()]
41
42
  others = Dir.entries(vdir + "/generated").grep(/^\d\d\d\d/).map {|x| "#{vdir}/generated/#{x}" }
42
- STDERR.puts "-- publishable: others = #{others.inspect}"
43
43
  deep_assets = Dir["#{vdir}/themes/standard/assets/*"]
44
- # Do this at view creation
45
- deep_assets.each do |file|
44
+ deep_assets.each do |file| # Do this at view creation
46
45
  cmd = "cp #{file} #{vdir}/assets"
47
- STDERR.puts "-- cmd = #{cmd}"
48
46
  system(cmd)
49
47
  end
50
48
  assets = Dir.entries("#{vdir}/assets") - %w[. ..]
51
49
  assets.map! {|x| "#{vdir}/assets/#{x}" }
52
- STDERR.puts "-- publishable: assets = #{assets.inspect}"
53
50
  assets.reject! {|x| File.directory?(x) }
54
51
  # assets.reject! {|x| ! recent?(x) }
55
52
  files = files + others
@@ -28,7 +28,7 @@ spec = Gem::Specification.new do |s|
28
28
  Find.find("lib").to_a
29
29
 
30
30
  Dir.chdir("data") do
31
- system("tar zcvf standard.tgz standard/")
31
+ system("tar zcvf standard.tgz standard/ >/dev/null 2>&1")
32
32
  end
33
33
 
34
34
  std_theme = ["data/standard.tgz"]
@@ -5,6 +5,7 @@ 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 'runeblog'
8
9
  require 'repl'
9
10
 
10
11
  def getch
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.75
4
+ version: 0.1.76
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-05-27 00:00:00.000000000 Z
11
+ date: 2019-06-01 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -62,6 +62,7 @@ files:
62
62
  - "./runeblog.gemspec"
63
63
  - bin/blog
64
64
  - data/standard.tgz
65
+ - lib/Javascript.stuff
65
66
  - lib/default.rb
66
67
  - lib/global.rb
67
68
  - lib/helpers-blog.rb