runeblog 0.1.71 → 0.1.73

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 952d50f4c764c40e1e0c51efb8cac9caa7c43ed3ec7a36975b78e2964d9d596c
4
- data.tar.gz: 7020ee4f9aca03cda854453c2d9279700e6cbb872585c352b99c83477494cd8c
3
+ metadata.gz: 5d531910537cc6d9565d422ea78e47d51ebb114038d14a3731a663ce3da1a521
4
+ data.tar.gz: a1ea5afaba8894725fb12cbe7454dddcccf60d8c6cb704d4bb261398d0d6bf24
5
5
  SHA512:
6
- metadata.gz: '08d22ba02517f587ee5e575326b5d889b0c34f8ea1502e3ab8c9d96225fc2cebf72c024698f7b800afc50ae54620ca685c25a466baa06c87b2b47e68c5dc993c'
7
- data.tar.gz: d3ec19c4858983a6878b8ac124128c0c79eecb41512a782e07244d7b75594dbf89d0ebfb6dc12ca0977f8d5ea39e6ffcc08ce3927690d34c73777f564c686155
6
+ metadata.gz: ff465f63016bff51803e24400af3cc5e2130a65ef50465c60c0171d1a64b182f7481c4f2c8f455bb6c6b7fb63ac044da90f2ff6bade2ea0a5cf6e1953a872f9d
7
+ data.tar.gz: 339e17699384ad1f89a620024835a3157f42fb36e3d89d26cb94fb4bc3336119c424f7e17caa28d6e1e95c86bdab5eb5c608209069fcc71f805303e680d9b4df
data/bin/blog CHANGED
@@ -12,7 +12,7 @@ include RuneBlog::REPL
12
12
  def get_started
13
13
  puts
14
14
  puts fx(<<-TEXT, :bold)
15
- Blog successfully created.
15
+ Blog repo successfully created.
16
16
  You can create views with the command: new view
17
17
  Create a post within the current view: new post
18
18
  You can't publish until you set up the publish file
data/lib/default.rb CHANGED
@@ -34,6 +34,7 @@ def RuneBlog.post_template(title: "No title", date: nil, view: "test_view",
34
34
  taglist = ".tags " + tags.join(" ")
35
35
  <<-TEXT
36
36
  .mixin liveblog
37
+ . ^ get rid of this later
37
38
 
38
39
  .title #{title}
39
40
  .pubdate #{date}
data/lib/liveblog.rb CHANGED
@@ -218,7 +218,7 @@ rescue => err
218
218
  end
219
219
 
220
220
  def teaser
221
- STDERR.puts "--- teaser: pwd = #{Dir.pwd}"
221
+ # STDERR.puts "--- teaser: pwd = #{Dir.pwd}"
222
222
  @meta.teaser = _body_text
223
223
  _out @meta.teaser + "\n"
224
224
  # FIXME
@@ -235,7 +235,7 @@ def finalize
235
235
  @meta
236
236
  end
237
237
 
238
- Dot = self # Clunky! for dot commands called from Functions class
238
+ $Dot = self # Clunky! for dot commands called from Functions class
239
239
 
240
240
  # Find a better way to do this?
241
241
 
@@ -256,7 +256,7 @@ class Livetext::Functions
256
256
  def h6(param); "<h6>#{param}</h6>"; end
257
257
 
258
258
  def hr(param=nil)
259
- Dot.hr
259
+ $Dot.hr
260
260
  end
261
261
 
262
262
  def image(param)
data/lib/post.rb CHANGED
@@ -70,10 +70,11 @@ class RuneBlog::Post
70
70
  @blog = RuneBlog.blog || raise(NoBlogAccessor)
71
71
  end
72
72
 
73
- def self.create(title)
73
+ def self.create(title, teaser = "", body = "")
74
+ # STDERR.puts "-- create: teaser = #{teaser.inspect} body = #{body.inspect}"
74
75
  debug "=== Post.create #{title.inspect} pwd = #{Dir.pwd}"
75
76
  post = self.new
76
- post.new_metadata(title)
77
+ post.new_metadata(title.chomp, teaser.chomp, body.chomp)
77
78
  post.create_draft
78
79
  post.create_post_subtree
79
80
  # post.build is not called here! It is called
@@ -81,25 +82,27 @@ class RuneBlog::Post
81
82
  post
82
83
  end
83
84
 
84
- def new_metadata(title)
85
+ def new_metadata(title, teaser = nil, body = nil)
86
+ # STDERR.puts "-- new_meta: teaser = #{teaser.inspect} body = #{body.inspect}"
85
87
  verify(title.is_a?(String) => "Title #{title.inspect} is not a string")
86
88
  meta = OpenStruct.new
87
89
  meta.title = title
88
- meta.teaser = "Teaser goes here."
89
- meta.body = "Remainder of post goes here."
90
+ meta.teaser ||= teaser
91
+ meta.body ||= body
92
+ # STDERR.puts "-- new_meta2: teaser = #{meta.teaser.inspect} body = #{meta.body.inspect}"
90
93
  meta.pubdate = Time.now.strftime("%Y-%m-%d")
91
94
  meta.date = meta.pubdate # fix later
92
95
  meta.views = [@blog.view.to_s]
93
96
  meta.tags = []
94
- meta.num = @blog.next_sequence # ONLY place next_sequence is called!
97
+ # ONLY place next_sequence is called!
98
+ meta.num = @blog.next_sequence
95
99
  @blog.make_slug(meta) # adds to meta
96
100
  @meta = meta
97
101
  end
98
102
 
99
103
  def create_draft
104
+ # STDERR.puts "-- create_draft: teaser = #{@meta.teaser.inspect} body = #{@meta.body.inspect}"
100
105
  viewhome = @blog.view.publisher.url
101
- # print "HOME = "
102
- # p viewhome
103
106
  html = RuneBlog.post_template(title: @meta.title, date: @meta.pubdate,
104
107
  view: @meta.view, teaser: @meta.teaser, body: @meta.body,
105
108
  views: @meta.views, tags: @meta.tags, home: viewhome)
@@ -124,6 +127,7 @@ class RuneBlog::Post
124
127
  debug "=== build"
125
128
  views = @meta.views
126
129
  text = File.read(@draft)
130
+ STDERR.puts "-- build: draft = #{@draft.inspect}"
127
131
  livetext = Livetext.new(STDOUT)
128
132
  Livetext.parameters = [@blog, @meta.num, livetext]
129
133
  meta = livetext.process_text(text)
data/lib/repl.rb CHANGED
@@ -111,7 +111,6 @@ module RuneBlog::REPL
111
111
  return @out if files.empty?
112
112
 
113
113
  ret = RubyText.spinner(label: " Publishing... ") do
114
- STDERR.puts files.inspect
115
114
  @blog.view.publisher.publish(files, assets) # FIXME weird?
116
115
  end
117
116
  return @out unless ret
@@ -247,7 +246,6 @@ STDERR.puts files.inspect
247
246
  file = files.first
248
247
  result = edit_file("#{@blog.root}/drafts/#{file}")
249
248
  @blog.rebuild_post(file)
250
- sleep 5
251
249
  @out
252
250
  end
253
251
 
data/lib/runeblog.rb CHANGED
@@ -77,7 +77,6 @@ class RuneBlog
77
77
  Dir.chdir(dir) do
78
78
  create_dir("drafts")
79
79
  create_dir("views")
80
- #??? create_dir("generated")
81
80
  #? create_dir("assets")
82
81
  new_sequence
83
82
  end
@@ -169,13 +168,14 @@ class RuneBlog
169
168
  create_dir('themes')
170
169
  # create_dir("local")
171
170
  create_dir("generated")
172
- create_dir("generated/blog")
173
171
  create_dir('assets')
174
172
 
175
173
  Dir.chdir("themes") { system("tar zxvf #{GemData}/standard.tgz 2>/dev/null") }
176
174
  pub = "user: xxx\nserver: xxx\ndocroot: xxx\npath: xxx\nproto: xxx\n"
177
175
  dump(pub, "publish")
178
176
 
177
+ # Add to global.lt3 here? FIXME
178
+
179
179
  view = RuneBlog::View.new(arg)
180
180
  self.view = view
181
181
  vdir = self.view.dir
@@ -212,10 +212,11 @@ class RuneBlog
212
212
  result
213
213
  end
214
214
 
215
- def create_new_post(title, testing = false)
215
+ def create_new_post(title, testing = false, teaser: nil, body: nil)
216
+ # STDERR.puts "-- create_new_post: teaser = #{teaser.inspect} body = #{body.inspect}"
216
217
  save = Dir.pwd
217
218
  Dir.chdir(self.view.dir)
218
- post = Post.create(title)
219
+ post = Post.create(title, teaser, body)
219
220
  post.edit unless testing
220
221
  meta = post.build
221
222
  Dir.chdir(save)
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.71"
3
+ VERSION = "0.1.73"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
data/runeblog.gemspec CHANGED
@@ -25,13 +25,18 @@ spec = Gem::Specification.new do |s|
25
25
 
26
26
  # Files...
27
27
  main = Find.find("bin").to_a +
28
- Find.find("lib").to_a +
29
- Find.find("data").to_a
28
+ Find.find("lib").to_a
29
+
30
+ Dir.chdir do
31
+ system("tar zcvf standard.tgz standard/")
32
+ end
33
+
34
+ std_theme = ["data/standard.tgz"]
30
35
 
31
36
  misc = %w[./README.lt3 ./README.md ./runeblog.gemspec]
32
37
  test = Find.find("test").to_a
33
38
 
34
- s.files = main + misc + test
39
+ s.files = main + std_theme + misc + test
35
40
  s.homepage = 'https://github.com/Hal9000/runeblog'
36
41
  s.license = "Ruby"
37
42
  end
data/test/make_blog.rb CHANGED
@@ -15,9 +15,10 @@ def debug(str)
15
15
  # STDERR.puts str
16
16
  end
17
17
 
18
- def make_post(x, title)
18
+ def make_post(x, title, teaser, body)
19
+ # STDERR.puts "-- make_post: teaser = #{teaser.inspect} body = #{body.inspect}"
19
20
  meta = OpenStruct.new
20
- num = x.create_new_post(title, true)
21
+ num = x.create_new_post(title, true, teaser: teaser, body: body)
21
22
  num
22
23
  end
23
24
 
@@ -31,31 +32,93 @@ end
31
32
  system("rm -rf .blogs")
32
33
  RuneBlog.create_new_blog_repo('test_view', ".blogs/data")
33
34
  x = RuneBlog.new
34
- x.create_view("alpha_view")
35
+
36
+ x.create_view("around_austin") # FIXME remember view title!
35
37
 
36
38
  # Hack:
37
39
  if File.exist?("publish")
38
- system("cp publish .blogs/data/views/alpha_view/publish")
40
+ system("cp publish .blogs/data/views/around_austin/publish")
39
41
  end
40
- system("cp test/fakeimage.jpg .blogs/data/views/alpha_view/assets/")
41
-
42
- x.create_view("beta_view")
43
- x.create_view("gamma_view")
44
-
45
- x.change_view("alpha_view") # 1 2 7 8 9
46
- make_post(x, "Post number 1")
47
- make_post(x, "Post number 2")
48
- x.change_view("beta_view") # 3 5 6
49
- make_post(x, "Post number 3")
50
- x.change_view("gamma_view") # 4 10
51
- make_post(x, "Post number 4")
52
- x.change_view("beta_view")
53
- make_post(x, "Post number 5")
54
- make_post(x, "Post number 6")
55
- x.change_view("alpha_view")
56
- make_post(x, "Post number 7")
57
- make_post(x, "Post number 8")
58
- make_post(x, "Post number 9")
59
- x.change_view("gamma_view")
60
- make_post(x, "Post number 10")
61
- x.change_view("alpha_view")
42
+ system("cp test/fakeimage.jpg .blogs/data/views/around_austin/assets/")
43
+
44
+ x.create_view("computing")
45
+
46
+ x.create_view("music")
47
+
48
+ x.change_view("around_austin") # 1 2 7 8 9
49
+
50
+ make_post(x, "What's at Stubbs...", <<-EXCERPT, <<-BODY)
51
+ Stubbs has been around for longer than civilization.
52
+ EXCERPT
53
+ That's a good thing. But their music isn't always the greatest.
54
+ BODY
55
+
56
+ make_post(x, "The new amphitheatre is overrated", <<-EXCERPT, <<-BODY)
57
+ It used to be that all major concerts played the Erwin Center.
58
+ EXCERPT
59
+ Now, depending on what you consider "major," blah blah blah...
60
+ BODY
61
+
62
+ x.change_view("computing") # 3 5 6
63
+
64
+ make_post(x, "Elixir Conf coming up...", <<-EXCERPT, <<-BODY)
65
+ The next Elixir Conf is always coming up.
66
+ EXCERPT
67
+ I mean, unless the previous one was the last one ever, which I don't expect to
68
+ happen for a couple of decades.
69
+ BODY
70
+
71
+ x.change_view("music") # 4 10
72
+
73
+ make_post(x, "Does indie still matter?", <<-EXCERPT, <<-BODY)
74
+ Indie msic blah blah blah blah....
75
+ EXCERPT
76
+ And more about indie music.
77
+ BODY
78
+
79
+ x.change_view("computing")
80
+
81
+ make_post(x, "The genius of Scenic", <<-EXCERPT, <<-BODY)
82
+ Boyd Multerer is a genius.
83
+ EXCERPT
84
+ And so is Scenic.
85
+ BODY
86
+
87
+ make_post(x, "The future of coding", <<-EXCERPT, <<-BODY)
88
+ Someday you can forget your text editor entirely.
89
+ EXCERPT
90
+ But that day hasn't come yet.
91
+ BODY
92
+
93
+ x.change_view("around_austin")
94
+
95
+ make_post(x, "The graffiti wall", <<-EXCERPT, <<-BODY)
96
+ RIP, Hope Gallery
97
+ EXCERPT
98
+ It's been a while since I was there. They say it was torn down
99
+ while I wasn't looking.
100
+ BODY
101
+
102
+ make_post(x, "The Waller Creek project", <<-EXCERPT, <<-BODY)
103
+ Will it ever be finished?
104
+ EXCERPT
105
+ Blah blah Waller Creek blah blah...
106
+ BODY
107
+
108
+ make_post(x, "Life on Sabine Street", <<-EXCERPT, <<-BODY)
109
+ It's like Pooh Corner, except not.
110
+ EXCERPT
111
+ This is about Sabine St, blah blah lorem ipsum dolor...
112
+ BODY
113
+
114
+ x.change_view("music")
115
+
116
+ make_post(x, "Remember Modest Mouse?", <<-EXCERPT, <<-BODY)
117
+ They date to the 90s or before.
118
+ EXCERPT
119
+ But I first heard of them
120
+ in 2005.
121
+ BODY
122
+
123
+ x.change_view("around_austin")
124
+
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.1.71
4
+ version: 0.1.73
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-05-26 00:00:00.000000000 Z
11
+ date: 2019-05-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext