runeblog 0.0.86 → 0.0.87

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: f561cb43b171a92ba7b8d6156e2496b7c94cdd73
4
- data.tar.gz: 0d719b8f5233062fb540ec8f6127fb774524369c
3
+ metadata.gz: 78b5f9479c76a98657e37683acc6c1ff61a8778c
4
+ data.tar.gz: 06714e9fac6d6e52c45961e9cf5ccdba773ee5ab
5
5
  SHA512:
6
- metadata.gz: e58e6e714a115c0820616b411862acec32b13815f5ca0d387623f7cd0f103545150ee3429aad747906a01f2f843742e1d908b845cfb238c5e471e68b8f2f88f5
7
- data.tar.gz: a93184f843dcc8069bbbb28807bc77846d68996c3a985e68db93a8316460d4cf5dd86bdc2bd36395d57ff858bd12b235e32b84ad6e61505499f3a946daab3d8a
6
+ metadata.gz: e0d20ae7638af5393715a609649216f881d78c7294e794023ebc6066de22524b575a1ae7c6bd9b011be7f3a45a4e009ec46eadf71b74e1bad4f14d6838f48043
7
+ data.tar.gz: 7cf97dd85e1e258194a880243452abe327535f9325bc403863482079b866b8c0c09c4c1a5e00fbd77b73847b156d8b0dcf0b64568c72430d665c8f8e419f97f7
data/bin/blog CHANGED
@@ -23,8 +23,6 @@ STDOUT.sync = true
23
23
 
24
24
  cmd, arg = get_argv
25
25
 
26
- system("tput smcup") # see: tput rmcup in cmd_quit
27
-
28
26
  if ! RuneBlog.exist?
29
27
  print "No blog found. Create new one? (y/n) "
30
28
  resp = gets.chomp
@@ -37,13 +35,11 @@ end
37
35
 
38
36
  @blog = RuneBlog.new
39
37
 
40
- print red("\n RuneBlog v #{RuneBlog::VERSION}")
41
-
42
38
  if cmd.nil? # REPL
43
- puts
39
+ system("tput smcup") # see: tput rmcup in cmd_quit
40
+
41
+ puts red("\n RuneBlog v #{RuneBlog::VERSION}")
44
42
  loop do
45
- # print red("\nblog> ")
46
- # cmd = gets
47
43
  cmd = Readline.readline(red("\nblog> "), true)
48
44
 
49
45
  cmd_quit(nil) if cmd.nil? # ^D
@@ -54,11 +50,12 @@ if cmd.nil? # REPL
54
50
  puts str unless str.nil?
55
51
  end
56
52
  else # one command
57
- raise "Not working right now"
58
53
  file = File.open("/dev/tty")
59
54
  STDIN.reopen(file) # avoid ARGF dumbness
60
- meth, params = RuneBlog::Command.choose_method(cmd)
61
- parse_cmd(ARGV.join(" "))
62
- execute_command
55
+ cmd = ARGV.join(" ")
56
+ meth, params = RuneBlog::REPL.choose_method(cmd)
57
+ str = send(meth, params)
58
+ puts str unless str.nil?
59
+ puts
63
60
  end
64
61
 
data/lib/runeblog.rb CHANGED
@@ -26,11 +26,11 @@ class RuneBlog
26
26
 
27
27
  include Helpers
28
28
 
29
- def self.create_new_blog(dir)
29
+ def self.create_new_blog(dir = ".blog")
30
30
  raise ArgumentError unless dir.is_a?(String) && ! dir.empty?
31
31
  root_dir = Dir.pwd + "/" + dir
32
32
  raise "Already exists" if Dir.exist?(root_dir)
33
- new_dotfile(root: root_dir)
33
+ new_dotfile(root: root_dir, current_view: "test_view")
34
34
  create_dir(dir)
35
35
  Dir.chdir(dir) do
36
36
  create_dir("views")
@@ -38,6 +38,8 @@ class RuneBlog
38
38
  create_dir("src")
39
39
  new_sequence
40
40
  end
41
+ blog = self.new
42
+ blog.create_view("test_view")
41
43
  rescue => err
42
44
  puts "Can't create blog: '#{dir}' - #{err}"
43
45
  puts err.backtrace
data/lib/version.rb CHANGED
@@ -1,6 +1,6 @@
1
1
 
2
2
  class RuneBlog
3
- VERSION = "0.0.86"
3
+ VERSION = "0.0.87"
4
4
 
5
5
  Path = File.expand_path(File.join(File.dirname(__FILE__)))
6
6
  end
data/test/general.rb CHANGED
@@ -123,18 +123,18 @@ class TestREPL < Minitest::Test
123
123
 
124
124
  def test_010_accessors!
125
125
  sorted_views = @blog.views.map(&:to_s).sort
126
- assert sorted_views == ["alpha_view", "beta_view", "gamma_view"],
126
+ assert sorted_views == ["alpha_view", "beta_view", "gamma_view", "test_view"],
127
127
  "Got: #{sorted_views.inspect}"
128
128
  end
129
129
 
130
130
  def test_011_create_delete_view!
131
131
  @blog.create_view("anotherview")
132
132
  sorted_views = @blog.views.map(&:to_s).sort
133
- assert sorted_views == ["alpha_view", "anotherview", "beta_view", "gamma_view"],
133
+ assert sorted_views == ["alpha_view", "anotherview", "beta_view", "gamma_view", "test_view"],
134
134
  "After create: #{sorted_views.inspect}"
135
135
  @blog.delete_view("anotherview", true)
136
136
  sorted_views = @blog.views.map(&:to_s).sort
137
- assert sorted_views == ["alpha_view", "beta_view", "gamma_view"],
137
+ assert sorted_views == ["alpha_view", "beta_view", "gamma_view", "test_view"],
138
138
  "After delete: #{sorted_views.inspect}"
139
139
  end
140
140
 
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.86
4
+ version: 0.0.87
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-20 00:00:00.000000000 Z
11
+ date: 2018-10-21 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext