Sha256: 773b901e9d281c5c328e79c00a2b28b51817a6caac723174eb4718a3def5a294

Contents?: true

Size: 813 Bytes

Versions: 5

Compression:

Stored size: 813 Bytes

Contents

module Vimpack
  module Commands
    class Git < Command
      SUB_COMMANDS = %w{ publish }

      def initialize_commands
        die!("git requires at least one argument") if @commands.size < 1
        @subcommand = @commands.shift
      end

      def run
        return git_exec unless SUB_COMMANDS.include?(@subcommand)
        send("git_#{@subcommand}".to_sym)
      end

      def git_publish
        say(" * publishing vimpack repo")
        Vimpack::Models::Repo.publish!(@options[:message])
        say("vimpack repo published!")
      end

      def git_exec
        say(" * running git #{@subcommand} #{@commands.join(' ')}")
        command = Vimpack::Models::Repo.git_exec(@subcommand, @commands)
        say("command complete!")
        say(command.message, :default)
      end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
vimpack-0.0.4 lib/vimpack/commands/git.rb
vimpack-0.0.3 lib/vimpack/commands/git.rb
vimpack-0.0.2 lib/vimpack/commands/git.rb
vimpack-0.0.1.1 lib/vimpack/commands/git.rb
vimpack-0.0.1 lib/vimpack/commands/git.rb