runeblog 0.3.29 → 0.3.30

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: f73831245e7f26410b588d25eb8eaf411f199c3b138c07cbbdc1cd6ab17a0c9a
4
- data.tar.gz: 985cc0eb1bef7e7f7d782e7f2f15f06c110351acc828de6e188f256f88800808
3
+ metadata.gz: 2f1dd9b0013eda386f3152a196dcd6ee279274bdcfebca3fce17fd1a495fe93d
4
+ data.tar.gz: 9b1a091067233521f3a9216d84471ae31a0132b68ca22dca174555e824267c21
5
5
  SHA512:
6
- metadata.gz: 5a3ff11e051b4b35d3016f3494e8f296373cc9463255fcc2803cd30a1429772dcf4e35e2de8c80218b6ba96eb7da4b2884ba9cf478eadb940b4cc16c3bd7b464
7
- data.tar.gz: 46adb7c62bedf13f9ccc4a4dcd1526764b0a6d6f3d6638c1e06bad3a49d0957e0858f5d979ca8fb61ca0f08183e8e76d82a07b4a9ec547474ee36e1fa538e1bf
6
+ metadata.gz: ac2b3d8dd3d7f378658d138db56695e5749b0022ef19197bb6d863c077b469972e3d6a6b6adb27f20dc91e1a6a656320d8c15b657da9015935a5bd371d5a4b4e
7
+ data.tar.gz: ffd02d0666582b4d2a31dcc552872fc5e257e30b26054e06ebf337aca2ceac9540ff0b1506cdf272b0cdee7fa7f6b70b4c7bddc578460472684039bac5dbb05c
data/bin/blog CHANGED
@@ -11,6 +11,8 @@ require 'repl'
11
11
 
12
12
  include RuneBlog::REPL
13
13
 
14
+ include ErrorChecks
15
+
14
16
  def yesno(question, noskip=false)
15
17
  puts fx("\n #{question}", :bold)
16
18
  puts unless noskip
@@ -46,18 +48,25 @@ end
46
48
 
47
49
  def get_global
48
50
  view_name = ask!(" Filename: ")
51
+ # FIXME test below doesn't work?
52
+ FilenameHasBlank(view_name) if view_name.include?(" ")
53
+
49
54
  @blog.create_view(view_name) # call change_view??
50
55
  if yesno("Faster view setup? (no: edit global.lt3)")
51
56
  title = ask!(" View title: ")
52
57
  subtitle = ask!(" Subtitle : ")
53
58
  domain = ask!(" Domain : ")
54
59
  modify_view_global(view_name)
55
- modify_view_settings(name: view_name, title: title, subtitle: subtitle,
60
+ modify_view_settings(name: view_name, title: title, subtitle: subtitle,
56
61
  domain: domain)
57
62
  else
58
63
  vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(VIEW_.*\|SITE.*\)"'
59
64
  edit_file(@blog.view.dir/"themes/standard/global.lt3", vim: vim_params)
60
65
  end
66
+ rescue => err
67
+ puts err
68
+ puts "Retrying..."
69
+ retry
61
70
  end
62
71
 
63
72
  def get_started
@@ -195,7 +204,6 @@ def create_new_repo?
195
204
  if ! RuneBlog.exist?
196
205
  exit unless yesno("No blog repo found. Create new one?")
197
206
  RuneBlog.create_new_blog_repo
198
- puts "Sleeping..."; sleep 15
199
207
  puts fx(" Blog repo successfully created.", :bold)
200
208
  new_repo = true
201
209
  end
@@ -236,12 +244,13 @@ reopen_stderr
236
244
 
237
245
  check_ruby_version
238
246
  handle_cmdline unless ARGV.empty?
247
+
239
248
  set_fgbg
240
249
  print_intro
241
- # STDERR.puts "cp 6 - pause"; gets
242
250
  create_new_repo?
243
- # STDERR.puts "cp 7 - pause"; gets
251
+
244
252
  cmd_history_etc
245
- # STDERR.puts "cp 8 - pause"; gets
253
+
246
254
  loop { mainloop }
255
+
247
256
  exit_repl
data/lib/exceptions.rb CHANGED
@@ -34,4 +34,5 @@ make_exception(:CantFindWidgetDir, "Can't find widget dir '%1'")
34
34
  make_exception(:PublishError, "Error during publishing")
35
35
  make_exception(:NoNumericPrefix, "No numeric prefix on slug '%1'")
36
36
  make_exception(:NoExtensionExpected, "No file extension expected on '%1'")
37
+ make_exception(:FilenameHasBlank, "File '%1' contains a blank space.")
37
38
 
data/lib/lowlevel.rb CHANGED
@@ -4,15 +4,6 @@
4
4
  STDERR.puts err.backtrace.join("\n") if err.respond_to?(:backtrace)
5
5
  log!(str: "#{err} - see also stderr.out")
6
6
  log!(str: err.backtrace.join("\n")) if err.respond_to?(:backtrace)
7
- return
8
-
9
- out = "/tmp/blog#{rand(100)}.txt"
10
- File.open(out, "w") do |f|
11
- f.puts err.to_s + "\n--------"
12
- f.puts err.backtrace.join("\n")
13
- end
14
- puts "Error: See #{out}"
15
- puts "Sleeping..."; sleep 10
16
7
  end
17
8
 
18
9
  def dump(obj, name)
@@ -25,7 +16,6 @@
25
16
 
26
17
  def system!(os_cmd, show: false)
27
18
  log!(enter: __method__, args: [os_cmd], level: 2)
28
- caller.each {|x| print "::: "; p x }
29
19
  STDERR.puts os_cmd if show
30
20
  rc = system(os_cmd)
31
21
  STDERR.puts " rc = #{rc.inspect}" if show
data/lib/runeblog.rb CHANGED
@@ -103,7 +103,6 @@ class RuneBlog
103
103
  create_dirs(repo_root)
104
104
  Dir.chdir(repo_root) do
105
105
  create_dirs(:data, :config, :widgets, :drafts, :views, :posts) # ?? widgets?
106
- # FIXME
107
106
  get_all_widgets("widgets")
108
107
  new_sequence
109
108
  end
@@ -139,31 +138,7 @@ class RuneBlog
139
138
  sleep 3
140
139
  end
141
140
 
142
- # def self.read(root_rel = ".blogs") # always assumes existing blog
143
- # log!(enter: "RuneBlog.read", args: [root_rel])
144
- # instance = RuneBlog.allocate
145
- # instance.instance_eval do
146
- # # @blog = instance # Duhhh
147
- # @root = Dir.pwd/root_rel
148
- # # _init_get_view ##########??????
149
- # # self.class.blog = self # Weird, like singleton. Dumbass circular dependency?
150
- # RuneBlog.blog = instance
151
- # dirs = subdirs("#@root/views/").sort
152
- # @views = dirs.map {|name| RuneBlog::View.new(name) }
153
- # @curr = str2view(File.read(@root/"data/VIEW").chomp)
154
- # @view = @curr
155
- # # ...was init_get_view
156
- # @sequence, @post_views, @post_tags = get_sequence, [], []
157
- # end
158
- # return instance
159
- # rescue => err
160
- # puts "ERROR - #{err.inspect}"
161
- # # puts "Error - see stderr.out"
162
- # puts err.inspect + "\n" + err&.backtrace
163
- # sleep 3
164
- # end
165
-
166
- def initialize(root_rel) ##### FIXME ??
141
+ def initialize(root_rel = ".blogs") ##### FIXME ??
167
142
  # @blog = instance # Duhhh
168
143
  @root = Dir.pwd/root_rel
169
144
  # _init_get_view ##########??????
@@ -1,7 +1,7 @@
1
1
  if !defined?(RuneBlog::Path)
2
2
 
3
3
  class RuneBlog
4
- VERSION = "0.3.29"
4
+ VERSION = "0.3.30"
5
5
 
6
6
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
7
7
  Path = File.dirname(path)
data/lib/view.rb CHANGED
@@ -1,8 +1,8 @@
1
1
  require 'logging'
2
2
 
3
3
  class RuneBlog::View
4
- attr_reader :name, :state, :globals
5
- attr_accessor :publisher
4
+ attr_reader :name, :state
5
+ attr_accessor :publisher, :globals
6
6
 
7
7
  include RuneBlog::Helpers
8
8
 
@@ -33,14 +33,25 @@ class RuneBlog::View
33
33
 
34
34
  def get_globals(force = false)
35
35
  return if @globals && !force
36
+
36
37
  # gfile = @blog.root/"views/#@name/themes/standard/global.lt3"
37
38
  gfile = @blog.root/"views/#@name/data/global.lt3"
38
39
  return unless File.exist?(gfile) # Hackish!! how is View.new called from create_view??
39
40
 
40
41
  live = Livetext.customize(call: ".nopara")
42
+ puts "get_globals - 1 - transforming #{gfile}"
43
+ # FIXME - error here somehow:
44
+ # get_globals - 1 - transforming /private/tmp/.blogs/views/foobar/data/global.lt3
45
+ # >> variables: pre="view" file="../settings/view.txt" pwd=/private/tmp
46
+ # No such dir "../settings" (file ../settings/view.txt)
47
+ # No such dir "../settings" (file ../settings/view.txt)
48
+ # get_globals - 2
41
49
  live.xform_file(gfile)
50
+ puts "get_globals - 2"
42
51
  live.setvar("ViewDir", @blog.root/:views/@name)
52
+ puts "get_globals - 3"
43
53
  live.setvar("View", @name)
54
+ puts "get_globals - 4"
44
55
  @globals = live.vars
45
56
  # dump_globals_stderr
46
57
  end
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.3.29
4
+ version: 0.3.30
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2024-05-08 00:00:00.000000000 Z
11
+ date: 2024-05-14 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext