Sha256: 3a92d1c59935b2a12f1b2eea0c8d7462b3f87ebde05641181e4af84fec8d7f9a

Contents?: true

Size: 815 Bytes

Versions: 6

Compression:

Stored size: 815 Bytes

Contents

require 'cuken/api/aruba'
World(Cuken::Api::Aruba::Api)
module ::Cuken
  module Api
    module Common

      def with_args(*args)
        backup = ARGV.dup
        begin
          ARGV.replace(args)
          yield
        rescue Exception => e
          puts e.backtrace.join("\n") if $!.respond_to?(:status) && $!.status && $!.status > 0
        ensure
          ARGV.replace(backup)
        end
      end

      def clone_pull_error_check(res)
        if repo = res[/Could not find Repository /]
          raise RuntimeError, "Could not find Repository #{repo}", caller
        end
        if repo = res[/ERROR: (.*) doesn't exist. Did you enter it correctly?/,1]
          raise RuntimeError, "ERROR: #{repo} doesn't exist. Did you enter it correctly? #{repo}", caller
        end
      end

    end
  end
end

Version data entries

6 entries across 6 versions & 1 rubygems

Version Path
cuken-0.1.22 lib/cuken/api/common.rb
cuken-0.1.21 lib/cuken/api/common.rb
cuken-0.1.20 lib/cuken/api/common.rb
cuken-0.1.19 lib/cuken/api/common.rb
cuken-0.1.18 lib/cuken/api/common.rb
cuken-0.1.17 lib/cuken/api/common.rb