Sha256: 407e76380de8fba39ecd6a5dd7f76a10b6b1c17edf620abb91850d1e2cf414d5

Contents?: true

Size: 588 Bytes

Versions: 28

Compression:

Stored size: 588 Bytes

Contents

require 'find'
require "rails_generator"

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

28 entries across 28 versions & 1 rubygems

Version Path
hobo-1.1.0 lib/hobo/generator.rb
hobo-1.0.3 lib/hobo/generator.rb
hobo-1.1.0.pre4 lib/hobo/generator.rb
hobo-1.1.0.pre3 lib/hobo/generator.rb
hobo-1.1.0.pre2 lib/hobo/generator.rb
hobo-1.1.0.pre0 lib/hobo/generator.rb
hobo-1.0.2 lib/hobo/generator.rb
hobo-1.0.1 lib/hobo/generator.rb
hobo-1.0.0 lib/hobo/generator.rb
hobo-0.9.106 lib/hobo/generator.rb
hobo-0.9.105 lib/hobo/generator.rb
hobo-0.9.104 lib/hobo/generator.rb
hobo-0.9.103 lib/hobo/generator.rb
hobo-0.9.102 lib/hobo/generator.rb
hobo-0.9.101 lib/hobo/generator.rb
hobo-0.9.100 lib/hobo/generator.rb
hobo-0.9.0 lib/hobo/generator.rb
hobo-0.8.10 lib/hobo/generator.rb
hobo-0.8.9 lib/hobo/generator.rb
hobo-0.8.8 lib/hobo/generator.rb