Sha256: cea47138ea585e7a74a27e2d2d4bb11bbfe34a6958c38723fecdab3af59f7941

Contents?: true

Size: 924 Bytes

Versions: 1

Compression:

Stored size: 924 Bytes

Contents

require "thor"
require "fileutils"
require File.dirname(__FILE__) + '/util'

module Gator
  class Project < Thor
    include Thor::Actions

    def self.source_root
      Gator::Util.project_template_root
    end

    desc "project install DIRECTORY TEMPLATE_NAME", "Install a project template."
    def install( dir, template )
      empty_directory template_dir(template)
      FileUtils.cp_r File.expand_path( dir ), template_dir(template)
    end

    desc "project uninstall TEMPLATE_NAME", "Uninstall a project template."
    def uninstall( template )
      FileUtils.rm_r template_dir(template)
    end

    desc "project new DIRECTORY TEMPLATE_NAME", "Create a new project by template."
    def new( dir, template )
      directory template_dir(template), File.expand_path( dir )
    end

    private

    def template_dir( template )
      File.join( Gator::Util.project_template_root, template )
    end

  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
gator-0.0.6.pre lib/gator/project.rb