Sha256: fd87d082d790365cf59ce7ef0f396b97c2ffb8fa7fa5f2513e875495b0fd83d3
Contents?: true
Size: 563 Bytes
Versions: 12
Compression:
Stored size: 563 Bytes
Contents
require 'find' class Hobo::Generator < Rails::Generator::Base def with_source_in(path) root = source_path(path) Find.find(root) do |f| Find.prune if File.basename(f) == ".svn" full_path = f[(source_root.length)..-1] rel_path = f[(root.length)..-1] yield full_path, rel_path end end def create_all(m, src, dest) with_source_in(src) do |full, rel| if File.directory?(source_path(full)) m.directory File.join(dest, rel) else m.file full, File.join(dest, rel) end end end end
Version data entries
12 entries across 12 versions & 1 rubygems