Sha256: b89969ae9e7d8886c32413560780dc553dcbe2dac35744a9106832f8a2bd2f13

Contents?: true

Size: 809 Bytes

Versions: 65

Compression:

Stored size: 809 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. Try'
        $stderr.puts
        $stderr.puts '$ (sudo) gem install pry'
        false
      end
    end
  end
end

Version data entries

65 entries across 65 versions & 2 rubygems

Version Path
travis-akerl-1.8.9 lib/travis/cli/console.rb
travis-1.8.10.travis.950.11 lib/travis/cli/console.rb
travis-1.8.10.travis.948.11 lib/travis/cli/console.rb
travis-1.8.10.travis.946.11 lib/travis/cli/console.rb
travis-1.8.10.travis.944.11 lib/travis/cli/console.rb
travis-1.8.10.travis.943.11 lib/travis/cli/console.rb
travis-1.8.10.travis.942.11 lib/travis/cli/console.rb
travis-1.8.10.travis.941.11 lib/travis/cli/console.rb
travis-1.8.10.travis.940.11 lib/travis/cli/console.rb
travis-1.8.10.travis.935.11 lib/travis/cli/console.rb
travis-1.8.10.travis.933.11 lib/travis/cli/console.rb
travis-1.8.10.travis.931.11 lib/travis/cli/console.rb
travis-1.8.10.travis.930.11 lib/travis/cli/console.rb
travis-1.8.10.travis.929.11 lib/travis/cli/console.rb
travis-1.8.10.travis.927.11 lib/travis/cli/console.rb
travis-1.8.10.travis.925.11 lib/travis/cli/console.rb
travis-1.8.10.travis.924.11 lib/travis/cli/console.rb
travis-1.8.10.travis.923.11 lib/travis/cli/console.rb
travis-1.8.10.travis.922.11 lib/travis/cli/console.rb
travis-1.8.10.travis.921.11 lib/travis/cli/console.rb