syntropy 0.38.0 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/syntropy/app.rb +19 -1
- data/lib/syntropy/controller_extensions.rb +3 -22
- data/lib/syntropy/module_loader.rb +0 -8
- data/lib/syntropy/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: 1ec61f53807ee4049d4c5e04ae42f66f3b4824733a04cad245d150a0c72f0acc
|
|
4
|
+
data.tar.gz: ee5b563302d15d6a8d58fc7460636b5f402f726f730c42799862ceb92cafa42f
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 30d9fcc1b9d0db54e4faa8fa009e547d69e8b6b1beeb3684995b9c27c8f22ebffdffc5c3ec0000495aac235d21b6d61b8cb57a2e305941fc3ec00276c12d283c
|
|
7
|
+
data.tar.gz: 8453a4dfc06cba6e3cd741fb1260618af3825366cc937256cb0d2614c6dc520d5da983309c47010e493acbbae66d8a4cc50e898d3cc6723d9189364914c6579a
|
data/CHANGELOG.md
CHANGED
data/lib/syntropy/app.rb
CHANGED
|
@@ -25,6 +25,24 @@ module Syntropy
|
|
|
25
25
|
site_file_app(env) || default_app(env)
|
|
26
26
|
end
|
|
27
27
|
|
|
28
|
+
BUILTIN_APPLET_app_root = File.expand_path(File.join(__dir__, 'applets/builtin'))
|
|
29
|
+
|
|
30
|
+
# Creates a builtin applet with the given environment hash. By default the
|
|
31
|
+
# builtin applet is mounted at /.syntropy.
|
|
32
|
+
#
|
|
33
|
+
# @param env [Hash] app environment
|
|
34
|
+
# @param mount_path [String] mount path for the builtin applet
|
|
35
|
+
# @return [Syntropy::App] applet
|
|
36
|
+
def builtin_applet(env, mount_path: '/.syntropy')
|
|
37
|
+
new(
|
|
38
|
+
machine: env[:machine],
|
|
39
|
+
app_root: BUILTIN_APPLET_app_root,
|
|
40
|
+
mount_path: mount_path,
|
|
41
|
+
builtin_applet_path: nil,
|
|
42
|
+
watch_files: nil
|
|
43
|
+
)
|
|
44
|
+
end
|
|
45
|
+
|
|
28
46
|
private
|
|
29
47
|
|
|
30
48
|
# Creates a multi-hostname app if a _site.rb file is detected.
|
|
@@ -171,7 +189,7 @@ module Syntropy
|
|
|
171
189
|
# @return [void]
|
|
172
190
|
def mount_builtin_applet
|
|
173
191
|
path = @env[:builtin_applet_path]
|
|
174
|
-
@builtin_applet ||=
|
|
192
|
+
@builtin_applet ||= App.builtin_applet(@env, mount_path: path)
|
|
175
193
|
@routing_tree.mount_applet(path, @builtin_applet)
|
|
176
194
|
end
|
|
177
195
|
|
|
@@ -46,15 +46,14 @@ module Syntropy
|
|
|
46
46
|
|
|
47
47
|
# Returns a list of parsed markdown pages at the given path.
|
|
48
48
|
#
|
|
49
|
-
# @param env [Hash] app environment hash
|
|
50
49
|
# @param ref [String] directory path
|
|
51
50
|
# @return [Array<Hash>] array of page entries
|
|
52
|
-
def page_list(
|
|
53
|
-
full_path = File.join(env[:app_root], ref)
|
|
51
|
+
def page_list(ref)
|
|
52
|
+
full_path = File.join(@env[:app_root], ref)
|
|
54
53
|
raise 'Not a directory' if !File.directory?(full_path)
|
|
55
54
|
|
|
56
55
|
Dir[File.join(full_path, '*.md')].sort.map {
|
|
57
|
-
atts, markdown = Syntropy::Markdown.parse(it, env)
|
|
56
|
+
atts, markdown = Syntropy::Markdown.parse(it, @env)
|
|
58
57
|
{ atts:, markdown: }
|
|
59
58
|
}
|
|
60
59
|
end
|
|
@@ -66,24 +65,6 @@ module Syntropy
|
|
|
66
65
|
Syntropy::App.new(**)
|
|
67
66
|
end
|
|
68
67
|
|
|
69
|
-
BUILTIN_APPLET_app_root = File.expand_path(File.join(__dir__, 'applets/builtin'))
|
|
70
|
-
|
|
71
|
-
# Creates a builtin applet with the given environment hash. By default the
|
|
72
|
-
# builtin applet is mounted at /.syntropy.
|
|
73
|
-
#
|
|
74
|
-
# @param env [Hash] app environment
|
|
75
|
-
# @param mount_path [String] mount path for the builtin applet
|
|
76
|
-
# @return [Syntropy::App] applet
|
|
77
|
-
def builtin_applet(env, mount_path: '/.syntropy')
|
|
78
|
-
app(
|
|
79
|
-
machine: env[:machine],
|
|
80
|
-
app_root: BUILTIN_APPLET_app_root,
|
|
81
|
-
mount_path: mount_path,
|
|
82
|
-
builtin_applet_path: nil,
|
|
83
|
-
watch_files: nil
|
|
84
|
-
)
|
|
85
|
-
end
|
|
86
|
-
|
|
87
68
|
private
|
|
88
69
|
|
|
89
70
|
# Finds sites in the root directory for the given environment hash, adds
|
|
@@ -243,14 +243,6 @@ module Syntropy
|
|
|
243
243
|
|
|
244
244
|
attr_reader :__export_value__, :__dependencies__
|
|
245
245
|
|
|
246
|
-
# Returns a list of pages found at the given ref.
|
|
247
|
-
#
|
|
248
|
-
# @param ref [String] directory reference
|
|
249
|
-
# @return [Array] array of pages found in directory
|
|
250
|
-
def page_list(ref)
|
|
251
|
-
Syntropy.page_list(@env, ref)
|
|
252
|
-
end
|
|
253
|
-
|
|
254
246
|
# Returns true if the module is a collection module. See also
|
|
255
247
|
# #collection_module!
|
|
256
248
|
#
|
data/lib/syntropy/version.rb
CHANGED