runeblog 0.0.58 → 0.0.59

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
  SHA1:
3
- metadata.gz: d32821f8f0c5a59dd18a91b23edbb0927ca5bcb3
4
- data.tar.gz: e5cb288cad3ac1781b09ea671b44c22d6c022281
3
+ metadata.gz: f5ef2b59f2ea5d65799fce9e0d24bcb4038afa10
4
+ data.tar.gz: b643c98e0d6c8da57e0acd72f41029b7ea147c77
5
5
  SHA512:
6
- metadata.gz: 23ef8da1f243feda7aae4b2c3dd75dacd7aa6de42ced265b1c016f6a2ed2f8adf971a2a381c295cc3183ad45dd185d56323c4b7549faf867da3c82cbb789b4a2
7
- data.tar.gz: 3f85f7fdcb768c77c34a0d92b3dd10a8c2917601e1fc6226edad0214887b3e1ccf2398d27a4cdb4dece15d9645eb9c510a9a61ca682feb1e30bd4afc09ebccc3
6
+ metadata.gz: 113d0e271a81cd8f0d7021d66806bffcfcdedac95526ed7795ce056a47fb94c049d1b1eafcdcc9fad3f917f33d166d004bd58c09c3b05c32ab91bd178c2a29ee
7
+ data.tar.gz: 6f96ad2f2cc7826c52afb7e8ec946f355f0a7ad35b7853e4abdd8d4ea2ab0aa14c99dc729cad888a4e18df6daf9f970af14d43f1687a4987d94f5f2f29ce8ebc
data/bin/blog CHANGED
@@ -21,7 +21,7 @@ STDOUT.sync = true
21
21
 
22
22
  cmd, arg = get_argv
23
23
 
24
- open_blog
24
+ @blog = open_blog
25
25
 
26
26
  puts red("\n RuneBlog v #{RuneBlog::VERSION}")
27
27
 
data/data/VERSION CHANGED
@@ -1 +1 @@
1
- RuneBlog v 0.0.58 2018-09-13
1
+ RuneBlog v 0.0.59 2018-09-16
data/lib/helpers-repl.rb CHANGED
@@ -191,7 +191,7 @@ module RuneBlog::REPL
191
191
  end
192
192
 
193
193
  def import(arg = nil)
194
- open_blog unless @blog
194
+ # open_blog unless @blog
195
195
 
196
196
  arg = nil if arg == ""
197
197
  arg ||= ask("Filename: ") # check validity later
data/lib/repl.rb CHANGED
@@ -4,6 +4,8 @@ require 'helpers-repl' # FIXME structure
4
4
 
5
5
  module RuneBlog::REPL
6
6
 
7
+ # @blog = open_blog
8
+
7
9
  def cmd_quit(arg)
8
10
  check_empty(arg)
9
11
  abort "\n "
@@ -106,7 +108,10 @@ module RuneBlog::REPL
106
108
  reset_output("\n")
107
109
  check_empty(arg)
108
110
  abort "Config file not read" unless @blog
109
- @blog.views.each {|v| outstr " #{v}\n" }
111
+ @blog.views.each do |v|
112
+ v = bold(v) if v == @blog.view
113
+ outstr " #{v}\n"
114
+ end
110
115
  @out
111
116
  rescue => err
112
117
  error(err)
@@ -133,20 +138,9 @@ module RuneBlog::REPL
133
138
 
134
139
  def cmd_new_view(arg)
135
140
  reset_output
136
- @blog ||= open_blog
137
141
  arg ||= ask("New view: ") # check validity later
138
- raise "view #{arg} already exists" if @blog.views.include?(arg)
139
-
140
- dir = @root + "/views/" + arg + "/"
141
- create_dir(dir + 'custom')
142
- create_dir(dir + 'assets')
143
- File.open(dir + "deploy") { } # FIXME
144
-
145
- # Something more like this? RuneBlog.new_view(arg)
146
- File.write(dir + "custom/blog_header.html", RuneBlog::BlogHeader)
147
- File.write(dir + "custom/blog_trailer.html", RuneBlog::BlogTrailer)
148
- File.write(dir + "last_deployed", "Initial creation")
149
- @blog.views << arg
142
+ RuneBlog.create_view(arg)
143
+ return nil
150
144
  rescue => err
151
145
  error(err)
152
146
  end
@@ -154,9 +148,10 @@ module RuneBlog::REPL
154
148
  def cmd_new_post(arg)
155
149
  reset_output
156
150
  check_empty(arg)
157
- open_blog unless @blog # duh?
151
+ # open_blog unless @blog # duh?
158
152
  @title = ask("Title: ")
159
153
  @blog.create_new_post(@title)
154
+ return nil
160
155
  rescue => err
161
156
  error(err)
162
157
  end
@@ -165,7 +160,7 @@ module RuneBlog::REPL
165
160
  reset_output
166
161
  args = arg.split
167
162
  args.each {|x| cmd_remove_post([x], false) }
168
- nil
163
+ return nil
169
164
  rescue => err
170
165
  error(err)
171
166
  end
data/lib/runeblog.rb CHANGED
@@ -3,7 +3,7 @@ require 'yaml'
3
3
  require 'livetext'
4
4
 
5
5
  class RuneBlog
6
- VERSION = "0.0.58"
6
+ VERSION = "0.0.59"
7
7
 
8
8
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
9
9
  DefaultData = Path + "/../data"
@@ -56,6 +56,21 @@ class RuneBlog
56
56
  File.exist?(".blog")
57
57
  end
58
58
 
59
+ def create_view(name)
60
+ raise "view #{arg} already exists" if self.views.include?(arg)
61
+
62
+ dir = @root + "/views/" + arg + "/"
63
+ create_dir(dir + 'custom')
64
+ create_dir(dir + 'assets')
65
+ File.open(dir + "deploy", "w") { } # FIXME
66
+
67
+ # Something more like this? RuneBlog.new_view(arg)
68
+ File.write(dir + "custom/blog_header.html", RuneBlog::BlogHeader)
69
+ File.write(dir + "custom/blog_trailer.html", RuneBlog::BlogTrailer)
70
+ File.write(dir + "last_deployed", "Initial creation")
71
+ self.views << arg
72
+ end
73
+
59
74
  def create_new_post(title, view=nil)
60
75
  view ||= @view
61
76
  date = Time.now.strftime("%Y-%m-%d")
data/test/repl.rb CHANGED
@@ -9,7 +9,7 @@ class TestREPL < Minitest::Test
9
9
 
10
10
  def setup
11
11
  Dir.chdir("/Users/Hal/Dropbox/files/blog") # temp code!!
12
- @blog ||= open_blog
12
+ @blog = open_blog
13
13
  end
14
14
 
15
15
  def test_001_cmd_help
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.58
4
+ version: 0.0.59
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-09-13 00:00:00.000000000 Z
11
+ date: 2018-09-16 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext