runeblog 0.0.18 → 0.0.19

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.
Files changed (4) hide show
  1. checksums.yaml +4 -4
  2. data/data/VERSION +1 -1
  3. data/lib/runeblog.rb +20 -19
  4. metadata +1 -1
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 6afc0631f94efc48845844f2b77c27b4ab4ca80b
4
- data.tar.gz: 34697e121079c1e08f62c1d3109681c4301f3853
3
+ metadata.gz: e1a775d7a2266cf324705bb43a5f4c0b027b4bbb
4
+ data.tar.gz: 6ccaa91f9b29cc0306096b71a9ed10177149a168
5
5
  SHA512:
6
- metadata.gz: 2cec5abaa4ac6d55dd88bb3ade7b8c77b1570ea939614197308b3066e0c4e9e0865ffad610b0ec007f7921fa077272da325d771561a1ce583127b3b8c99ea01b
7
- data.tar.gz: c04585d4b5ec9df5f058b8eb8f6603bf71f5e43bc39f11a759429e8efd7854d31b5054dfc1e6cd9e2a38e48093aeefa48f672a01f5bdf62ec60d68faad0c459b
6
+ metadata.gz: 7b8211572cf28798f56baf01c685800445b8bd7a876999a936116f8cf158f73da0bc3df8292668b65ac24d4f65ea235390b365939b95de84ac94c17dea324a3b
7
+ data.tar.gz: 05c70aeedfb2edcfa7b50977d452542f44d746544839a8d9183b7ec0e70c3a25e50228f0584064d201178b1da23ef5065840fc9cd5f24a7c10171573904b61c3
@@ -1 +1 @@
1
- RuneBlog v 0.0.18 2017-05-06
1
+ RuneBlog v 0.0.19 2017-05-06
@@ -1,5 +1,5 @@
1
1
  class RuneBlog
2
- VERSION = "0.0.18"
2
+ VERSION = "0.0.19"
3
3
 
4
4
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
5
5
  DefaultData = Path + "/../data"
@@ -139,11 +139,13 @@ end
139
139
  ### process_post
140
140
 
141
141
  def process_post(file)
142
- lt ||= Livetext.new
142
+ @main ||= Livetext.new
143
143
  # puts " Processing: #{Dir.pwd}/#{file}"
144
- path = @config.root + "/src/#{file}"
145
- lt.process_file(path)
146
- @meta = lt.main.instance_eval { @meta }
144
+ # path = @config.root + "/src/#{file}"
145
+ @meta = @main.process_file(file)
146
+ @meta.slug = make_slug(@meta.title, @config.sequence)
147
+ # @meta = @main.instance_eval { @meta }
148
+ p @meta
147
149
  @meta.slug = file.sub(/.lt3$/, "")
148
150
  @meta
149
151
  end
@@ -152,21 +154,23 @@ end
152
154
 
153
155
  def reload_post(file)
154
156
  @main ||= Livetext.new
155
- @meta = process_post("#{@config.root}/src/#{file}")
157
+ process_post("#{@config.root}/src/#{file}")
158
+ @meta = @main.instance_eval { @meta }
156
159
  @meta.slug = file.sub(/.lt3$/, "")
157
160
  @meta
158
161
  end
159
162
 
160
163
  ### posting
161
164
 
162
- def posting(meta)
165
+ def posting(view, meta)
166
+ ref = "#{view}/#{meta.slug}/index.html"
163
167
  <<-HTML
164
168
  <br>
165
169
  <font size=+1>#{meta.pubdate}&nbsp;&nbsp;</font>
166
- <font size=+2 color=blue><a href=../#{"FAKEREF"} style="text-decoration: none">#{meta.title}</font></a>
170
+ <font size=+2 color=blue><a href=../#{ref} style="text-decoration: none">#{meta.title}</font></a>
167
171
  <br>
168
172
  #{meta.teaser}
169
- <a href=../#{"FAKEREF2"} style="text-decoration: none">Read more...</a>
173
+ <a href=../#{ref} style="text-decoration: none">Read more...</a>
170
174
  <br><br>
171
175
  <hr>
172
176
  HTML
@@ -179,30 +183,27 @@ def generate_index(view)
179
183
  vdir = "#{@config.root}/views/#{view}"
180
184
  posts = Dir.entries(vdir).grep /^\d\d\d\d/
181
185
  posts = posts.sort.reverse
186
+
182
187
  # Add view header/trailer
183
188
  @bloghead = File.read("#{vdir}/custom/blogheader.html") rescue ""
184
189
  @blogtail = File.read("#{vdir}/custom/blogtrailer.html") rescue ""
190
+
185
191
  # Output view
186
- posts.map! do |post|
187
- YAML.load(File.read("#{vdir}/#{post}/metadata.yaml"))
188
- end
192
+ posts.map! {|post| YAML.load(File.read("#{vdir}/#{post}/metadata.yaml")) }
189
193
  out = @bloghead.dup
190
- posts.each do |post|
191
- out << posting(post)
192
- end
194
+ posts.each {|post| out << posting(view, post) }
193
195
  out << @blogtail
194
- File.open("#{vdir}/index.html", "w") do |f|
195
- f.puts out
196
- end
196
+ File.open("#{vdir}/index.html", "w") {|f| f.puts out }
197
197
  end
198
198
 
199
199
  ### link_post_view
200
200
 
201
201
  def link_post_view(view)
202
+ p @meta
202
203
  # Create dir using slug (index.html, metadata?)
203
204
  vdir = "#{@config.root}/views/#{view}"
204
205
  dir = "#{vdir}/#{@meta.slug}"
205
- cmd = "mkdir -p #{dir}"
206
+ cmd = "mkdir -p #{dir}" #-- FIXME what if this exists??
206
207
  puts " Running: #{cmd}"
207
208
  system(cmd)
208
209
  File.write("#{dir}/metadata.yaml", @meta.to_yaml)
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.18
4
+ version: 0.0.19
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton