runeblog 0.0.21 → 0.0.22

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
  SHA1:
3
- metadata.gz: 35cd3bc45d63b45e744878d45dab9423d7a634e1
4
- data.tar.gz: 31b0ec4d3168c9c7a69aa24fa9f7962b5f848ce0
3
+ metadata.gz: 721d30357bcb2f565178240d079daf73248427b1
4
+ data.tar.gz: 70e2012df72bfc1b2c65ee71d1068a488dfe7f5a
5
5
  SHA512:
6
- metadata.gz: 597ff3b26850ad4b4d329dfdd6e1cad31fe7636fbcef0f8a42af92cbae2072e802207f094d84084b5ea12923e2f9d44dd5dcd1c580b3d8839b19e2f927c4a06f
7
- data.tar.gz: cde7e7c1eec5f05ea3a1acb2adf6646e0ac60995a81dc6637e7ce1a79e6577721b3852608383e68ab460c24569bea7bd7d9caa2888d5efbe938ef8d5226b3bda
6
+ metadata.gz: 50fcf54c8859478e0a80e03e5d53cec8d693577b89f32e59c8c3819d7fbb807daef7cc5c575355e3ebfd480575f740a3d806700184f12cbb2905332dfab74131
7
+ data.tar.gz: ea0219c4433c2bf9dff427c48ae6b14d64a4f4cfbeb8b430680241eea8d83e05ca0b5b5006ef2e5949f740d4b6eedfb11ba3207db34a4c59345f550baa5e92ba
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.21 2017-05-08
1
+ RuneBlog v 0.0.22 2017-05-08
@@ -1,6 +1,6 @@
1
1
  <html>
2
2
 
3
- <body background="speckle-texture-vector.jpg">
3
+ <body background=;speckle-texture-vector.jpg;>
4
4
 
5
5
  <script>
6
6
  window.fbAsyncInit = function() {
@@ -15,24 +15,22 @@
15
15
  var js, fjs = d.getElementsByTagName(s)[0];
16
16
  if (d.getElementById(id)) {return;}
17
17
  js = d.createElement(s); js.id = id;
18
- js.src = "//connect.facebook.net/en_US/sdk.js";
18
+ js.src = ;//connect.facebook.net/en_US/sdk.js;;
19
19
  fjs.parentNode.insertBefore(js, fjs);
20
20
  }(document, 'script', 'facebook-jssdk'));
21
21
  </script>
22
22
 
23
23
  <head>
24
24
  <title>#{title}</title>
25
- <meta property="fb:admins" content="767352779" />
25
+ <meta property=;fb:admins; content=;767352779; />
26
26
 
27
- <meta property="og:url" content="http://rubyhacker.com/blog2/#{slug}.html"/>
28
- <meta property="og:type" content="article"/>
29
- <meta property="og:title" content="#{title}"/>
30
- <meta property="og:image" content="http://rubyhacker.com/blog2/blog3b.gif"/>
31
- <meta property="og:description" content="#{teaser}"/>
27
+ <meta property=;og:url; content=;http://rubyhacker.com/blog2/#{slug}.html;/>
28
+ <meta property=;og:type; content=;article;/>
29
+ <meta property=;og:title; content=;#{title};/>
30
+ <meta property=;og:image; content=;http://rubyhacker.com/blog2/blog3b.gif;/>
31
+ <meta property=;og:description; content=;#{teaser};/>
32
32
  </head>
33
33
 
34
- <body background="speckle-texture-vector.jpg">
35
-
36
34
  <table bgcolor=#eeeeee>
37
35
  <tr height=5>
38
36
  <tr>
@@ -45,19 +43,19 @@
45
43
  </td>
46
44
  <td width=5%></td>
47
45
  <td align=top>
48
- <a href="https://twitter.com/share" class="twitter-share-button" data-text="#{tweet}" data-url="#{url}" data-via="hal_fulton" data-related="hal_fulton">Tweet</a>
46
+ <a href=;https://twitter.com/share; class=;twitter-share-button; data-text=;#{tweet}; data-url=;#{url}; data-via=;hal_fulton; data-related=;hal_fulton;>Tweet</a>
49
47
  <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>
50
48
  <br>
51
- <a href="https://twitter.com/hal_fulton" class="twitter-follow-button" data-show-count="false">Follow @hal_fulton</a>
49
+ <a href=;https://twitter.com/hal_fulton; class=;twitter-follow-button; data-show-count=;false;>Follow @hal_fulton</a>
52
50
  <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>
53
51
 
54
52
 
55
53
  <body>
56
54
  <div
57
- class="fb-like"
58
- data-share="true"
59
- data-width="450"
60
- data-show-faces="true">
55
+ class=;fb-like;
56
+ data-share=;true;
57
+ data-width=;450;
58
+ data-show-faces=;true;>
61
59
  </div>
62
60
 
63
61
  <hr>
data/lib/runeblog.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.0.21"
3
+ VERSION = "0.0.22"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  DefaultData = Path + "/../data"
@@ -33,6 +33,10 @@ def bold(str)
33
33
  "\e[1m#{str}\e[22m"
34
34
  end
35
35
 
36
+ def interpolate(str)
37
+ wrap = "<<-EOS\n#{str}EOS"
38
+ eval wrap
39
+ end
36
40
 
37
41
 
38
42
  ### ask
@@ -68,7 +72,7 @@ def new_blog!
68
72
  f.puts "data"
69
73
  f.puts "no_default"
70
74
  end
71
- system("echo Created #{Time.now} >>data/VERSION")
75
+ File.open("data/VERSION", "a") {|f| f.puts "\nBlog created: " + Time.now.to_s }
72
76
  end
73
77
  end
74
78
  end
@@ -185,12 +189,12 @@ def generate_index(view)
185
189
  posts = posts.sort.reverse
186
190
 
187
191
  # Add view header/trailer
188
- @bloghead = File.read("#{vdir}/custom/blogheader.html") rescue ""
189
- @blogtail = File.read("#{vdir}/custom/blogtrailer.html") rescue ""
192
+ @bloghead = interpolate(BlogHeader)
193
+ @blogtail = interpolate(BlogTrailer)
190
194
 
191
195
  # Output view
192
196
  posts.map! {|post| YAML.load(File.read("#{vdir}/#{post}/metadata.yaml")) }
193
- out = @bloghead.dup
197
+ out = @bloghead
194
198
  posts.each {|post| out << posting(view, post) }
195
199
  out << @blogtail
196
200
  File.open("#{vdir}/index.html", "w") {|f| f.puts out }
@@ -201,17 +205,14 @@ end
201
205
  def link_post_view(view)
202
206
  # Create dir using slug (index.html, metadata?)
203
207
  vdir = "#{@config.root}/views/#{view}"
204
- p "vdir = #{vdir}"
205
208
  dir = "#{vdir}/#{@meta.slug}"
206
- p "dir = #{dir}"
207
- p "cwd = #{Dir.pwd}"
208
209
  cmd = "mkdir -p #{dir}" #-- FIXME what if this exists??
209
210
  puts " Running: #{cmd}"
210
211
  system(cmd)
211
212
  File.write("#{dir}/metadata.yaml", @meta.to_yaml)
212
213
  # Add header/trailer to post index
213
- @posthead ||= File.read("#{vdir}/postheader.html") rescue ""
214
- @posttail ||= File.read("#{vdir}/posttrailer.html") rescue ""
214
+ @posthead = interpolate(PostHeader)
215
+ @posttail = interpolate(PostTrailer)
215
216
  File.open("#{dir}/index.html", "w") do |f|
216
217
  f.puts @posthead
217
218
  f.puts @meta.body
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.0.21
4
+ version: 0.0.22
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton