Sha256: 1683a94226a4cb922546304ef9183469280e896d2f7e3ca74b52e8266d09406f

Contents?: true

Size: 656 Bytes

Versions: 2

Compression:

Stored size: 656 Bytes

Contents

# -*- encoding: utf-8 -*-

require 'thor'
require 'git_shizzle'

module GitShizzle
  class Cli < Thor
    package_name 'GitShizzle'

    commands = GitShizzle::Dsl::CommandCollection.new
    commands.load

    commands.each do |command|
      desc "#{command.identifier}", "#{command.description} by index or range"
      define_method(command.identifier) do |*indexes|
        begin
          shizzle.send(:run, command.identifier, *indexes)
        rescue GitShizzle::Error => e
          puts e.message
        end
      end
    end

    private
    def shizzle
      @shizzle ||= GitShizzle::QuickGit.new
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
git_shizzle-0.2.8 lib/git_shizzle/cli.rb
git_shizzle-0.2.6 lib/git_shizzle/cli.rb