Sha256: 03379adb5c8d045b24158a90fc453d49bf50a52e1800b24a2885e8b1637c01d4
Contents?: true
Size: 774 Bytes
Versions: 16
Compression:
Stored size: 774 Bytes
Contents
require "rails" require "rails/generators" require "rails/generators/app_base" module Generators class InstanceGenerator < Rails::Generators::AppBase source_root File.expand_path("../../templates/new-instance", File.dirname(__FILE__)) argument :app_path, type: :string def copy_files copy_file ".gitignore", "#{app_path}/.gitignore" path = source_paths[0] path_length = path.length + 1 Dir.glob(path + "/**/*").each do |file| next if File.directory?(file) path = file[path_length..-1] copy_file 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 end end
Version data entries
16 entries across 16 versions & 1 rubygems