Sha256: bdb065b042b85446b2d3c21bfb0f2ee888a60610a41d749f11425c73738101de

Contents?: true

Size: 898 Bytes

Versions: 5

Compression:

Stored size: 898 Bytes

Contents

require "happy-cli/version"
require 'thor'

module HappyCLI
  class Command < Thor
    include Thor::Actions

    source_root(File.expand_path('../happy-cli/templates', __FILE__))

    desc "new NAME", "Creates a new Happy application."

    method_option :template, :aliases => "-t", :default => "standard", :type => :string,
      :desc => "Application template to use. [standard, minimal]"

    method_option :git, :aliases => "-g", :default => false, :type => :boolean,
      :desc => "Initialize a git repository in your blog's directory."

    def new(name)
      @name = name
      self.destination_root = name
      directory options[:template], '.'

      in_root do
        if options[:git]
          run "git init"
          run "git add ."
          run "git commit -m 'Created new Happy application using the '#{options[:template]}' template'"
        end
      end
    end

  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
happy-cli-0.1.0.pre4 lib/happy-cli.rb
happy-cli-0.1.0.pre3 lib/happy-cli.rb
happy-cli-0.1.0.pre2 lib/happy-cli.rb
happy-cli-0.1.0.pre1 lib/happy-cli.rb
happy-cli-0.0.2 lib/happy-cli.rb