Sha256: dc4fcfd6a46bb6909153091cce612b8fdc5d7b6bd7ff940b535a06bdc85ce5ba

Contents?: true

Size: 958 Bytes

Versions: 23

Compression:

Stored size: 958 Bytes

Contents

# coding: utf-8
# frozen_string_literal: true

require 'thor/group'

module Stealth
  module Generators
    class Builder < Thor::Group
      include Thor::Actions

      argument :name

      def self.source_root
        File.dirname(__FILE__) + "/builder"
      end

      def create_bot_directory
        empty_directory(name)
      end

      def create_bot_structure
        directory('bot', "#{name}/bot")
        directory('config', "#{name}/config")
        directory('db', "#{name}/db")

        # Miscellaneous Files
        copy_file "config.ru", "#{name}/config.ru"
        copy_file "Rakefile", "#{name}/Rakefile"
        copy_file "Gemfile", "#{name}/Gemfile"
        copy_file "README.md", "#{name}/README.md"
        copy_file "Procfile.dev", "#{name}/Procfile.dev"
        copy_file ".gitignore", "#{name}/.gitignore"
      end

      def change_directory_bundle
        puts run("cd #{name} && bundle install")
      end

    end
  end
end

Version data entries

23 entries across 23 versions & 1 rubygems

Version Path
stealth-2.0.0.beta7 lib/stealth/generators/builder.rb
stealth-2.0.0.beta6 lib/stealth/generators/builder.rb
stealth-2.0.0.beta5 lib/stealth/generators/builder.rb
stealth-2.0.0.beta4 lib/stealth/generators/builder.rb
stealth-2.0.0.beta3 lib/stealth/generators/builder.rb
stealth-2.0.0.beta2 lib/stealth/generators/builder.rb
stealth-2.0.0.beta1 lib/stealth/generators/builder.rb
stealth-1.1.6 lib/stealth/generators/builder.rb
stealth-1.1.5 lib/stealth/generators/builder.rb
stealth-1.1.4 lib/stealth/generators/builder.rb
stealth-1.1.3 lib/stealth/generators/builder.rb
stealth-1.1.2 lib/stealth/generators/builder.rb
stealth-1.1.1 lib/stealth/generators/builder.rb
stealth-1.1.0 lib/stealth/generators/builder.rb
stealth-1.1.0.rc3 lib/stealth/generators/builder.rb
stealth-1.1.0.rc2 lib/stealth/generators/builder.rb
stealth-1.1.0.rc1 lib/stealth/generators/builder.rb
stealth-1.0.4 lib/stealth/generators/builder.rb
stealth-1.0.3 lib/stealth/generators/builder.rb
stealth-1.0.2 lib/stealth/generators/builder.rb