Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- module Skimmer
- def self.locate_html
- html_file_paths = []
- html_include_paths = []
- Find.find(Dir.pwd) do |path|
- if FileTest.directory?(path)
- if File.basename(path) == "build"
- Find.prune
- else
- next
- end
- else
- html_file_paths << path if path =~ /.*\/[^_][^\/]*\.html$/
- html_include_paths << path if path =~ /.*\/[_][^\/]*\.html$/
- end
- end
- [html_file_paths,html_include_paths]
- end
- def self.init_build(html_array)
- if Dir.exists?('build')
- Find.find("#{Dir.pwd}/build/") do |path|
- File.delete(path) if path =~ /.*\.html$/
- end
- else
- Dir.mkdir 'build'
- end
- puts html_array[0]
- html_array[0].each do |page|
- puts page.inspect
- FileUtils.cp(page,"#{Dir.pwd}/build/")
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement