Sha256: a47b41f658f3a512ff29d4e695dc5446ec1c10dbee2ab1fa0de73fa74fb0928a

Contents?: true

Size: 535 Bytes

Versions: 5

Compression:

Stored size: 535 Bytes

Contents

module Vimpack
  module Commands
    class Init < Command
      def initialize_commands
        die!("init takes a single optional argument") if @commands.size > 1
        @repo_url = @commands.size == 1 ? @commands[0] : nil
      end

      def run
        say(start_message)
        Vimpack::Models::Repo.initialize!(@repo_url)
        say('vimpack initialized!')
      end

      private

        def start_message
          " * initializing vimpack repo#{@repo_url.nil? ? '' : " from #{@repo_url}"}"
        end

    end
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

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