runeblog 0.2.40 → 0.2.45

Sign up to get free protection for your applications and to get access to all the features.
Files changed (37) hide show
  1. checksums.yaml +4 -4
  2. data/bin/blog +4 -7
  3. data/empty_view/themes/standard/blog/post_entry.lt3 +11 -10
  4. data/empty_view/themes/standard/etc/blog.css.lt3 +6 -1
  5. data/empty_view/themes/standard/navbar/faq.lt3 +1 -0
  6. data/empty_view/themes/standard/navbar/navbar.lt3 +1 -0
  7. data/empty_view/themes/standard/post/generate.lt3 +9 -4
  8. data/empty_view/themes/standard/widgets/ad/ad.lt3 +8 -1
  9. data/empty_view/themes/standard/widgets/ad/ad1.png +0 -0
  10. data/empty_view/themes/standard/widgets/ad/ad2.png +0 -0
  11. data/empty_view/themes/standard/widgets/ad/ad3.png +0 -0
  12. data/empty_view/themes/standard/widgets/ad/ad4.png +0 -0
  13. data/empty_view/themes/standard/widgets/bydates/bydates.rb +7 -3
  14. data/empty_view/themes/standard/widgets/links/links.rb +28 -3
  15. data/empty_view/themes/standard/widgets/news/news.rb +7 -3
  16. data/empty_view/themes/standard/widgets/pages/pages.rb +10 -3
  17. data/empty_view/themes/standard/widgets/pinned/pinned.rb +7 -3
  18. data/empty_view/themes/standard/widgets/search/search.rb +7 -3
  19. data/empty_view/themes/standard/widgets/sitemap/sitemap.rb +7 -3
  20. data/empty_view/themes/standard/widgets/tag-cloud/tag-cloud.rb +7 -3
  21. data/lib/default.rb +1 -4
  22. data/lib/global.rb +8 -7
  23. data/lib/helpers-blog.rb +15 -15
  24. data/lib/liveblog.rb +47 -18
  25. data/lib/logging.rb +17 -8
  26. data/lib/post.rb +6 -6
  27. data/lib/publish.rb +4 -4
  28. data/lib/repl.rb +1 -0
  29. data/lib/runeblog.rb +77 -47
  30. data/lib/runeblog_version.rb +1 -1
  31. data/lib/view.rb +2 -8
  32. data/lib/xlate.rb +2 -2
  33. data/test/austin.rb +157 -0
  34. metadata +8 -5
  35. data/empty_view/remote/widgets/links/list.data +0 -3
  36. data/empty_view/remote/widgets/news/list.data +0 -4
  37. data/empty_view/remote/widgets/pages/list.data +0 -4
@@ -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.40"
5
+ VERSION = "0.2.45"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -8,7 +8,7 @@ class RuneBlog::View
8
8
  include RuneBlog::Helpers
9
9
 
10
10
  def initialize(name)
11
- log!(enter: __method__, args: [name])
11
+ log!(enter: __method__, args: [name], level: 3)
12
12
  raise NoBlogAccessor if RuneBlog.blog.nil?
13
13
  @blog = RuneBlog.blog
14
14
  @name = name
@@ -17,27 +17,23 @@ class RuneBlog::View
17
17
  end
18
18
 
19
19
  def dir
20
- log!(enter: __method__)
21
20
  @blog.root + "/views/#@name/"
22
21
  end
23
22
 
24
23
  def local_index
25
- log!(enter: __method__)
26
24
  dir + "/remote/index.html"
27
25
  end
28
26
 
29
27
  def index
30
- log!(enter: __method__)
31
28
  dir + "index.html"
32
29
  end
33
30
 
34
31
  def to_s
35
- log!(enter: __method__)
36
32
  @name
37
33
  end
38
34
 
39
35
  def publishable_files
40
- log!(enter: __method__)
36
+ log!(enter: __method__, level: 2)
41
37
  vdir = dir()
42
38
  remote = local_index()
43
39
  files = [remote]
@@ -55,12 +51,10 @@ class RuneBlog::View
55
51
  end
56
52
 
57
53
  def can_publish?
58
- log!(enter: __method__)
59
54
  @can_publish
60
55
  end
61
56
 
62
57
  def recent?(file)
63
- log!(enter: __method__, args: [file])
64
58
  File.mtime(file) > File.mtime("#{self.dir()}/last_published")
65
59
  rescue
66
60
  true
@@ -2,7 +2,7 @@
2
2
  LEXT = ".lt3"
3
3
 
4
4
  def stale?(src, dst, force = false)
5
- log!(enter: __method__, args: [src, dst])
5
+ log!(enter: __method__, args: [src, dst], level: 3)
6
6
  raise "Source #{src} not found in #{Dir.pwd}" unless File.exist?(src)
7
7
  return true if force
8
8
  return true unless File.exist?(dst)
@@ -29,7 +29,7 @@ LEXT = ".lt3"
29
29
  STDERR.puts "#{indent} -- ^ Already up to date!" if debug
30
30
  return
31
31
  end
32
- rc = system!("livetext #{src} >#{dst}")
32
+ rc = system("livetext #{src} >#{dst}")
33
33
  STDERR.puts "...completed (shell returned #{rc})" if debug
34
34
  system!("cp #{dst} #{copy}") if copy
35
35
  end
@@ -0,0 +1,157 @@
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 'date'
10
+
11
+ require 'global'
12
+ require 'runeblog'
13
+ require 'repl'
14
+
15
+ def bold(str)
16
+ "\e[1m#{str}\e[0m"
17
+ end
18
+
19
+ def getch
20
+ # sleep 5
21
+ end
22
+
23
+ def debug(str = "")
24
+ t = Time.now
25
+ time = t.to_f.to_s
26
+ n = time.index(".")
27
+ msec = time[n..(n+2)]
28
+ time = t.strftime("%H:%M:%S") + msec
29
+ STDERR.puts "#{'%-11s' % time} #{str}"
30
+ end
31
+
32
+ @fake_date = Date.today - 20
33
+
34
+ def make_post(x, title, teaser, body, views=[])
35
+ debug " make_post #{bold(title)}"
36
+ pubdate = @fake_date.strftime("%Y-%m-%d")
37
+ @fake_date += (rand(2) + 1)
38
+ x.create_new_post(title, true, teaser: teaser, body: body, views: views,
39
+ pubdate: pubdate)
40
+ end
41
+
42
+ def show_lines(text)
43
+ lines = text.split("\n")
44
+ str = "#{lines.size} lines\n"
45
+ lines.each {|line| str << " #{line.inspect}\n" }
46
+ str
47
+ end
48
+
49
+ # "Main"...
50
+
51
+ t0 = Time.now
52
+
53
+ puts bold("\nGenerating test blog...")
54
+
55
+ system("rm -rf .blogs")
56
+ RuneBlog.create_new_blog_repo(".blogs")
57
+ x = RuneBlog.new(".blogs")
58
+
59
+ debug("create_view: #{bold('around_austin')}")
60
+ x.create_view("around_austin") # FIXME remember view title!
61
+
62
+ #### FIXME later!!
63
+ vars = <<-VARS
64
+
65
+ .variables
66
+ blog Around Austin
67
+ blog.desc The view from downtown...
68
+ .end
69
+ VARS
70
+ File.open(".blogs/views/around_austin/themes/standard/global.lt3", "a") do |f|
71
+ f.puts vars
72
+ end
73
+ ####
74
+
75
+ debug("** generate_view: #{bold('around_austin')}")
76
+ x.generate_view("around_austin")
77
+
78
+ debug("-- change_view: #{bold('around_austin')}")
79
+ x.change_view("around_austin") # 1 2 7 8 9
80
+
81
+ make_post(x, "What's at Stubbs...", <<-EXCERPT, <<-BODY, [])
82
+ Stubbs has been around for longer than civilization.
83
+ EXCERPT
84
+ That's a good thing. But their music isn't always the greatest.
85
+ BODY
86
+
87
+ make_post(x, "The new amphitheatre is overrated", <<-EXCERPT, <<-BODY)
88
+ It used to be that all major concerts played the Erwin Center.
89
+ EXCERPT
90
+ Now, depending on what you consider "major," blah blah blah...
91
+ BODY
92
+
93
+ make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
94
+ RIP, Hope Gallery
95
+ EXCERPT
96
+ .dropcap
97
+
98
+ It's been a while since I was there. They say it was torn down
99
+ while I wasn't looking.
100
+
101
+ This fake entry is a long one so as to demonstrate both drop-caps
102
+ (above) and an inset quote. Blah blah blah. Lorem ipsum dolor and
103
+ a partridge in a pear tree.
104
+
105
+ Wherever you go, there you are. Last night I saw upon the stair
106
+ a little man who was not there. He wasn't there again today; I
107
+ wish, I wish he'd go away.
108
+
109
+ As far as we know, our computer has never had an undetected error.
110
+ And never let it be denied that pobbles are happier without their
111
+ toes. And may your snark never be a boojum.
112
+
113
+ Contact light. Houston, this is Tranquility Base. The Eagle has
114
+ landed. That's one small step for (a) man, one giant leap for
115
+ mankind.
116
+ .inset left 20
117
+ On a clean disk, you can seek forever.
118
+ .end
119
+
120
+ Pity this busy monster, manunkind, not. Pity rather... Listen:
121
+ There's a hell of a universe next door; let's go.
122
+ BODY
123
+
124
+ make_post(x, "The Waller Creek project", <<-EXCERPT, <<-BODY)
125
+ Will it ever be finished?
126
+ EXCERPT
127
+ Blah blah Waller Creek blah blah...
128
+ BODY
129
+
130
+ make_post(x, "Life on Sabine Street", <<-EXCERPT, <<-BODY)
131
+ It's like Pooh Corner, except not.
132
+ EXCERPT
133
+ This is about Sabine St, blah blah lorem ipsum dolor...
134
+ BODY
135
+
136
+ make_post(x, "Remember Modest Mouse?", <<-EXCERPT, <<-BODY, [])
137
+ They date to the 90s or before.
138
+ EXCERPT
139
+ But I first heard of them
140
+ in 2005.
141
+ BODY
142
+
143
+ debug
144
+ debug "** generate_index #{bold("around_austin")}"
145
+ x.generate_index("around_austin")
146
+
147
+ debug
148
+ x.change_view("around_austin")
149
+ debug
150
+
151
+ puts bold("...finished.\n")
152
+
153
+ t1 = Time.now
154
+
155
+ elapsed = t1 - t0
156
+ puts "\nElapsed: #{'%3.2f' % elapsed} secs\n "
157
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: runeblog
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.40
4
+ version: 0.2.45
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-10-14 00:00:00.000000000 Z
11
+ date: 2019-10-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -67,9 +67,6 @@ files:
67
67
  - empty_view/remote/etc/GIT_IS_DUMB
68
68
  - empty_view/remote/navbar/GIT_IS_DUMB
69
69
  - empty_view/remote/permalink/GIT_IS_DUMB
70
- - empty_view/remote/widgets/links/list.data
71
- - empty_view/remote/widgets/news/list.data
72
- - empty_view/remote/widgets/pages/list.data
73
70
  - empty_view/themes/standard/README
74
71
  - empty_view/themes/standard/blog/generate.lt3
75
72
  - empty_view/themes/standard/blog/head.lt3
@@ -82,6 +79,7 @@ files:
82
79
  - empty_view/themes/standard/global.lt3
83
80
  - empty_view/themes/standard/navbar/about.lt3
84
81
  - empty_view/themes/standard/navbar/contact.lt3
82
+ - empty_view/themes/standard/navbar/faq.lt3
85
83
  - empty_view/themes/standard/navbar/navbar.lt3
86
84
  - empty_view/themes/standard/post/generate.lt3
87
85
  - empty_view/themes/standard/post/head.lt3
@@ -89,6 +87,10 @@ files:
89
87
  - empty_view/themes/standard/post/permalink.lt3
90
88
  - empty_view/themes/standard/widgets/README
91
89
  - empty_view/themes/standard/widgets/ad/ad.lt3
90
+ - empty_view/themes/standard/widgets/ad/ad1.png
91
+ - empty_view/themes/standard/widgets/ad/ad2.png
92
+ - empty_view/themes/standard/widgets/ad/ad3.png
93
+ - empty_view/themes/standard/widgets/ad/ad4.png
92
94
  - empty_view/themes/standard/widgets/bydates/README
93
95
  - empty_view/themes/standard/widgets/bydates/bydates.lt3
94
96
  - empty_view/themes/standard/widgets/bydates/bydates.rb
@@ -201,6 +203,7 @@ files:
201
203
  - lib/runeblog_version.rb
202
204
  - lib/view.rb
203
205
  - lib/xlate.rb
206
+ - test/austin.rb
204
207
  - test/fakeimage.jpg
205
208
  - test/general_test.rb
206
209
  - test/make_blog.rb
@@ -1,3 +0,0 @@
1
- https://www.mensa.org, no, Mensa International
2
- http://space.com, yes, Space.com: NASA, Space Exploration and Astronomy News
3
- https://arstechnica.com, no, Ars Technica
@@ -1,4 +0,0 @@
1
- https://techcrunch.com/2019/09/16/fossa-scores-8-5-million-series-a-to-help-enterprise-manage-open-source-licenses/, yes, FOSSA scores \$8.5 million Series A to help enterprise manage open-source licenses
2
- https://techcrunch.com/2019/09/17/spacexs-orbital-starship-prototype-construction-progress-detailed-in-new-photos/, yes, SpaceX’s orbital Starship prototype construction progress detailed in new photos
3
- https://developers.googleblog.com/2019/05/Flutter-io19.html, yes, Flutter: a Portable UI Framework for Mobile, Web, Embedded, and Desktop
4
- https://jaycarlson.net/microcontrollers/, no, The Amazing \$1 Microcontroller (2017)
@@ -1,4 +0,0 @@
1
- faq.html,Frequently Asked Questions
2
- like-dislike.html,Likes and Dislikes
3
- disclaim.html,Disclaimer
4
- lifestory.html,My Life Story