Sha256: 83bb8742d9f3b4886b8f2873c11f0aee99c50a111f76ed3b30eb061428cb656b

Contents?: true

Size: 907 Bytes

Versions: 3

Compression:

Stored size: 907 Bytes

Contents

require 'active_support/all'
require 'securerandom'

module Allen
  class Cli < Thor
    include Thor::Actions

    attr_reader :name
    source_paths << File.expand_path("../../../templates",__FILE__)

    desc "new ClientName", "Initialize an Umbraco project"
    def new(name)
      @name = File.basename(File.expand_path(name)).gsub(/\W/, '_').squeeze('_').camelize
      self.destination_root = File.join(File.dirname(File.expand_path(name)), @name)

      empty_directory destination_root

      @umbraco_guid = guid
      @umbraco_assembly_guid = guid.downcase
      @umbraco_extensions_guid = guid
      @umbraco_extensions_assembly_guid = guid.downcase

      directory 'src'
      template  '.gitignore'
      template  'README.md.tt'
      template  'Rakefile.tt'
      template  'Gemfile'
    end

    no_tasks do
      def guid
        SecureRandom.uuid.to_s.upcase
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
allen-0.1.3 lib/allen/cli.rb
allen-0.1.2 lib/allen/cli.rb
allen-0.1.1 lib/allen/cli.rb