pbsimply 3.2.0 → 3.2.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/pbsimply +1 -0
- data/lib/pbsimply/docdb.rb +18 -2
- data/lib/pbsimply/docengine/pandoc.rb +3 -2
- data/lib/pbsimply/hooks.rb +4 -1
- data/lib/pbsimply.rb +14 -4
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3d16b9549a41896f788b13064b3b607d4433c005ddadba170c6a23c1aec990fb
|
4
|
+
data.tar.gz: 5343f01a9003f2e0262d3799436e9ade3532fe8001d24646a08647a8bab737de
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: e7e81643c7623fd45cbd20578a5d0c38cb73692ab721131d1d57e7a44ad84c17481784c1e7c578bd3eb21137b001d79643a874b622ff9a4010790df35950f01f
|
7
|
+
data.tar.gz: 4281c06376bc8ea4acf81ac38236a2760f5bd641f22c649c3494cec72f1a40f037f7453421ad7a6fd4943a7a2289b8c4d549c6c6a196c6d6a4f435f8e97d7de6
|
data/bin/pbsimply
CHANGED
data/lib/pbsimply/docdb.rb
CHANGED
@@ -15,13 +15,13 @@ class PBSimply
|
|
15
15
|
# Abstruct super class.
|
16
16
|
class DocDB
|
17
17
|
def dump(object)
|
18
|
-
File.open(File.join(@dir, ".indexes.#{@ext}"),
|
18
|
+
File.open(File.join(@dir, ".indexes.#{@ext}"), wmode) do |f|
|
19
19
|
f.write @store_class.dump(object)
|
20
20
|
end
|
21
21
|
end
|
22
22
|
|
23
23
|
def load
|
24
|
-
File.open(File.join(@dir, ".indexes.#{@ext}"),
|
24
|
+
File.open(File.join(@dir, ".indexes.#{@ext}"), rmode) do |f|
|
25
25
|
next @store_class.load(f)
|
26
26
|
end
|
27
27
|
end
|
@@ -38,6 +38,14 @@ class PBSimply
|
|
38
38
|
@store_class.load(@store_class.dump(frontmatter))
|
39
39
|
end
|
40
40
|
|
41
|
+
def wmode
|
42
|
+
"w"
|
43
|
+
end
|
44
|
+
|
45
|
+
def rmode
|
46
|
+
"r"
|
47
|
+
end
|
48
|
+
|
41
49
|
# Use Ruby Marshal
|
42
50
|
class Marshal < DocDB
|
43
51
|
def initialize(dir)
|
@@ -49,6 +57,14 @@ class PBSimply
|
|
49
57
|
def cmp_obj(frontmatter)
|
50
58
|
frontmatter.dup
|
51
59
|
end
|
60
|
+
|
61
|
+
def wmode
|
62
|
+
"wb"
|
63
|
+
end
|
64
|
+
|
65
|
+
def rmode
|
66
|
+
"rb"
|
67
|
+
end
|
52
68
|
end
|
53
69
|
|
54
70
|
# Use JSON with bundled library
|
@@ -56,10 +56,11 @@ class PBSimply
|
|
56
56
|
File.open(@workfile_frontmatter, "w") {|f| YAML.dump(frontmatter, f)}
|
57
57
|
|
58
58
|
# Go Pandoc
|
59
|
-
pandoc_cmdline = ["pandoc"]
|
60
|
-
pandoc_cmdline += ["-d", @workfile_pandoc_defaultfiles, "--metadata-file", @workfile_frontmatter, "-M", "title:#{frontmatter["title"]}"]
|
59
|
+
pandoc_cmdline = [(@config["pandoc_command"] || "pandoc")]
|
60
|
+
pandoc_cmdline += ["-d", @workfile_pandoc_defaultfiles, "--metadata-file", @workfile_frontmatter, "-M", "title:#{frontmatter["title"]}", "-w", "html5"]
|
61
61
|
pandoc_cmdline += ["-f", frontmatter["input_format"]] if frontmatter["input_format"]
|
62
62
|
pandoc_cmdline += [ procdoc ]
|
63
|
+
pp pandoc_cmdline if ENV["DEBUG"] == "yes"
|
63
64
|
IO.popen((pandoc_cmdline)) do |io|
|
64
65
|
doc = io.read
|
65
66
|
end
|
data/lib/pbsimply/hooks.rb
CHANGED
@@ -59,8 +59,9 @@ class PBSimply::Hooks
|
|
59
59
|
end
|
60
60
|
end
|
61
61
|
|
62
|
-
def initialize(pbsimply)
|
62
|
+
def initialize(pbsimply, config)
|
63
63
|
@pbsimply = pbsimply
|
64
|
+
@config = config
|
64
65
|
@hooks_loaded = false
|
65
66
|
|
66
67
|
# Called first phase before generate. This hooks called before blessing.
|
@@ -111,4 +112,6 @@ class PBSimply::Hooks
|
|
111
112
|
attr :delete
|
112
113
|
attr :post
|
113
114
|
attr :accs
|
115
|
+
|
116
|
+
attr :config
|
114
117
|
end
|
data/lib/pbsimply.rb
CHANGED
@@ -37,6 +37,17 @@ class PBSimply
|
|
37
37
|
# SETUP FUNCTIONS #
|
38
38
|
###############################################
|
39
39
|
|
40
|
+
def self.find_docroot
|
41
|
+
lastwd = nil
|
42
|
+
until File.exist?(".pbsimply.yaml")
|
43
|
+
Dir.chdir ".."
|
44
|
+
if lastwd == Dir.pwd
|
45
|
+
abort "PureBuilder Simply document root not found."
|
46
|
+
end
|
47
|
+
lastwd = Dir.pwd
|
48
|
+
end
|
49
|
+
end
|
50
|
+
|
40
51
|
# Load config file.
|
41
52
|
def self.load_config
|
42
53
|
config = nil
|
@@ -74,6 +85,8 @@ class PBSimply
|
|
74
85
|
DocDB::JSON.new(dir)
|
75
86
|
when "oj"
|
76
87
|
DocDB::Oj.new(dir)
|
88
|
+
when "marshal"
|
89
|
+
DocDB::Marshal.new(dir)
|
77
90
|
else
|
78
91
|
DocDB::Marshal.new(dir)
|
79
92
|
end
|
@@ -106,7 +119,7 @@ class PBSimply
|
|
106
119
|
@accs = nil
|
107
120
|
@accs_index = {}
|
108
121
|
@now = Time.now
|
109
|
-
@hooks = PBSimply::Hooks.new(self)
|
122
|
+
@hooks = PBSimply::Hooks.new(self, @config)
|
110
123
|
end
|
111
124
|
|
112
125
|
# Process command-line
|
@@ -334,9 +347,6 @@ class PBSimply
|
|
334
347
|
|
335
348
|
@accs = true if File.exist?(File.join(@dir, ".accs.yaml"))
|
336
349
|
|
337
|
-
# Check existing in indexes.
|
338
|
-
@indexes.delete_if {|k,v| ! File.exist?([@dir, k].join("/")) }
|
339
|
-
|
340
350
|
proc_dir
|
341
351
|
end
|
342
352
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: pbsimply
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 3.2.
|
4
|
+
version: 3.2.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Masaki Haruka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2024-03-30 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Pre compile, static serving website builder.
|
14
14
|
email:
|