Class: Plasmoid::RubyGenerator

Inherits:
Generator show all
Defined in:
lib/plasmoid/ruby_generator.rb

Instance Attribute Summary

Attributes inherited from Generator

#description, #homepage, #options, #project_name, #summary, #target_dir, #user_email, #user_name

Instance Method Summary collapse

Methods inherited from Generator

#create_version_control, #initialize, #run, run!

Methods included from Generator::TemplateHelper

included, #mkdir, #prefix_dir, #render_template, #template_dir, #write_template

Constructor Details

This class inherits a constructor from Plasmoid::Generator

Instance Method Details

#create_filesObject



3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/plasmoid/ruby_generator.rb', line 3

def create_files
  puts "Creating files in #{target_dir}"
  FileUtils.mkpath(target_dir)

  Find.find(template_dir) do |path|
    dest = path.sub(template_dir, "")

    next if path =~ /^\.+$/ || dest.empty? || path =~ /~$/
    if File.directory?(path)
      mkdir(dest)
    else
      write_template(dest, dest)
    end
  end
end