runeblog 0.2.78 → 0.2.79

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: 6baabb9426c6b2e8d316203e12b941a357a31463425810721d8a72f3add24ecd
4
- data.tar.gz: 9e823dba18e88f9e6159724fbdbb228392eb6433d21f91e6e922b2e7d850cb4d
3
+ metadata.gz: b2b36523206792cb1eb2360e872eba5680926eda165f59f667ce2a664924d6fb
4
+ data.tar.gz: 6bccc8e6dcc5760acadbcc0a640834d0e775ce9cf8d50c6d85bf7ee5dac7f287
5
5
  SHA512:
6
- metadata.gz: 8bc8bc41c43fec627fb6184ce3b9b44fb4f442a8f462b1396ce180c64d00663772e306701e6b4c7edf466eb930162a39ede08bc642d724fde0c2327b97852c45
7
- data.tar.gz: 4c5f370aa66624daac8355ddf03b7824e890e27b97eaaa27cb81e788c38352e9a6be90ea37c7e501fd7f198e4a6727054c951cb3a26992d88751e45ab0535e16
6
+ metadata.gz: 3d1d2e2cbb5eabb5923ff6d05be47de3661678bce2285b5199dabc3af174de046c27676c4ff9cbf2660c59ebd5ff8ef197e067e324f9c24a611cc3031e3ca25f
7
+ data.tar.gz: ba27ccafcd16ea16b9ee0d7af215a3ade13b2387f17ce3b5dcc803ff9541ac978e4b0e8d6cb74287451cdf93baeb09d70e382e23a3a391f641756cc9646c3906
data/bin/blog CHANGED
@@ -9,14 +9,54 @@ require 'repl'
9
9
 
10
10
  include RuneBlog::REPL
11
11
 
12
+ def yesno(question)
13
+ puts fx("\n #{question}", :bold)
14
+ r, c = STDSCR.rc
15
+ num, str = STDSCR.menu(r: r+1, c: c+6, items: ["yes", "no"])
16
+ num == 0
17
+ end
18
+
19
+ def pick_editor
20
+ choices = %w[vim emacs vi nano]
21
+ r, c = STDSCR.rc
22
+ num, name = STDSCR.menu(r: r+1, c: c+6, title: "Default editor", items: choices)
23
+ file = `which #{name}`.chomp
24
+ end
25
+
12
26
  def get_started
13
27
  puts
14
- puts fx(<<-TEXT, :bold)
15
- Blog repo successfully created.
16
- For help, type h or help.
17
- Create views with: new view
18
- Create a post (within current view): new post
19
- TEXT
28
+ puts fx("\n Blog repo successfully created.", :bold)
29
+
30
+ if yesno("Do you want to qo a quick setup?")
31
+ puts "\n First choose your editor."
32
+ @blog.editor = pick_editor
33
+ File.write("#{@blog.root}/data/EDITOR", @blog.editor)
34
+
35
+ if yesno("Edit settings now?")
36
+ fname = "#{@blog.root}/data/universal.lt3"
37
+ edit_file(fname)
38
+ end
39
+ # Now create a custom global.lt3
40
+ sleep 1
41
+ noview = true
42
+ puts fx("\n Quick setup complete!", :bold)
43
+ if yesno("Create your first view now?")
44
+ cmd_new_view(nil)
45
+ noview = false
46
+ sleep 1
47
+ puts "\n View #{@blog.view} created!\n "
48
+ end
49
+ end
50
+
51
+ sleep 0.5
52
+
53
+ puts
54
+ print fx(" For help", :bold)
55
+ puts " type h or help."
56
+ print fx(" Create a view", :bold)
57
+ puts " with: new view"
58
+ print fx(" Create a post", :bold)
59
+ puts " (within current view): new post"
20
60
  end
21
61
 
22
62
  def mainloop
@@ -101,18 +141,16 @@ home = ENV['HOME']
101
141
  RubyText.start(:_echo, :keypad, scroll: true, log: "binblog.txt", fg: @fg, bg: @bg)
102
142
 
103
143
  if ! RuneBlog.exist?
104
- print fx("\n No blog repo found. Create new one? (y/n): ", :bold)
105
- response = gets.chomp
106
- if response.downcase == "y"
144
+ if yesno("No blog repo found. Create new one?")
107
145
  RuneBlog.create_new_blog_repo
146
+ @blog = RuneBlog.new
147
+ @blog.root = ".blogs" # So far, always using default... hmm
108
148
  get_started
109
149
  else
110
150
  exit
111
151
  end
112
152
  end
113
153
 
114
- @blog = RuneBlog.new
115
-
116
154
  puts fx("\n RuneBlog", :bold), fx(" v #{RuneBlog::VERSION}\n", Red)
117
155
 
118
156
  @cmdhist = []
@@ -1,4 +1,3 @@
1
-
2
1
  . "Universal" settings -- new defaults for global.lt3
3
2
  . work in progress - defaults for each global.lt3
4
3
 
@@ -6,32 +5,15 @@
6
5
  . Global settings are stored here in the form
7
6
  . <variable> <value>
8
7
  . --------------------------------------------------
9
-
10
-
11
- . Details
12
- charset utf-8
13
- locale en_US
8
+ .nopara
14
9
 
15
10
  . Identity
16
11
  author Your name here
17
12
  site rubyhacker.com
18
- host localhost:4000// # populate from site?
19
- url localhost:4000// # populate from site?
20
- publish.user root
21
- publish.server rubyhacker.com # populate from site?
22
- publish.docroot /var/www/
23
- publish.path around_austin # populate from view name
24
- publish.proto http
25
13
 
26
14
  . Style
27
15
  font.family verdana
28
16
 
29
- post.title.color #010101
30
- post.title.size 28px
31
-
32
- post.text.color #0101a1
33
- post.text.size 22px
34
-
35
- post.date.color #9a9a9a
36
- post.date.size 15px
37
-
17
+ . Details
18
+ charset utf-8
19
+ locale en_US
@@ -0,0 +1,8 @@
1
+ .banner
2
+ height 100
3
+ bgcolor 101035
4
+ svg_title bgcolor: #b08080 size: 29px xy: 75,50 align: center size2: 15px xy2: 75,70 align2: center
5
+ image austin-pano.jpg
6
+ break
7
+ navbar
8
+ .end
@@ -5,24 +5,15 @@
5
5
  . the process of blog setup.
6
6
  . --------------------------------------------------
7
7
  .nopara
8
-
9
8
  .mixin liveblog
10
9
 
11
10
  <html>
12
- <!-- Generated from $File on $$date. Editing not recommended. -->
13
-
14
- .seek global.lt3
15
- .include blog/head.lt3
11
+ <!-- Generated from $File on $$date.
12
+ Editing not recommended. -->
13
+ $.seek global.lt3
14
+ $.include blog/head.lt3
16
15
  <body>
17
-
18
- $.banner
19
- height 100
20
- bgcolor 101035
21
- svg_title bgcolor: #b08080 size: 29px xy: 75,50 align: center size2: 15px xy2: 75,70 align2: center
22
- image austin-pano.jpg
23
- break
24
- navbar
25
- $.end
16
+ $.include blog/banner.lt3
26
17
  <div class="content container-fluid mt-4">
27
18
  <div class="row">
28
19
  $.include blog/index.lt3
@@ -1,2 +1,2 @@
1
1
  # CSS for main area page
2
- * { font-family: verdana }
2
+ bosy { font-family: verdana }
@@ -31,7 +31,7 @@ class ::RuneBlog::Widget
31
31
 
32
32
  def write_main
33
33
  @data = @lines.map! {|x| x.chomp.split(/, */, 3) }
34
- css = "* { font-family: verdana }"
34
+ css = "body { font-family: verdana }"
35
35
  card_title = Title
36
36
  File.open("#{Type}-main.html", "w") do |f|
37
37
  _html_body(f, css) do
@@ -1,2 +1,2 @@
1
1
  # CSS for main area page
2
- * { font-family: verdana }
2
+ body { font-family: verdana }
@@ -1,2 +1,2 @@
1
1
  # CSS for main area page
2
- * { font-family: verdana }
2
+ body { font-family: verdana }
@@ -30,7 +30,7 @@ class ::RuneBlog::Widget
30
30
 
31
31
  def write_main
32
32
  mainfile = "#{Type}-main"
33
- css = "* { font-family: verdana }"
33
+ css = "body { font-family: verdana }"
34
34
  File.open("#{mainfile}.html", "w") do |f|
35
35
  _html_body(f, css) do
36
36
  f.puts "<h1>#{Title}</h1><br><hr>"
@@ -4,7 +4,7 @@
4
4
  <head>
5
5
 
6
6
  <style>
7
- * { font-family: verdana }
7
+ body { font-family: verdana }
8
8
  </style>
9
9
 
10
10
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.3/jquery.min.js"></script>
@@ -1,2 +1,2 @@
1
1
  # CSS for pages widget
2
- * { font-family: verdana }
2
+ body { font-family: verdana }
@@ -37,7 +37,7 @@ class ::RuneBlog::Widget
37
37
  end
38
38
 
39
39
  def write_main
40
- css = "* { font-family: verdana }"
40
+ css = "body { font-family: verdana }"
41
41
  card_title = Title
42
42
  File.open("#{Type}-main.html", "w") do |f|
43
43
  _html_body(f, css) do
@@ -1,2 +1,2 @@
1
1
  # CSS for main area page
2
- * { font-family: verdana }
2
+ body { font-family: verdana }
@@ -43,7 +43,7 @@ class ::RuneBlog::Widget
43
43
  def write_main
44
44
  tag = Type
45
45
  card_title = Title
46
- css = "* { font-family: verdana }"
46
+ css = "body { font-family: verdana }"
47
47
  mainfile = "#{tag}-main"
48
48
  File.open("#{mainfile}.html", "w") do |f|
49
49
  _html_body(f, css) do
@@ -1,2 +1,2 @@
1
1
  # CSS for main area page
2
- * { font-family: verdana }
2
+ body { font-family: verdana }
@@ -1,2 +1,2 @@
1
1
  # CSS for main area page
2
- * { font-family: verdana }
2
+ body { font-family: verdana }
@@ -1,2 +1,2 @@
1
1
  # CSS for main area page
2
- * { font-family: verdana }
2
+ body { font-family: verdana }
@@ -33,7 +33,7 @@ module RuneBlog::Helpers
33
33
  def copy_data(tag, dest)
34
34
  data = RuneBlog::Path + "/../data" # files kept inside gem
35
35
  case tag
36
- when :config; files = %w[ROOT VIEW EDITOR]
36
+ when :config; files = %w[ROOT VIEW EDITOR universal.lt3]
37
37
  end
38
38
  files.each {|file| copy(data + "/" + file, dest) }
39
39
  end
@@ -10,7 +10,6 @@ module RuneBlog::REPL
10
10
  def edit_file(file)
11
11
  result = system!("#{@blog.editor} #{file}")
12
12
  raise EditorProblem(file) unless result
13
- sleep 0.1
14
13
  cmd_clear(nil)
15
14
  end
16
15
 
@@ -23,8 +22,8 @@ module RuneBlog::REPL
23
22
  end
24
23
 
25
24
  def cmd_clear(arg, testing = false)
26
- STDSCR.cwin.clear
27
- STDSCR.cwin.refresh
25
+ # STDSCR.rows.times { puts " "*(STDSCR.cols-1) }
26
+ STDSCR.clear
28
27
  end
29
28
 
30
29
  def cmd_version(arg, testing = false)
@@ -38,6 +37,7 @@ module RuneBlog::REPL
38
37
  list = ["global.lt3 Global configuration",
39
38
  "blog/generate.lt3 Generator for view (usu not edited)",
40
39
  ".... head.lt3 HEAD info for view",
40
+ ".... banner.lt3 banner description",
41
41
  ".... index.lt3 User-edited detail for view",
42
42
  ".... post_entry.lt3 Generator for post entry in recent-posts",
43
43
  "etc/blog.css.lt3 Global CSS",
@@ -47,10 +47,11 @@ module RuneBlog::REPL
47
47
  ".... index.lt3 Content for post",
48
48
  ".... permalink.lt3 Generator for permalink"]
49
49
 
50
- name = ["global.lt3", "blog/generate.lt3", "blog/head.lt3", "blog/index.lt3",
51
- "blog/post_entry.lt3", "etc/blog.css.lt3", "blog/externals.lt3",
52
- "post/generate.lt3", "post/head.lt3", "post/index.lt3",
53
- "post/permalink.lt3"]
50
+ name = ["global.lt3", "blog/generate.lt3", "blog/head.lt3", "blog/banner.lt3",
51
+ "blog/index.lt3", "blog/post_entry.lt3", "etc/blog.css.lt3",
52
+ "blog/externals.lt3", "post/generate.lt3", "post/head.lt3",
53
+ "post/index.lt3", "post/permalink.lt3"]
54
+
54
55
  dir = @blog.view.dir/"themes/standard/"
55
56
  num, str = STDSCR.menu(title: "Edit file:", items: list)
56
57
  target = name[num]
@@ -37,7 +37,8 @@ class RuneBlog
37
37
  include Helpers
38
38
  end
39
39
 
40
- attr_reader :root, :views, :sequence, :editor
40
+ attr_reader :views, :sequence
41
+ attr_accessor :root, :editor
41
42
  attr_accessor :view # overridden
42
43
 
43
44
  attr_accessor :post_views, :post_tags, :dirty_views
@@ -2,7 +2,7 @@
2
2
  if ! (Object.constants.include?(:RuneBlog) && RuneBlog.constants.include?(:Path))
3
3
 
4
4
  class RuneBlog
5
- VERSION = "0.2.78"
5
+ VERSION = "0.2.79"
6
6
 
7
7
  path = Gem.find_files("runeblog").grep(/runeblog-/).first
8
8
  Path = File.dirname(path)
@@ -20,8 +20,8 @@ spec = Gem::Specification.new do |s|
20
20
  s.authors = ["Hal Fulton"]
21
21
  s.email = 'rubyhacker@gmail.com'
22
22
  s.executables << "blog"
23
- s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.95'
24
- s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.16'
23
+ s.add_runtime_dependency 'livetext', '~> 0.8', '>= 0.8.96'
24
+ s.add_runtime_dependency 'rubytext', '~> 0.1', '>= 0.1.18'
25
25
 
26
26
  s.add_development_dependency 'minitest', '~> 5.10', '>= 5.10.0'
27
27
 
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.2.78
4
+ version: 0.2.79
5
5
  platform: ruby
6
6
  authors:
7
7
  - Hal Fulton
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-12-11 00:00:00.000000000 Z
11
+ date: 2019-12-12 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: livetext
@@ -19,7 +19,7 @@ dependencies:
19
19
  version: '0.8'
20
20
  - - ">="
21
21
  - !ruby/object:Gem::Version
22
- version: 0.8.95
22
+ version: 0.8.96
23
23
  type: :runtime
24
24
  prerelease: false
25
25
  version_requirements: !ruby/object:Gem::Requirement
@@ -29,7 +29,7 @@ dependencies:
29
29
  version: '0.8'
30
30
  - - ">="
31
31
  - !ruby/object:Gem::Version
32
- version: 0.8.95
32
+ version: 0.8.96
33
33
  - !ruby/object:Gem::Dependency
34
34
  name: rubytext
35
35
  requirement: !ruby/object:Gem::Requirement
@@ -39,7 +39,7 @@ dependencies:
39
39
  version: '0.1'
40
40
  - - ">="
41
41
  - !ruby/object:Gem::Version
42
- version: 0.1.16
42
+ version: 0.1.18
43
43
  type: :runtime
44
44
  prerelease: false
45
45
  version_requirements: !ruby/object:Gem::Requirement
@@ -49,7 +49,7 @@ dependencies:
49
49
  version: '0.1'
50
50
  - - ">="
51
51
  - !ruby/object:Gem::Version
52
- version: 0.1.16
52
+ version: 0.1.18
53
53
  - !ruby/object:Gem::Dependency
54
54
  name: minitest
55
55
  requirement: !ruby/object:Gem::Requirement
@@ -85,6 +85,7 @@ files:
85
85
  - data/EDITOR
86
86
  - data/ROOT
87
87
  - data/VIEW
88
+ - data/universal.lt3
88
89
  - empty_view/assets/austin-pano.jpg
89
90
  - empty_view/assets/sky2.jpg
90
91
  - empty_view/remote/assets/GIT_IS_DUMB
@@ -103,6 +104,7 @@ files:
103
104
  - empty_view/themes/standard/banner/faq.lt3
104
105
  - empty_view/themes/standard/banner/list.data
105
106
  - empty_view/themes/standard/banner/top.html
107
+ - empty_view/themes/standard/blog/banner.lt3
106
108
  - empty_view/themes/standard/blog/generate.lt3
107
109
  - empty_view/themes/standard/blog/head.lt3
108
110
  - empty_view/themes/standard/blog/index.lt3
@@ -180,7 +182,6 @@ files:
180
182
  - lib/exper/fbtw.rb
181
183
  - lib/exper/gen_svg.rb
182
184
  - lib/exper/s2.html
183
- - lib/exper/univ.lt3
184
185
  - lib/exper/varmint.rb
185
186
  - lib/global.rb
186
187
  - lib/helpers-blog.rb