runeblog 0.0.56 → 0.0.57

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: b0591507ef7d41996c99c71b941f0c19db8b5367
4
- data.tar.gz: 72f6b28977828e4ad7817517559b957254f9ccf5
3
+ metadata.gz: e7f2f60b13ad6aefe511291f1260123897d98b25
4
+ data.tar.gz: 25ac133e889d49fe12d83423932999991e09d9c1
5
5
  SHA512:
6
- metadata.gz: 0a3e0557200eb79f38b34a92172b4bcc33b62f633f6fed4e6865d0c466331614f6e4d50c34327f8310ff4fdc8c60715d21de2e9068c71221320907c8f407f33c
7
- data.tar.gz: 03bb6bf9cf326e75e406ea698ddb48e08d2b58a5f27c8d2c40d7b50ba9a641ab93115f4afbd4371ec14f94e0c4cd1c7be9f69513ab37ed77f64abbd5bd7960a6
6
+ metadata.gz: 0ab9961f32dfea28d846998705d8639bd1b0fdc5d012d59a38e269e921a78d31b4fe9176e1565c850544ee8e9e80fe4042e1ed31e18609d1c50bdc3dc16c4cac
7
+ data.tar.gz: 2552eb7707a890943181eab668dfec92e03360eafd5d1483701960328083f486c851eec3a5583028b44cd46aff57e450831e254f248ef7a91990c4dc2c541162
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.56 2018-09-10
1
+ RuneBlog v 0.0.57 2018-09-10
data/lib/helpers-repl.rb CHANGED
@@ -124,35 +124,6 @@ module RuneBlog::REPL
124
124
  red(slug[0..3])+blue(slug[4..-1])
125
125
  end
126
126
 
127
- ### reload_post
128
-
129
- def reload_post(file)
130
- @main ||= Livetext.new
131
- @main.main.output = File.new("/tmp/WHOA","w") # FIXME srsly?
132
- @meta = process_post(file)
133
- @meta.slug = file.sub(/.lt3$/, "")
134
- @meta
135
- rescue => err
136
- error(err)
137
- end
138
-
139
- ## posting
140
-
141
- def posting(view, meta)
142
- # FIXME clean up and generalize
143
- ref = "#{view}/#{meta.slug}/index.html"
144
- <<-HTML
145
- <br>
146
- <font size=+1>#{meta.pubdate}&nbsp;&nbsp;</font>
147
- <font size=+2 color=blue><a href=../#{ref} style="text-decoration: none">#{meta.title}</font></a>
148
- <br>
149
- #{meta.teaser}
150
- <a href=../#{ref} style="text-decoration: none">Read more...</a>
151
- <br><br>
152
- <hr>
153
- HTML
154
- end
155
-
156
127
  ### create_dir
157
128
 
158
129
  def create_dir(dir)
@@ -161,6 +132,26 @@ module RuneBlog::REPL
161
132
  raise "Can't create #{dir}" unless result
162
133
  end
163
134
 
135
+ def import(arg = nil)
136
+ open_blog unless @blog
137
+
138
+ arg = nil if arg == ""
139
+ arg ||= ask("Filename: ") # check validity later
140
+ name = arg
141
+ grep = `grep ^.title #{name}`
142
+ @title = grep.sub(/^.title /, "")
143
+ @slug = @blog.make_slug(@title)
144
+ @fname = @slug + ".lt3"
145
+ result = system("cp #{name} #@root/src/#@fname")
146
+ raise "Could not copy #{name} to #@root/src/#@fname" unless result
147
+
148
+ edit_initial_post(@fname)
149
+ process_post(@fname)
150
+ publish_post(@meta) # if publish?
151
+ rescue => err
152
+ error(err)
153
+ end
154
+
164
155
  ### find_asset
165
156
 
166
157
  # def find_asset(asset) # , views)
@@ -195,33 +186,4 @@ module RuneBlog::REPL
195
186
  # list.each {|asset| puts "#{asset} => #{find_asset(asset, views)}" }
196
187
  # end
197
188
 
198
- ### rebuild_post
199
-
200
- def rebuild_post(file)
201
- reload_post(file)
202
- publish_post(@meta) # FIXME ??
203
- rescue => err
204
- error(err)
205
- end
206
-
207
- def import(arg = nil)
208
- open_blog unless @blog
209
-
210
- arg = nil if arg == ""
211
- arg ||= ask("Filename: ") # check validity later
212
- name = arg
213
- grep = `grep ^.title #{name}`
214
- @title = grep.sub(/^.title /, "")
215
- @slug = @blog.make_slug(@title)
216
- @fname = @slug + ".lt3"
217
- result = system("cp #{name} #@root/src/#@fname")
218
- raise "Could not copy #{name} to #@root/src/#@fname" unless result
219
-
220
- edit_initial_post(@fname)
221
- process_post(@fname)
222
- publish_post(@meta) # if publish?
223
- rescue => err
224
- error(err)
225
- end
226
-
227
189
  end
data/lib/runeblog.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'livetext'
4
4
 
5
5
  class RuneBlog
6
- VERSION = "0.0.56"
6
+ VERSION = "0.0.57"
7
7
 
8
8
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
9
9
  DefaultData = Path + "/../data"
@@ -157,6 +157,38 @@ EOS
157
157
  error(err)
158
158
  end
159
159
 
160
+ def reload_post(file)
161
+ @main ||= Livetext.new
162
+ @main.main.output = File.new("/tmp/WHOA","w") # FIXME srsly?
163
+ @meta = process_post(file)
164
+ @meta.slug = file.sub(/.lt3$/, "")
165
+ @meta
166
+ rescue => err
167
+ error(err)
168
+ end
169
+
170
+ def posting(view, meta)
171
+ # FIXME clean up and generalize
172
+ ref = "#{view}/#{meta.slug}/index.html"
173
+ <<-HTML
174
+ <br>
175
+ <font size=+1>#{meta.pubdate}&nbsp;&nbsp;</font>
176
+ <font size=+2 color=blue><a href=../#{ref} style="text-decoration: none">#{meta.title}</font></a>
177
+ <br>
178
+ #{meta.teaser}
179
+ <a href=../#{ref} style="text-decoration: none">Read more...</a>
180
+ <br><br>
181
+ <hr>
182
+ HTML
183
+ end
184
+
185
+ def rebuild_post(file)
186
+ reload_post(file)
187
+ publish_post(@meta) # FIXME ??
188
+ rescue => err
189
+ error(err)
190
+ end
191
+
160
192
  def make_slug(title, seq=nil)
161
193
  num = '%04d' % (seq || self.next_sequence) # FIXME can do better
162
194
  slug = title.downcase.strip.gsub(' ', '-').gsub(/[^\w-]/, '')
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.56
4
+ version: 0.0.57
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton