runeblog 0.2.41 → 0.2.42

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: 01171d08263fe5ee887ce0823abd7195ce9f9240c1f45cf3de94335b0112a98b
4
- data.tar.gz: aa6f0ed12b6554c0b5d93ed0f6d29be4f9a071dc27654b1cebd4d5c6b952591b
3
+ metadata.gz: c4614cd8057ff8c6482fefa922372cda4e4bfc3ff0cabf607aa09452d11bd893
4
+ data.tar.gz: 060c3e221272fcc0d196db0892c696ee3aec22cf8d3fc52c0804fd1be5e94694
5
5
  SHA512:
6
- metadata.gz: fba5b0128b75456357871b559f4c033de9c9b4d54215358cf8f371a9125a6145d560b71f764042f9db3deca9a00e64e0a6f9f71356cfcdcc8592e5b7e0b25c8e
7
- data.tar.gz: 7b51735446277efdc8da39e0835434b24ca0de5035cdfbbbeaaad35f09da980a87869687d93fe51e8ef68ee7d7be431c413a06ff7cf4fb46e4e3d8dc735b7226
6
+ metadata.gz: d686398ca6cfa3f27c24956cd28a51bdb6ce719c5ddd84a9ccb01ffa836f5ab8bc729e476b0822347aed57c2e05728defb5981b3c7b5085957465f4e93328336
7
+ data.tar.gz: 12164e9cc1b8202dcb3591b0a02f4cbd12ebb7b5510e775c1070bb94caa868ce9b21fe10dbf760f6ff644bf4f82003f40e7bac0cc86ad30ee185fe08e3d4cd2b
@@ -24,7 +24,6 @@
24
24
  \.post-title-text a {
25
25
  color: $post.text.color;
26
26
  font-size: $post.text.size;
27
- # float: right;
28
27
  display: block;
29
28
  text-decoration: none;
30
29
  }
@@ -20,6 +20,10 @@ description $teaser
20
20
 
21
21
  <section class="post">
22
22
  <div class="entry-content">
23
+ <table border=0 width=100%><tr>
24
+ <td align=left valign=bottom><h2 class="post-title">$title</h2></td>
25
+ <td align=right valign=top><font size=-5><br></font>$longdate</td>
26
+ </tr></table><hr>
23
27
  $.copy guts.html
24
28
  </div>
25
29
  </section>
@@ -28,6 +28,3 @@ TEXT
28
28
  end
29
29
 
30
30
  end
31
-
32
-
33
-
@@ -154,7 +154,8 @@ def title
154
154
  title = @_data.chomp
155
155
  @meta.title = title
156
156
  setvar :title, title
157
- _out %[<h1 class="post-title">#{title}</h1><br>]
157
+ # FIXME refactor -- just output variables for a template
158
+ # _out %[<h1 class="post-title">#{title}</h1><br>]
158
159
  _optional_blank_line
159
160
  end
160
161
 
@@ -289,7 +289,7 @@ class RuneBlog
289
289
  vp
290
290
  end
291
291
 
292
- def teaser(slug)
292
+ def index_entry(slug)
293
293
  log!(enter: __method__, args: [slug])
294
294
  id = slug.to_i
295
295
  text = nil
@@ -303,7 +303,7 @@ class RuneBlog
303
303
  path = vp.path
304
304
  url = aslug + ".html"
305
305
  date = ::Date.parse(date)
306
- date = date.strftime("%B %e<br>%Y")
306
+ date = date.strftime("%B %e<br><div style='float: right'>%Y</div>")
307
307
  text = interpolate(@_post_entry, binding)
308
308
  text
309
309
  end
@@ -328,7 +328,7 @@ class RuneBlog
328
328
  wanted.times do
329
329
  postid = File.basename(enum.next)
330
330
  postid = postid.to_i
331
- text << teaser(postid) # side effect! calls _out
331
+ text << index_entry(postid) # side effect! calls _out
332
332
  end
333
333
  text << "</body></html>"
334
334
  File.write(@vdir/:remote/file, text)
@@ -438,9 +438,20 @@ class RuneBlog
438
438
  log!(enter: __method__, args: [draft, pdraft])
439
439
  Dir.chdir(pdraft) do
440
440
  excerpt = File.read("teaser.txt")
441
+ date = _retrieve_metadata(:date)
442
+ longdate = ::Date.parse(date).strftime("%B %e, %Y")
441
443
  title = _retrieve_metadata(:title)
442
- vars = %[.heredoc title\n#{title.chomp}\n.end\n] +
443
- %[.heredoc teaser\n#{excerpt.chomp}\n.end\n]
444
+ vars = <<~LIVE
445
+ .heredoc title
446
+ #{title.chomp}
447
+ .end
448
+ .heredoc teaser
449
+ #{excerpt.chomp}
450
+ .end
451
+ .heredoc longdate
452
+ #{longdate}
453
+ .end
454
+ LIVE
444
455
  File.open(pdraft/"vars.lt3", "w") {|f| f.puts vars }
445
456
  end
446
457
  end
@@ -500,7 +511,7 @@ class RuneBlog
500
511
  end
501
512
  end
502
513
 
503
- def index_entry(view, meta)
514
+ def OLD_index_entry(view, meta)
504
515
  log!(enter: __method__, args: [view, meta])
505
516
  debug "=== index_entry #{view.to_s.inspect} #{meta.num} #{meta.title.inspect}"
506
517
  check_meta(meta, "index_entry1")
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.2.41"
5
+ VERSION = "0.2.42"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -0,0 +1,150 @@
1
+ $LOAD_PATH << "./lib"
2
+
3
+ major, minor = RUBY_VERSION.split(".").values_at(0,1)
4
+ ver = major.to_i*10 + minor.to_i
5
+ abort "Need Ruby 2.4 or greater" unless ver >= 24
6
+
7
+ Home = Dir.pwd
8
+
9
+ require 'global'
10
+ require 'runeblog'
11
+ require 'repl'
12
+
13
+ def bold(str)
14
+ "\e[1m#{str}\e[0m"
15
+ end
16
+
17
+ def getch
18
+ # sleep 5
19
+ end
20
+
21
+ def debug(str = "")
22
+ t = Time.now
23
+ time = t.to_f.to_s
24
+ n = time.index(".")
25
+ msec = time[n..(n+2)]
26
+ time = t.strftime("%H:%M:%S") + msec
27
+ STDERR.puts "#{'%-11s' % time} #{str}"
28
+ end
29
+
30
+ def make_post(x, title, teaser, body, views=[])
31
+ debug " make_post #{bold(title)}"
32
+ x.create_new_post(title, true, teaser: teaser, body: body, views: views)
33
+ views.each do |view|
34
+ debug
35
+ debug "** generate_index #{bold(view)}"
36
+ x.generate_index(view)
37
+ end # recent.html
38
+ end
39
+
40
+ def show_lines(text)
41
+ lines = text.split("\n")
42
+ str = "#{lines.size} lines\n"
43
+ lines.each {|line| str << " #{line.inspect}\n" }
44
+ str
45
+ end
46
+
47
+ # "Main"...
48
+
49
+ t0 = Time.now
50
+
51
+ puts bold("\nGenerating test blog...")
52
+
53
+ system("rm -rf .blogs")
54
+ RuneBlog.create_new_blog_repo(".blogs")
55
+ x = RuneBlog.new(".blogs")
56
+
57
+ debug("create_view: #{bold('around_austin')}")
58
+ x.create_view("around_austin") # FIXME remember view title!
59
+
60
+ #### FIXME later!!
61
+ vars = <<-VARS
62
+
63
+ .variables
64
+ blog Around Austin
65
+ blog.desc The view from downtown...
66
+ .end
67
+ VARS
68
+ File.open(".blogs/views/around_austin/themes/standard/global.lt3", "a") do |f|
69
+ f.puts vars
70
+ end
71
+ ####
72
+
73
+ debug("-- change_view: #{bold('around_austin')}")
74
+ x.change_view("around_austin") # 1 2 7 8 9
75
+
76
+ make_post(x, "What's at Stubbs...", <<-EXCERPT, <<-BODY, [])
77
+ Stubbs has been around for longer than civilization.
78
+ EXCERPT
79
+ That's a good thing. But their music isn't always the greatest.
80
+ BODY
81
+
82
+ make_post(x, "The new amphitheatre is overrated", <<-EXCERPT, <<-BODY)
83
+ It used to be that all major concerts played the Erwin Center.
84
+ EXCERPT
85
+ Now, depending on what you consider "major," blah blah blah...
86
+ BODY
87
+
88
+ make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
89
+ RIP, Hope Gallery
90
+ EXCERPT
91
+ .dropcap
92
+
93
+ It's been a while since I was there. They say it was torn down
94
+ while I wasn't looking.
95
+
96
+ This fake entry is a long one so as to demonstrate both drop-caps
97
+ (above) and an inset quote. Blah blah blah. Lorem ipsum dolor and
98
+ a partridge in a pear tree.
99
+
100
+ Wherever you go, there you are. Last night I saw upon the stair
101
+ a little man who was not there. He wasn't there again today; I
102
+ wish, I wish he'd go away.
103
+
104
+ As far as we know, our computer has never had an undetected error.
105
+ And never let it be denied that pobbles are happier without their
106
+ toes. And may your snark never be a boojum.
107
+
108
+ Contact light. Houston, this is Tranquility Base. The Eagle has
109
+ landed. That's one small step for (a) man, one giant leap for
110
+ mankind.
111
+ .inset left 20
112
+ On a clean disk, you can seek forever.
113
+ .end
114
+
115
+ Pity this busy monster, manunkind, not. Pity rather... Listen:
116
+ There's a hell of a universe next door; let's go.
117
+ BODY
118
+
119
+ make_post(x, "The Waller Creek project", <<-EXCERPT, <<-BODY)
120
+ Will it ever be finished?
121
+ EXCERPT
122
+ Blah blah Waller Creek blah blah...
123
+ BODY
124
+
125
+ make_post(x, "Life on Sabine Street", <<-EXCERPT, <<-BODY)
126
+ It's like Pooh Corner, except not.
127
+ EXCERPT
128
+ This is about Sabine St, blah blah lorem ipsum dolor...
129
+ BODY
130
+
131
+ make_post(x, "Remember Modest Mouse?", <<-EXCERPT, <<-BODY, [])
132
+ They date to the 90s or before.
133
+ EXCERPT
134
+ But I first heard of them
135
+ in 2005.
136
+ BODY
137
+
138
+ debug
139
+ debug("** generate_view: #{bold('around_austin')}")
140
+ x.generate_view("around_austin")
141
+ x.change_view("around_austin")
142
+ debug
143
+
144
+ puts bold("...finished.\n")
145
+
146
+ t1 = Time.now
147
+
148
+ elapsed = t1 - t0
149
+ puts "\nElapsed: #{'%3.2f' % elapsed} secs\n "
150
+
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.2.41
4
+ version: 0.2.42
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
@@ -201,6 +201,7 @@ files:
201
201
  - lib/runeblog_version.rb
202
202
  - lib/view.rb
203
203
  - lib/xlate.rb
204
+ - test/austin.rb
204
205
  - test/fakeimage.jpg
205
206
  - test/general_test.rb
206
207
  - test/make_blog.rb