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

Version Path
houston-core-0.8.0.pre lib/generators/instance_generator.rb
houston-core-0.7.0 lib/generators/instance_generator.rb
houston-core-0.7.0.beta4 lib/generators/instance_generator.rb
houston-core-0.7.0.beta3 lib/generators/instance_generator.rb
houston-core-0.7.0.beta2 lib/generators/instance_generator.rb
houston-core-0.7.0.beta lib/generators/instance_generator.rb
houston-core-0.6.3 lib/generators/instance_generator.rb
houston-core-0.6.2 lib/generators/instance_generator.rb
houston-core-0.6.1 lib/generators/instance_generator.rb
houston-core-0.6.0 lib/generators/instance_generator.rb
houston-core-0.5.6 lib/generators/instance_generator.rb
houston-core-0.5.5 lib/generators/instance_generator.rb
houston-core-0.5.4 lib/generators/instance_generator.rb
houston-core-0.5.3 lib/generators/instance_generator.rb
houston-core-0.5.2 lib/generators/instance_generator.rb
houston-core-0.5.1 lib/generators/instance_generator.rb