runeblog 0.1.5 → 0.1.6

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: d272238c762b72c9ba74c352a35a08e67a2798dce78765a7a7ab026faa2530a7
4
- data.tar.gz: d7c789ccf2b890f908672d735a7cf9d753ac2cac6f3ad3e3a7706caadc850889
3
+ metadata.gz: 37a61dd4695c47ded548fbb1f3aecf99a644eb63331a0f21df3e573a4ce1c23a
4
+ data.tar.gz: 8f6aa0e0ad310368a032db1d77f1110611f0f0b05ca01bb6341e4cf3be94ca5b
5
5
  SHA512:
6
- metadata.gz: 82485c5e3efff0b30855979c9c7a8f9b18059e13ba2a0b1ba15972a10fb746a71722ff94e9263b86807fdd9fe392317b84b984b55224dfbc0057c799dd558144
7
- data.tar.gz: 40e3575de330a8418d8fe5b39b0eaae911b09936ff91b53649148771e0f8ee3e872816809f97475c2f3da0d8352b548b29c662c0794abb890d10986f788862ab
6
+ metadata.gz: f8d304963d27109c3bda13d780d414233a2e1d94547ab1b906cb9c818df68521960dcb2fa06756de9b6b90ebab08d5d85185ca6a6a055855980a4688a75d9389
7
+ data.tar.gz: eb0e1805f3b02bd08a4e670f05a833cd68fd2492565414d493e93b6d29482c4fac52ec7d0f902c16b33e0c4916217c423511c32a0b133427d39fd65cd1d455ef
data/bin/blog CHANGED
@@ -39,12 +39,9 @@ end
39
39
 
40
40
  ###########
41
41
 
42
- RubyText.start(log: "blogcmd.txt", fg: Blue, bg: White)
43
- RubyText.set(:_echo)
42
+ RubyText.start(:_echo, :keypad, scroll: true, log: "blogcmd.txt", fg: Blue, bg: White)
44
43
 
45
- X.stdscr.keypad(true)
46
-
47
- STDOUT.sync = true
44
+ # STDOUT.sync = true
48
45
 
49
46
  cmd, arg = get_argv
50
47
 
data/lib/helpers-blog.rb CHANGED
@@ -19,7 +19,7 @@ module RuneBlog::Helpers
19
19
  return vals
20
20
  rescue => err
21
21
  puts "Something hit the fan: #{err}" # CHANGE_FOR_CURSES?
22
- puts err.backtrace # CHANGE_FOR_CURSES?
22
+ puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
23
23
  exit
24
24
  end
25
25
 
@@ -82,7 +82,7 @@ module RuneBlog::Helpers
82
82
  def error(err) # Hmm, this is duplicated
83
83
  str = "\n Error: #{err}"
84
84
  puts str # CHANGE_FOR_CURSES?
85
- puts err.backtrace # CHANGE_FOR_CURSES?
85
+ puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
86
86
  end
87
87
 
88
88
  def dump(obj, name)
@@ -90,3 +90,8 @@ module RuneBlog::Helpers
90
90
  end
91
91
 
92
92
  end
93
+
94
+ def dump(obj, name) # FIXME scope
95
+ File.write(name, obj)
96
+ end
97
+
data/lib/post.rb CHANGED
@@ -73,7 +73,7 @@ class RuneBlog::Post
73
73
  end
74
74
  rescue => err
75
75
  p err # CHANGE_FOR_CURSES?
76
- puts err.backtrace # CHANGE_FOR_CURSES?
76
+ puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
77
77
  end
78
78
 
79
79
  private
data/lib/publish.rb CHANGED
@@ -30,12 +30,14 @@ class RuneBlog::Publishing
30
30
  end
31
31
 
32
32
  def publish(files)
33
+ debug "files = #{files.inspect}"
33
34
  reset_output
34
35
  dir = "#@docroot/#@path"
35
36
  result = system("ssh #@user@#@server -x mkdir #{dir}")
36
37
  list = files.join(' ')
37
38
  cmd = "scp -r #{list} #@user@#@server:#{dir} >/dev/null 2>/tmp/wtf"
38
39
  output! "Publishing #{files.size} files...\n"
40
+ debug "cmd = #{cmd.inspect} - see /tmp/wtf"
39
41
  result = system(cmd)
40
42
  raise PublishError unless result
41
43
 
data/lib/repl.rb CHANGED
@@ -8,7 +8,7 @@ make_exception(:PublishError, "Error during publishing")
8
8
  module RuneBlog::REPL
9
9
 
10
10
  def edit_file(file)
11
- result = system("#{blog.editor} #{file}")
11
+ result = system("#{@blog.editor} #{file}")
12
12
  raise EditorProblem(file) unless result
13
13
  STDSCR.clear
14
14
  end
@@ -119,15 +119,20 @@ module RuneBlog::REPL
119
119
  reset_output
120
120
  # Simplify this
121
121
  if arg.nil?
122
+ viewnames = @blog.views.map {|x| x.name }
123
+ n = viewnames.find_index(@blog.view.name)
124
+ k, name = RubyText.menu(c: 30, items: viewnames, curr: n)
125
+ @blog.view = name
122
126
  output bold(@blog.view)
123
- return [true, @out]
127
+ puts "\n ", fx(name, :bold), "\n"
128
+ return [false, @out]
124
129
  else
125
130
  if @blog.view?(arg)
126
131
  @blog.view = arg # reads config
127
132
  output red("View: ") + bold(@blog.view.name.to_s) # FIXME?
128
133
  end
129
134
  end
130
- return [true, @out]
135
+ return [false, @out]
131
136
  end
132
137
 
133
138
  def cmd_new_view(arg)
@@ -196,6 +201,7 @@ module RuneBlog::REPL
196
201
  check_empty(arg)
197
202
  puts
198
203
  @blog.views.each do |v|
204
+ debug "v = #{v.inspect}"
199
205
  v = v.to_s
200
206
  v = fx(v, :bold) if v == @blog.view.name
201
207
  print " "
data/lib/runeblog.rb CHANGED
@@ -52,7 +52,7 @@ class RuneBlog
52
52
  blog.create_view("test_view")
53
53
  rescue => err
54
54
  puts "Can't create blog: '#{dir}' - #{err}" # CHANGE_FOR_CURSES?
55
- puts err.backtrace # CHANGE_FOR_CURSES?
55
+ puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
56
56
  end
57
57
 
58
58
  def initialize # assumes existing blog
@@ -85,12 +85,12 @@ class RuneBlog
85
85
  case arg
86
86
  when RuneBlog::View
87
87
  @view = arg
88
- @view.publisher = read_config(@view.dir + "/publish")
88
+ @view.publisher = RuneBlog::Publishing.new(read_config(@view.dir + "/publish"))
89
89
  when String
90
90
  new_view = str2view(arg)
91
91
  raise NoSuchView(arg) if new_view.nil?
92
92
  @view = new_view
93
- @view.publisher = read_config(@view.dir + "/publish")
93
+ @view.publisher = RuneBlog::Publishing.new(read_config(@view.dir + "/publish"))
94
94
  else
95
95
  raise CantAssignView(arg.class.to_s)
96
96
  end
@@ -174,6 +174,7 @@ class RuneBlog
174
174
  post.num
175
175
  rescue => err
176
176
  puts err # error(err) # CHANGE_FOR_CURSES?
177
+ puts err.backtrace.join("\n") # CHANGE_FOR_CURSES?
177
178
  end
178
179
 
179
180
  def edit_initial_post(file, testing = false)
data/lib/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.1.5"
3
+ VERSION = "0.1.6"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
data/lib/view.rb CHANGED
@@ -34,9 +34,12 @@ class RuneBlog::View
34
34
  def files(recent = false)
35
35
  vdir = dir()
36
36
  files = [index()]
37
+ debug "Looking in #{vdir}"
37
38
  others = Dir.entries(vdir).grep(/^\d\d\d\d/)
38
39
  files += others.map {|x| "#{vdir}/#{x}" }
39
- files.reject! {|f| recent?(f) } if recent
40
+ debug "Found #{files.inspect}"
41
+ # files.reject! {|f| recent?(f) } if recent
42
+ debug "Now files = #{files.inspect}"
40
43
  files
41
44
  end
42
45
 
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.5
4
+ version: 0.1.6
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2018-12-11 00:00:00.000000000 Z
11
+ date: 2018-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext