Sha256: 7b6751d0032a8c752c2cb948a9753fdf764334ef076387f8bfbd08f44b926c7c

Contents?: true

Size: 736 Bytes

Versions: 43

Compression:

Stored size: 736 Bytes

Contents

require 'travis/cli'

module Travis
  module CLI
    class Console < ApiCommand
      description "interactive shell"
      on '-x', '--eval LINE', 'run line of ruby' do |c, line|
        c.instance_eval(line)
        exit
      end

      def run
        return unless pry_installed?

        Object.send(:include, Client::Namespace.new(session))
        hooks = defined?(Pry::Hooks) ? Pry::Hooks.new : {}
        binding.pry(:quiet => true, :prompt => Pry::SIMPLE_PROMPT, :output => $stdout, :hooks => hooks)
      end

      private

      def pry_installed?
        require 'pry'
        true
      rescue LoadError
        $stderr.puts 'You need to install pry to use Travis CLI console.'
        false
      end
    end
  end
end

Version data entries

43 entries across 43 versions & 2 rubygems

Version Path
travis-1.8.9.travis.874.3 lib/travis/cli/console.rb
travis-1.8.9.travis.867.4 lib/travis/cli/console.rb
travis-1.8.9.travis.853.4 lib/travis/cli/console.rb
travis-1.8.9.travis.844.4 lib/travis/cli/console.rb
travis-1.8.9.travis.837.4 lib/travis/cli/console.rb
travis-1.8.8 lib/travis/cli/console.rb
travis-1.8.9.travis.826.4 lib/travis/cli/console.rb
travis-1.8.7.travis.823.4 lib/travis/cli/console.rb
travis-1.8.7.travis.818.4 lib/travis/cli/console.rb
travis-1.8.7.travis.812.4 lib/travis/cli/console.rb
travis-1.8.6 lib/travis/cli/console.rb
travis-1.8.7.travis.809.4 lib/travis/cli/console.rb
travis-1.8.7.travis.808.4 lib/travis/cli/console.rb
travis-1.8.6.travis.807.4 lib/travis/cli/console.rb
travis-1.8.5 lib/travis/cli/console.rb
travis-1.8.6.travis.796.4 lib/travis/cli/console.rb
travis-1.8.5.travis.793.4 lib/travis/cli/console.rb
travis-1.8.5.travis.791.4 lib/travis/cli/console.rb
travis-1.8.5.travis.784.4 lib/travis/cli/console.rb
travis-1.8.5.travis.783.4 lib/travis/cli/console.rb