Class: Generators::InstanceGenerator

Inherits:
Rails::Generators::AppBase
  • Object
show all
Defined in:
lib/generators/instance_generator.rb

Instance Method Summary collapse

Instance Method Details

#copy_filesObject



12
13
14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/generators/instance_generator.rb', line 12

def copy_files
  path = source_paths[0]
  path_length = path.length + 1
  Dir.glob(path + "/**/*", File::FNM_DOTMATCH).each do |file|
    next if File.directory?(file)
    path = file[path_length..-1]
    template path, "#{app_path}/#{path}"
  end

  File.chmod 0755, "#{app_path}/bin/rails"
  File.chmod 0755, "#{app_path}/bin/setup"

  empty_directory_with_keep_file "#{app_path}/tmp/pids"
end

#nameObject



27
28
29
# File 'lib/generators/instance_generator.rb', line 27

def name
  File.basename(app_path)
end