runeblog 0.2.86 → 0.2.87
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/blog +37 -9
- data/lib/runeblog_version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4d2b3a57f2fb7313fe43607e4f36e8533d588fc52384903412fa8dc6221b3de0
|
4
|
+
data.tar.gz: a5c313b268869b95886e5bfb31e8ee1d7aa960cc5cf93697a11bfaacf5923cc1
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 0a0299d5f038467742a54c128fc5694019ee84008eb03cd77be9dc15aa07706bf8dcce899d0abb098324e8673c6fcdc1036097ee215fedcce14aa9a23e27ca61
|
7
|
+
data.tar.gz: c9a49a17819683e6b69431a701039bc947e022c4b138d61273f31a4256b3c7721247dffd0fda075bba65c544debbe7e9f7e2aeaa0278a6d65e0d21650b967807
|
data/bin/blog
CHANGED
@@ -24,29 +24,57 @@ def pick_editor
|
|
24
24
|
file = `which #{name}`.chomp
|
25
25
|
end
|
26
26
|
|
27
|
+
def get_universal
|
28
|
+
univ = "#{@blog.root}/data/universal.lt3"
|
29
|
+
if yesno("Faster initial setup? (no: edit universal.lt3)")
|
30
|
+
author = ask("Author name: ")
|
31
|
+
site = ask("Site/domain: ")
|
32
|
+
# Now stash it...
|
33
|
+
str = File.read(univ)
|
34
|
+
str = str.gsub(/AUTHOR/, author)
|
35
|
+
str = str.gsub(/SITE_DOMAIN/, site)
|
36
|
+
else
|
37
|
+
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(AUTHOR.*\|SITE.*\)"'
|
38
|
+
edit_file(univ, vim: vim_params)
|
39
|
+
end
|
40
|
+
end
|
41
|
+
|
42
|
+
def get_global
|
43
|
+
if yesno("Faster view setup? (no: edit global.lt3)")
|
44
|
+
view_name = ask("\nFilename: ")
|
45
|
+
@blog.create_view(view_name) # call change_view??
|
46
|
+
title = ask("View title: ")
|
47
|
+
subtitle = ask("Subtitle : ")
|
48
|
+
gname = "#{@blog.root}/views/#{view_name}/themes/standard/global.lt3"
|
49
|
+
text = File.read(gname)
|
50
|
+
text = text.gsub(/VIEW_NAME/, view_name)
|
51
|
+
text = text.gsub(/VIEW_TITLE/, title)
|
52
|
+
text = text.gsub(/VIEW_SUBTITLE/, subtitle)
|
53
|
+
File.write(gname, text)
|
54
|
+
else
|
55
|
+
view_name = ask("\nFilename: ")
|
56
|
+
@blog.create_view(view_name) # call change_view??
|
57
|
+
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(VIEW_.*\|SITE.*\)"'
|
58
|
+
edit_file(@blog.view.dir/"themes/standard/global.lt3", vim: vim_params)
|
59
|
+
end
|
60
|
+
end
|
61
|
+
|
27
62
|
def get_started
|
28
63
|
if yesno("Do you want to qo a quick setup?")
|
29
64
|
puts " First choose your editor."
|
30
65
|
@blog.editor = pick_editor
|
31
66
|
File.write("#{@blog.root}/data/EDITOR", @blog.editor)
|
32
67
|
|
33
|
-
|
34
|
-
fname = "#{@blog.root}/data/universal.lt3"
|
35
|
-
vim_params = '-c ":set hlsearch" -c ":hi Search ctermfg=2 ctermbg=6" +/"\(AUTHOR.*\|SITE.*\)"'
|
36
|
-
edit_file(fname, vim: vim_params)
|
37
|
-
end
|
68
|
+
get_universal
|
38
69
|
# Now create a custom global.lt3
|
39
70
|
@blog._generate_global
|
40
|
-
noview = true
|
41
71
|
puts fx("\n Quick setup complete!", :bold)
|
42
72
|
if yesno("Create your first view now?")
|
43
|
-
|
44
|
-
noview = false
|
73
|
+
get_global
|
45
74
|
puts "\n View #{@blog.view} created!\n "
|
46
75
|
end
|
47
76
|
end
|
48
77
|
|
49
|
-
|
50
78
|
puts
|
51
79
|
print fx(" For help", :bold)
|
52
80
|
puts " type h or help."
|
data/lib/runeblog_version.rb
CHANGED