moft 1.0.3 → 1.0.4
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.
- data/lib/moft/commands/build.rb +3 -1
- data/lib/moft/convertible.rb +2 -5
- data/moft.gemspec +1 -1
- metadata +1 -1
data/lib/moft/commands/build.rb
CHANGED
@@ -32,7 +32,9 @@ module Moft
|
|
32
32
|
# Returns nothing.
|
33
33
|
def self.watch(site, options)
|
34
34
|
require 'directory_watcher'
|
35
|
-
|
35
|
+
Moft::Logger.info "Move to Source:", options['source']
|
36
|
+
Dir.chdir(options['source'])
|
37
|
+
|
36
38
|
source = options['source']
|
37
39
|
destination = options['destination']
|
38
40
|
|
data/lib/moft/convertible.rb
CHANGED
@@ -27,12 +27,10 @@ module Moft
|
|
27
27
|
#
|
28
28
|
# Returns nothing.
|
29
29
|
def read_yaml(base, name)
|
30
|
-
|
31
30
|
begin
|
32
31
|
self.content = File.read(File.join(base, name))
|
33
|
-
|
34
32
|
if self.content =~ /\A(---\s*\n.*?\n?)^(---\s*$\n?)/m
|
35
|
-
self.content = $
|
33
|
+
self.content = $'
|
36
34
|
self.data = YAML.safe_load($1)
|
37
35
|
end
|
38
36
|
rescue SyntaxError => e
|
@@ -40,6 +38,7 @@ module Moft
|
|
40
38
|
rescue Exception => e
|
41
39
|
puts "Error reading file #{File.join(base, name)}: #{e.message}"
|
42
40
|
end
|
41
|
+
|
43
42
|
self.data ||= {}
|
44
43
|
end
|
45
44
|
|
@@ -122,8 +121,6 @@ module Moft
|
|
122
121
|
info = { :filters => [Moft::Filters], :registers => { :site => self.site, :page => payload['page'] } }
|
123
122
|
|
124
123
|
# render and transform content (this becomes the final content of the object)
|
125
|
-
payload["pygments_prefix"] = converter.pygments_prefix
|
126
|
-
payload["pygments_suffix"] = converter.pygments_suffix
|
127
124
|
|
128
125
|
self.content = self.render_liquid(self.content,
|
129
126
|
payload.merge({:file => self.name}),
|
data/moft.gemspec
CHANGED