Sha256: a9b7bf5417eb9d481ea2c27c3f9bb34f5160cb299bc224b0e22ad416f826f455

Contents?: true

Size: 1.28 KB

Versions: 26

Compression:

Stored size: 1.28 KB

Contents

#!/usr/bin/env ruby
# encoding: utf-8

require 'thor'

module RocketCMS
  class Capify < Thor::Group
    include Thor::Actions

    no_commands do
      def load_env
        return if defined?(Rails)
        require File.expand_path("../../../config/environment", __FILE__)
      end
    end

    class_option :mongoid, default: false

    argument :app_name, type: :string
    argument :domain, type: :string
    argument :port, type: :string, optional: true

    source_root File.expand_path('../../lib/generators/rocket_cms/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 "Generate Capistrano config"
    def capify
      if options[:mongoid]
        def RocketCMS.mongoid?
          true
        end
      else
        def RocketCMS.mongoid?
          true
        end
      end
      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

RocketCMS::Capify.start

Version data entries

26 entries across 26 versions & 1 rubygems

Version Path
rocket_cms-0.37.1 bin/rocket_cms_capify
rocket_cms-0.37.0 bin/rocket_cms_capify
rocket_cms-0.36.0 bin/rocket_cms_capify
rocket_cms-0.35.0 bin/rocket_cms_capify
rocket_cms-0.34.0 bin/rocket_cms_capify
rocket_cms-0.33.1 bin/rocket_cms_capify
rocket_cms-0.33.0 bin/rocket_cms_capify
rocket_cms-0.32.0 bin/rocket_cms_capify
rocket_cms-0.31.1 bin/rocket_cms_capify
rocket_cms-0.31.0 bin/rocket_cms_capify
rocket_cms-0.30.0 bin/rocket_cms_capify
rocket_cms-0.29.0 bin/rocket_cms_capify
rocket_cms-0.28.0 bin/rocket_cms_capify
rocket_cms-0.27.8 bin/rocket_cms_capify
rocket_cms-0.27.7 bin/rocket_cms_capify
rocket_cms-0.27.6 bin/rocket_cms_capify
rocket_cms-0.27.5 bin/rocket_cms_capify
rocket_cms-0.27.4 bin/rocket_cms_capify
rocket_cms-0.27.3 bin/rocket_cms_capify
rocket_cms-0.27.2 bin/rocket_cms_capify