Sha256: 376b4da9762fe97a875df094c660a40edb10efa2879b800e0f10e1fdd1fcedfe

Contents?: true

Size: 1 KB

Versions: 27

Compression:

Stored size: 1 KB

Contents

require 'rails/generators'

module Enjoy
  class CapifyGenerator < Rails::Generators::Base
    argument :kind, type: :string
    argument :port, type: :string
    argument :domain, type: :string

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

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

    def deploy_to
      if kind == 'data'
        "/data/#{app_name.downcase}/app"
      else
        "/home/#{app_name.downcase}/www/#{app_name.downcase}"
      end
    end
    def tmp_path
      if kind == 'data'
        "/data/#{app_name.downcase}/tmp_dump"
      else
        "/home/#{app_name.downcase}/www/#{app_name.downcase}/tmp_dump"
      end
    end

    desc 'Enjoy capistrano setup generator'
    def install
      copy_file "Capfile", "Capfile"
      template "unicorn.erb", "config/unicorn/production.rb"
      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

27 entries across 27 versions & 1 rubygems

Version Path
enjoy_cms-0.3.7.4 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.7.3 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.7.2 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.7.1 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.7 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.6.2 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.6.1 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.6 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.5 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.4 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.3 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.2.1 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.2 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.1.2 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.1.1 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.1 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.0.4 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.0.3 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.3.0.2 lib/generators/enjoy/capify_generator.rb
enjoy_cms-0.2.1 lib/generators/enjoy/capify_generator.rb