Sha256: b33943f0ed377485a12fb2be5fa438a878c2b8732649abf65fd70803f0fe79c2

Contents?: true

Size: 825 Bytes

Versions: 28

Compression:

Stored size: 825 Bytes

Contents

require 'rails/generators'

module RocketCms
  class CapifyGenerator < Rails::Generators::Base
    argument :domain, type: :string
    argument :port, type: :string, optional: true

    source_root File.expand_path('../templates', __FILE__)

    def app_name
      Rails.application.class.name.split("::")[0]
    end

    def deploy_to
      "/data/#{app_name.downcase}/app"
    end
    def tmp_path
      "/data/#{app_name.downcase}/tmp_dump"
    end

    desc 'RocketCMS capistrano setup generator'
    def install
      copy_file "Capfile", "Capfile"
      unless port.nil?
        template "unicorn.erb", "config/unicorn/production.rb"
      end
      template "deploy.erb", "config/deploy.rb"
      template "production.erb", "config/deploy/production.rb"
      template "dl.erb", "lib/tasks/dl.thor"
    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
rocket_cms-0.27.1 lib/generators/rocket_cms/capify_generator.rb
rocket_cms-0.27.0 lib/generators/rocket_cms/capify_generator.rb
rocket_cms-0.26.1 lib/generators/rocket_cms/capify_generator.rb
rocket_cms-0.26.0 lib/generators/rocket_cms/capify_generator.rb
rocket_cms-0.25.5 lib/generators/rocket_cms/capify_generator.rb
rocket_cms-0.25.4 lib/generators/rocket_cms/capify_generator.rb
rocket_cms-0.25.3 lib/generators/rocket_cms/capify_generator.rb
rocket_cms-0.25.1 lib/generators/rocket_cms/capify_generator.rb