woody 0.0.13 → 0.0.14
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/woody/compiler.rb +15 -9
- data/lib/woody/generator.rb +0 -3
- data/lib/woody/version.rb +1 -1
- data/lib/woody.rb +2 -0
- metadata +1 -1
data/lib/woody/compiler.rb
CHANGED
@@ -43,15 +43,7 @@ module Woody
|
|
43
43
|
end
|
44
44
|
|
45
45
|
# Copy over assets
|
46
|
-
|
47
|
-
next if item == '.' or item == '..'
|
48
|
-
begin
|
49
|
-
FileUtils.copy "templates/assets/#{item}", "output/assets/#{item}"
|
50
|
-
touchedfiles << "assets/#{item}"
|
51
|
-
rescue Errno::EISDIR
|
52
|
-
puts "Warning: subdirectories in templates/assets are ignored!"
|
53
|
-
end
|
54
|
-
end
|
46
|
+
copy_assets_r touchedfiles
|
55
47
|
|
56
48
|
# Update index.html
|
57
49
|
layout = File.read('templates/layout.html')
|
@@ -104,6 +96,20 @@ module Woody
|
|
104
96
|
|
105
97
|
private
|
106
98
|
|
99
|
+
# Copies custom assets to output recursively
|
100
|
+
def self.copy_assets_r(touchedfiles, subdir="")
|
101
|
+
Dir.foreach("templates/assets/#{subdir}") do |item|
|
102
|
+
next if item == '.' or item == '..'
|
103
|
+
unless File.directory?("templates/assets/#{subdir}#{item}")
|
104
|
+
FileUtils.copy "templates/assets/#{subdir}#{item}", "output/assets/#{subdir}#{item}"
|
105
|
+
touchedfiles << "assets/#{subdir}#{item}"
|
106
|
+
else
|
107
|
+
FileUtils.mkdir_p "output/assets/#{subdir}#{item}"
|
108
|
+
copy_assets_r touchedfiles, "#{subdir}#{item}/"
|
109
|
+
end
|
110
|
+
end
|
111
|
+
end
|
112
|
+
|
107
113
|
# Deletes old files from the site's output directory
|
108
114
|
# @param [Array] touchedfiles specifies which files to keep
|
109
115
|
# @param [String] subdir specifies a subdirectory of output/ to work in (used for recursion)
|
data/lib/woody/generator.rb
CHANGED
@@ -47,9 +47,6 @@ module Woody
|
|
47
47
|
|
48
48
|
private
|
49
49
|
|
50
|
-
# Path of template directory inside gem
|
51
|
-
$source_root = File.expand_path("../../templates", __FILE__)
|
52
|
-
|
53
50
|
# Creates a directory and its parents if necessary, outputting a notice to STDOUT
|
54
51
|
# @param [String] dir specifies the directory to create
|
55
52
|
def self.cdir_p(dir)
|
data/lib/woody/version.rb
CHANGED
data/lib/woody.rb
CHANGED