Sha256: 671641dae782a5b7aca839cbfd8e2ed330038fc26cf15ef7845b08e8703f106f

Contents?: true

Size: 755 Bytes

Versions: 1

Compression:

Stored size: 755 Bytes

Contents

require 'commander'

module Barman
  class CLI
    include Commander::Methods

    def run
      program :name, "barman"
      program :version, Barman::VERSION
      program :description, "Formulates and serves your project behind the bar."

      command :new do |c|
        c.syntax = "barman new [qa|rails]"
        c.description = "creates the base of your project"
        c.action do |args, options|
          create_project(args, options)
        end
      end

      run!
    end

    private

    def create_project(args, options)
      project_type = args.shift
      project_name = args.shift
      ProjectGenerator.new(project_type, project_name, options).generate!
    rescue NotImplementedError => e
      abort e.message
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
barman-0.1.1 lib/barman/cli.rb