runeblog 0.0.94 → 0.0.95

Sign up to get free protection for your applications and to get access to all the features.
Files changed (5) hide show
  1. checksums.yaml +4 -4
  2. data/bin/blog +13 -10
  3. data/lib/repl.rb +0 -36
  4. data/lib/version.rb +1 -1
  5. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: b8720cc6cf31c380400565dcc8868cd9ac9f6d72
4
- data.tar.gz: ca565aeecf8cd0532f2bdd415923fab0240400d1
3
+ metadata.gz: a9d4d9b1bcaafabe52df6f052937384b9ca18994
4
+ data.tar.gz: 321bdd0774b16023c07aa178c186c979fe4e3189
5
5
  SHA512:
6
- metadata.gz: 0c923e9f2283b3bbd51852f421821243c526b98d880fd12b7061d8dcba41254d0b7bbfb1b43fadf8ff302d516bb68466f406a260b5969b0d0b0829e7da8e8224
7
- data.tar.gz: 87c4b6432312db1c69bde589df6df01913829a4e7b54f6d064b6cc0ceaa5c8360176da304ad8e8602c9f482193dc13c8b5755017f15acb984d6c05f88748f08c
6
+ metadata.gz: 3f5b753295af284c6c58cae4a9835ccb4ec4533994a39ba5bddac3059de9fac885059d601216ec3472f61f70444fd7f2435d39b57a30b4749e83948b7b6497a5
7
+ data.tar.gz: 87fa60d1c80194b23e5ee31fadea623455ec477ccb25e09e51994bbe4f9b92a0e51e4ae5f83dcec641d027744959a683452581cc65dfca237107a46c2b73e0e5
data/bin/blog CHANGED
@@ -33,22 +33,25 @@ if ! RuneBlog.exist?
33
33
  end
34
34
  end
35
35
 
36
+ def mainloop
37
+ cmd = Readline.readline(red("\nblog> "), true)
38
+ cmd_quit(nil) if cmd.nil? # ^D
39
+ cmd.chomp!
40
+ return if cmd.empty? # CR does nothing
41
+ meth, params = RuneBlog::REPL.choose_method(cmd)
42
+ str = send(meth, params)
43
+ puts str unless str.nil?
44
+ rescue => err
45
+ puts err
46
+ end
47
+
36
48
  @blog = RuneBlog.new
37
49
 
38
50
  if cmd.nil? # REPL
39
51
  system("tput smcup") # see: tput rmcup in cmd_quit
40
52
 
41
53
  puts red("\n RuneBlog v #{RuneBlog::VERSION}")
42
- loop do
43
- cmd = Readline.readline(red("\nblog> "), true)
44
-
45
- cmd_quit(nil) if cmd.nil? # ^D
46
- cmd.chomp!
47
- next if cmd.empty? # CR does nothing
48
- meth, params = RuneBlog::REPL.choose_method(cmd)
49
- str = send(meth, params)
50
- puts str unless str.nil?
51
- end
54
+ loop { mainloop }
52
55
  else # one command
53
56
  file = File.open("/dev/tty")
54
57
  STDIN.reopen(file) # avoid ARGF dumbness
data/lib/repl.rb CHANGED
@@ -32,8 +32,6 @@ module RuneBlog::REPL
32
32
  result = system("open '#{url}'")
33
33
  raise CantOpen(url) unless result
34
34
  nil
35
- rescue => err
36
- error(err)
37
35
  end
38
36
 
39
37
  def cmd_preview(arg)
@@ -42,8 +40,6 @@ module RuneBlog::REPL
42
40
  local = @blog.view.index
43
41
  result = system("open #{local}")
44
42
  raise CantOpen(local) unless result
45
- rescue => err
46
- error(err)
47
43
  end
48
44
 
49
45
  def cmd_deploy(arg) # FIXME non-string return expected in caller?
@@ -72,8 +68,6 @@ module RuneBlog::REPL
72
68
  dump(files, "#{vdir}/last_deployed")
73
69
  output! "...finished.\n"
74
70
  @out
75
- rescue => err
76
- error(err)
77
71
  end
78
72
 
79
73
  def cmd_rebuild(arg)
@@ -83,8 +77,6 @@ module RuneBlog::REPL
83
77
  files = @blog.find_src_slugs
84
78
  files.each {|file| @blog.rebuild_post(file) }
85
79
  nil
86
- rescue => err
87
- error(err)
88
80
  end
89
81
 
90
82
  def cmd_relink(arg)
@@ -92,8 +84,6 @@ module RuneBlog::REPL
92
84
  check_empty(arg)
93
85
  @blog.relink
94
86
  nil
95
- rescue => err
96
- error(err)
97
87
  end
98
88
 
99
89
  def cmd_list_views(arg)
@@ -104,8 +94,6 @@ module RuneBlog::REPL
104
94
  outstr " #{v}\n"
105
95
  end
106
96
  @out
107
- rescue => err
108
- error(err)
109
97
  end
110
98
 
111
99
  def cmd_change_view(arg)
@@ -121,8 +109,6 @@ module RuneBlog::REPL
121
109
  end
122
110
  end
123
111
  @out
124
- rescue => err
125
- error(err)
126
112
  end
127
113
 
128
114
  def cmd_new_view(arg)
@@ -132,8 +118,6 @@ module RuneBlog::REPL
132
118
  @blog.view.deployer = ask_deployment_info
133
119
  write_config(@blog.view.deployer, @blog.view.dir + "/deploy") # change this?
134
120
  nil
135
- rescue => err
136
- error(err)
137
121
  end
138
122
 
139
123
  def cmd_new_post(arg)
@@ -144,8 +128,6 @@ module RuneBlog::REPL
144
128
  meta.title = title
145
129
  @blog.create_new_post(meta)
146
130
  nil
147
- rescue => err
148
- error(err)
149
131
  end
150
132
 
151
133
  def cmd_kill(arg)
@@ -157,9 +139,6 @@ module RuneBlog::REPL
157
139
  output ret
158
140
  end
159
141
  @out
160
- rescue => err
161
- error(err)
162
- puts err.backtrace
163
142
  end
164
143
 
165
144
  #-- FIXME affects linking, building, deployment...
@@ -174,15 +153,6 @@ module RuneBlog::REPL
174
153
  return @out
175
154
  end
176
155
  @out
177
- rescue ArgumentError => err
178
- puts err
179
- puts err.backtrace
180
- rescue CantDelete => err
181
- puts err
182
- puts err.backtrace
183
- rescue => err
184
- error(err)
185
- puts err.backtrace
186
156
  end
187
157
 
188
158
  #-- FIXME affects linking, building, deployment...
@@ -204,8 +174,6 @@ module RuneBlog::REPL
204
174
 
205
175
  @blog.rebuild_post(file)
206
176
  nil
207
- rescue => err
208
- error(err)
209
177
  end
210
178
 
211
179
  def cmd_list_posts(arg)
@@ -220,8 +188,6 @@ module RuneBlog::REPL
220
188
  posts.each {|post| outstr " #{colored_slug(post)}\n" }
221
189
  end
222
190
  @out
223
- rescue => err
224
- error(err)
225
191
  end
226
192
 
227
193
  def cmd_list_drafts(arg)
@@ -238,8 +204,6 @@ module RuneBlog::REPL
238
204
  end
239
205
  end
240
206
  @out
241
- rescue => err
242
- error(err)
243
207
  end
244
208
 
245
209
  def cmd_INVALID(arg)
data/lib/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.0.94"
3
+ VERSION = "0.0.95"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  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.0.94
4
+ version: 0.0.95
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-10-27 00:00:00.000000000 Z
11
+ date: 2018-10-28 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext