Sha256: 997b3b63780dccd8c1464a6d935cd4a2780e009d0a73cf8b1e724531099212db

Contents?: true

Size: 428 Bytes

Versions: 2

Compression:

Stored size: 428 Bytes

Contents

module GeneratorHelper
  def file_tree_info(root)
    Dir["#{root}/**/*"].sort_by{|name| name.sub(root, '') }.map do |name|
      hash = {name: name.sub(root, ''), is_directory: File.directory?(name)}
      hash[:size] = File.stat(name).size unless hash[:is_directory]
      hash
    end
  end

  def template_file_size(root_directory, file)
    File.size(File.join(generators_path, root_directory, 'templates', file))
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
howitzer-1.0.2 spec/support/generator_helper.rb
howitzer-1.0.1 spec/support/generator_helper.rb