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.
@@ -43,15 +43,7 @@ module Woody
43
43
  end
44
44
 
45
45
  # Copy over assets
46
- Dir.foreach("templates/assets") do |item|
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)
@@ -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
@@ -1,4 +1,4 @@
1
1
  module Woody
2
2
  # Specifies Woody gem version
3
- VERSION = "0.0.13"
3
+ VERSION = "0.0.14"
4
4
  end
data/lib/woody.rb CHANGED
@@ -17,6 +17,8 @@ $VERBOSE = oldverbosity
17
17
 
18
18
  # Woody podcast static site generator
19
19
  module Woody
20
+ # Path of template directory inside gem
21
+ $source_root = File.expand_path("../../templates", __FILE__)
20
22
 
21
23
  # Load configuration and connect to S3
22
24
  def self.init
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: woody
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.13
4
+ version: 0.0.14
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors: