runeblog 0.1.15 → 0.1.16

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: d825d310af8777f9434275721f46b05597bf3942abd80abb044937781ac2985c
4
- data.tar.gz: 92d087740a685d488745b35d26ff295c30fbde3a4b349427c6d741e782e3dd77
3
+ metadata.gz: a430f05e99cacbffb7eda0025f5cfdddb3d688ff0450ae6c3972da8f9c5bbd55
4
+ data.tar.gz: 6f3a6f70702041640e119168290228d95d2e24c4536ce13b483556b77670a8ca
5
5
  SHA512:
6
- metadata.gz: b689cf2a6f7eaad23b6cbce82855dd6028c869b17af9de003415a04d07f8dccddfa87606eff99c37f401a723bf2b1b766f55d973e2ce512717a4a2e365cda34c
7
- data.tar.gz: 9b41b9ac7378953f036df1164e92ea8dba199963fe2eacfb3c9757042441b0a5d8f29fcfca3048ae0a33110f9d1d1aa33ea995fc116344fbeba2298804f2ce9e
6
+ metadata.gz: 692090810d4084c10ff355dfa9c52d96f68ffb54f5ab6ab2771db393fc63313d893156fd100a8dc1f496991af1849851df5e902e0c7d8d3e3283c8eedd10eb04
7
+ data.tar.gz: dda041ee187d5aa62c5460db0111e7af794d2d55d240b6555574a1542b1b4959b57c5ee4dd2d0e3f6777dc238ae43a82cc5ae6ea79c17e0acd49ba8c066ec7a1
data/bin/blog CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # $LOAD_PATH << "./lib"
4
4
 
5
- require 'global'
5
+ require 'runeblog'
6
6
  require 'rubytext'
7
7
 
8
8
  require 'repl'
@@ -119,93 +119,4 @@ def RuneBlog.teaser_template(title: "No title", date: nil, view: "test_view",
119
119
  TEXT
120
120
  end
121
121
 
122
- PostTemplate = <<-'TEXT' # interpolate later
123
- .mixin liveblog
124
-
125
- .title #{@meta.title}
126
- .pubdate #{@meta.date}
127
- .views #{@meta.view}
128
- .tags
129
-
130
- .teaser
131
- #{@meta.teaser}
132
- .end
133
- #{@meta.body}
134
- TEXT
135
-
136
-
137
- TeaserTemplate = <<-'TEXT' # interpolate later
138
- <html>
139
-
140
- <body>
141
-
142
- <script>
143
- window.fbAsyncInit = function() {
144
- FB.init({
145
- appId : '1176481582378716',
146
- xfbml : true,
147
- version : 'v2.4'
148
- });
149
- };
150
-
151
- (function(d, s, id){
152
- var js, fjs = d.getElementsByTagName(s)[0];
153
- if (d.getElementById(id)) {return;}
154
- js = d.createElement(s); js.id = id;
155
- js.src = '//connect.facebook.net/en_US/sdk.js';
156
- fjs.parentNode.insertBefore(js, fjs);
157
- }(document, 'script', 'facebook-jssdk'));
158
- </script>
159
-
160
- <!-- meta property='fb:admins' content='767352779' /> -->
161
- <meta property='og:url' content='http://rubyhacker.com/blog2/#{@meta.slug}.html'/>
162
- <meta property='og:type' content='article'/>
163
- <meta property='og:title' content='#{@meta.title}'/>
164
- <meta property='og:image' content='http://rubyhacker.com/blog2/blog3b.gif'/>
165
- <meta property='og:description' content='#{@meta.teaser}'/>
166
-
167
- <table bgcolor=#eeeeee cellspacing=5>
168
- <tr>
169
- <td valign=top>
170
- <br> <font size=+2 color=red>#{@meta.title.chomp}</font> <br> #{@meta.pubdate.chomp}
171
- </td>
172
-
173
- <td width=2% bgcolor=red></td>
174
-
175
- <td valign=top>
176
- <a href='https://twitter.com/share'
177
- class='twitter-share-button'
178
- data-text='#{@meta.title}'
179
- data-url='#{'url'}'
180
- data-via='hal_fulton'
181
- data-related='hal_fulton'>Tweet</a>
182
- <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>
183
- <br>
184
- <a href='https://twitter.com/hal_fulton' class='twitter-follow-button' data-show-count='false'>Follow @hal_fulton</a>
185
- <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>
186
-
187
- <br>
188
- <div
189
- class='fb-like'
190
- data-share='true'
191
- data-width='450'
192
- data-show-faces='true'>
193
- </div>
194
-
195
- </td>
196
-
197
- </tr>
198
- </table>
199
-
200
-
201
- <hr>
202
-
203
- #{@meta.body}
204
-
205
-
206
- <hr>
207
- <a href="http://rubyhacker.com/blog2" style="text-decoration: none">Back</a>
208
- <a href="http://rubyhacker.com" style="text-decoration: none">Home</a>
209
- TEXT
210
-
211
122
  end
@@ -62,7 +62,6 @@ class RuneBlog::Post
62
62
  end
63
63
 
64
64
  def initialize
65
- # nothing yet...
66
65
  @blog = RuneBlog.blog || raise(NoBlogAccessor)
67
66
  end
68
67
 
@@ -92,7 +91,7 @@ class RuneBlog::Post
92
91
  def create_draft
93
92
  html = RuneBlog.post_template(title: @meta.title, date: @meta.pubdate,
94
93
  view: @meta.view, teaser: @meta.teaser, body: @meta.body)
95
- @draft = "#{@blog.root}/src/#{slug}.lt3"
94
+ @draft = "#{@blog.root}/src/#{@meta.slug}.lt3"
96
95
  dump(html, @draft)
97
96
  end
98
97
 
@@ -28,31 +28,28 @@ class RuneBlog::Publishing
28
28
  def url
29
29
  url = "#@proto://#@server/#@path"
30
30
  end
31
-
32
- def publish(files)
33
- puts "--- pub 1"
31
+
32
+ def no_files?(files)
34
33
  if files.empty?
35
34
  STDSCR.up
36
35
  puts "\n No files to publish"
37
- return false
36
+ true
37
+ else
38
+ false
38
39
  end
39
- puts "--- pub 2"
40
- debug "files = #{files.inspect}"
40
+ end
41
+
42
+ def publish(files)
43
+ return false if no_files?(files)
44
+ # print " Publishing #{files.size} files... "
45
+ # debug "files = #{files.inspect}"
41
46
  dir = "#@docroot/#@path"
42
47
  result = system("ssh #@user@#@server -x mkdir -p #{dir}")
43
- puts "--- pub 3"
44
48
  list = files.join(' ')
45
49
  cmd = "scp -r #{list} #@user@#@server:#{dir} >/dev/null 2>/tmp/wtf"
46
- puts "Publishing #{files.size} files...\n "
47
50
  debug "cmd = #{cmd.inspect} - see /tmp/wtf"
48
- puts "--- pub 4"
49
51
  result = system(cmd)
50
- if not result
51
- debug "error = #{File.read("/tmp/wtf")}"
52
- getch
53
- raise PublishError
54
- end
55
-
52
+ raise PublishError if !result
56
53
  dump(files, "#{@blog.view.dir}/last_published")
57
54
  true
58
55
  end
@@ -79,12 +79,12 @@ module RuneBlog::REPL
79
79
  output! "Can't publish without entries in #{@blog.view.name}/publish"
80
80
  return [false, @out]
81
81
  end
82
- ret = RubyText.spinner { @blog.view.publish }
82
+ ret = RubyText.spinner(label: "Publishing... ") { @blog.view.publish }
83
83
  return [false, @out] unless ret
84
84
  vdir = @blog.view.dir
85
85
  dump("fix this later", "#{vdir}/last_published")
86
86
  if ! testing || ! ret
87
- puts " ...finished.\n "
87
+ puts " ...finished.\n "
88
88
  output! "...finished.\n"
89
89
  end
90
90
  return [false, @out]
@@ -136,7 +136,7 @@ class RuneBlog
136
136
  dump(pub, "publish") # FIXME publish
137
137
  dump(x::BlogHeader, "custom/blog_header.html")
138
138
  dump(x::BlogTrailer, "custom/blog_trailer.html")
139
- dump(x::PostTemplate, "custom/post_template.html")
139
+ # dump(x::PostTemplate, "custom/post_template.html")
140
140
  dump("Initial creation", "last_published")
141
141
  Dir.chdir(up)
142
142
  @views << RuneBlog::View.new(arg)
@@ -267,7 +267,7 @@ class RuneBlog
267
267
 
268
268
  def index_entry(view, meta)
269
269
  check_meta(meta, "index_entry1")
270
- debug "\nindex_entry: meta = #{meta.inspect}"
270
+ # debug "\nindex_entry: meta = #{meta.inspect}"
271
271
  raise ArgumentError unless view.is_a?(String) || view.is_a?(RuneBlog::View)
272
272
  check_meta(meta, "index_entry2")
273
273
  self.make_slug(meta) # RuneBlog#index_entry
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.15"
3
+ VERSION = "0.1.16"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
@@ -34,12 +34,9 @@ class RuneBlog::View
34
34
  def files(recent = false)
35
35
  vdir = dir()
36
36
  files = [index()]
37
- debug "Looking in #{vdir}"
38
37
  others = Dir.entries(vdir).grep(/^\d\d\d\d/)
39
38
  files += others.map {|x| "#{vdir}/#{x}" }
40
- debug "Found #{files.inspect}"
41
39
  files.reject! {|f| ! recent?(f) } if recent
42
- debug "Now files = #{files.inspect}"
43
40
  files
44
41
  end
45
42
 
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.15
4
+ version: 0.1.16
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton