runeblog 0.0.84 → 0.0.85
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/deploy.rb +1 -1
- data/lib/helpers-blog.rb +7 -3
- data/lib/post.rb +6 -6
- data/lib/repl.rb +1 -1
- data/lib/runeblog.rb +22 -22
- data/lib/version.rb +1 -1
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 08c941c930b749a00a51599199cf83f8d072d736
|
4
|
+
data.tar.gz: 341352d2e1678bc543a502b7b8abce7d32e7b0cd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9faa908cc4cda8fc8c5371378d44ddae7e0d71ba978f2cb392130763e688d3c0c5c73fc4f51a513e236edcb168fcd3124b3b25ba28c34a3372cd945a01a5fa14
|
7
|
+
data.tar.gz: 6422b5a0347c8ed089a20af0987a963f34221d738e6cf01f7d8be12c0733cdc08bd258f368c42c4d8345f0aa74de548f379dd28cf9e1d30a4d555217c18b5baa
|
data/lib/deploy.rb
CHANGED
data/lib/helpers-blog.rb
CHANGED
@@ -46,9 +46,9 @@ module RuneBlog::Helpers
|
|
46
46
|
end
|
47
47
|
|
48
48
|
def new_sequence
|
49
|
-
|
50
|
-
|
51
|
-
|
49
|
+
dump(0, "sequence")
|
50
|
+
version_info = "#{RuneBlog::VERSION}\nBlog created: #{Time.now.to_s}"
|
51
|
+
dump(version_info, "VERSION")
|
52
52
|
end
|
53
53
|
|
54
54
|
def subdirs(dir)
|
@@ -85,4 +85,8 @@ module RuneBlog::Helpers
|
|
85
85
|
puts err.backtrace
|
86
86
|
end
|
87
87
|
|
88
|
+
def dump(obj, name)
|
89
|
+
File.write(name, obj)
|
90
|
+
end
|
91
|
+
|
88
92
|
end
|
data/lib/post.rb
CHANGED
@@ -25,7 +25,7 @@ class RuneBlog::Post
|
|
25
25
|
@meta = meta
|
26
26
|
html = interpolate(template)
|
27
27
|
@draft = "#{@blog.root}/src/#@slug.lt3"
|
28
|
-
|
28
|
+
dump(html, @draft)
|
29
29
|
end
|
30
30
|
|
31
31
|
def edit
|
@@ -61,12 +61,12 @@ class RuneBlog::Post
|
|
61
61
|
|
62
62
|
def create_post_subtree(vdir)
|
63
63
|
create_dir("assets")
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
template = RuneBlog::Default::TeaserTemplate
|
64
|
+
dump(@meta.to_yaml, "metadata.yaml")
|
65
|
+
dump(@meta.teaser, "teaser.txt")
|
66
|
+
dump(@meta.remainder, "remainder.txt")
|
67
|
+
template = RuneBlog::Default::TeaserTemplate # FIXME template into custom dir?
|
68
68
|
text = interpolate(template)
|
69
|
-
|
69
|
+
dump(text, "index.html") # FIXME write_index ?
|
70
70
|
end
|
71
71
|
|
72
72
|
def make_slug(postnum = nil)
|
data/lib/repl.rb
CHANGED
data/lib/runeblog.rb
CHANGED
@@ -14,6 +14,7 @@ require 'version'
|
|
14
14
|
class RuneBlog
|
15
15
|
|
16
16
|
DotDir = ".blog"
|
17
|
+
ConfigFile = "#{DotDir}/config"
|
17
18
|
|
18
19
|
class << self
|
19
20
|
attr_accessor :blog
|
@@ -44,7 +45,7 @@ class RuneBlog
|
|
44
45
|
# What views are there? Deployment, etc.
|
45
46
|
self.class.blog = self # Weird. Like a singleton - dumbass circular dependency?
|
46
47
|
@root, @view_name, @editor =
|
47
|
-
read_config(
|
48
|
+
read_config(ConfigFile, :root, :current_view, :editor)
|
48
49
|
@views = get_views
|
49
50
|
@view = str2view(@view_name)
|
50
51
|
@sequence = get_sequence
|
@@ -82,18 +83,17 @@ class RuneBlog
|
|
82
83
|
end
|
83
84
|
|
84
85
|
def next_sequence
|
85
|
-
|
86
|
+
dump(@sequence += 1, "#@root/sequence")
|
86
87
|
@sequence
|
87
88
|
end
|
88
89
|
|
89
|
-
def viewdir(v)
|
90
|
+
def viewdir(v = nil)
|
91
|
+
v ||= @view
|
90
92
|
@root + "/views/#{v}/"
|
91
93
|
end
|
92
94
|
|
93
95
|
def self.exist?
|
94
|
-
|
95
|
-
File.directory?(DotDir) &&
|
96
|
-
File.exist?(DotDir + "/config")
|
96
|
+
Dir.exist?(DotDir) && File.exist?(ConfigFile)
|
97
97
|
end
|
98
98
|
|
99
99
|
def create_view(arg)
|
@@ -104,17 +104,15 @@ class RuneBlog
|
|
104
104
|
create_dir(dir)
|
105
105
|
up = Dir.pwd
|
106
106
|
Dir.chdir(dir)
|
107
|
+
x = RuneBlog::Default
|
107
108
|
create_dir('custom')
|
108
109
|
create_dir('assets')
|
109
|
-
|
110
|
-
|
111
|
-
|
112
|
-
|
113
|
-
|
114
|
-
|
115
|
-
RuneBlog::Default::PostTemplate)
|
116
|
-
File.write("last_deployed",
|
117
|
-
"Initial creation")
|
110
|
+
# FIXME dump method??
|
111
|
+
dump("", "deploy")
|
112
|
+
dump(x::BlogHeader, "custom/blog_header.html")
|
113
|
+
dump(x::BlogTrailer, "custom/blog_trailer.html")
|
114
|
+
dump(x::PostTemplate, "custom/post_template.html")
|
115
|
+
dump("Initial creation", "last_deployed")
|
118
116
|
Dir.chdir(up)
|
119
117
|
@views << RuneBlog::View.new(arg)
|
120
118
|
end
|
@@ -127,10 +125,9 @@ class RuneBlog
|
|
127
125
|
end
|
128
126
|
|
129
127
|
def view_files
|
130
|
-
vdir = @blog.viewdir
|
131
|
-
# meh
|
128
|
+
vdir = @blog.viewdir
|
132
129
|
files = ["#{vdir}/index.html"]
|
133
|
-
files +=
|
130
|
+
files += posts.map {|x| "#{vdir}/#{x}" }
|
134
131
|
# Huh?
|
135
132
|
files.reject! {|f| File.mtime(f) < File.mtime("#{vdir}/last_deployed") }
|
136
133
|
end
|
@@ -207,10 +204,13 @@ class RuneBlog
|
|
207
204
|
vdir = self.viewdir(view)
|
208
205
|
dir = vdir + @meta.slug + "/"
|
209
206
|
create_dir(dir + "assets")
|
210
|
-
|
211
|
-
|
212
|
-
|
213
|
-
|
207
|
+
Dir.chdir(dir) do
|
208
|
+
dump(@meta.to_yaml, "metadata.yaml")
|
209
|
+
# FIXME make get_post_template method
|
210
|
+
template = File.read("#{vdir}/custom/post_template.html")
|
211
|
+
post = interpolate(template)
|
212
|
+
dump(post, "index.html")
|
213
|
+
end
|
214
214
|
generate_index(view)
|
215
215
|
rescue => err
|
216
216
|
error(err)
|
data/lib/version.rb
CHANGED