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-1.8.12.travis.1135.9 lib/travis/cli/console.rb
travis-1.8.12.travis.1125.9 lib/travis/cli/console.rb
travis-1.8.12.pre.rc1 lib/travis/cli/console.rb
travis-1.8.12.travis.1116.9 lib/travis/cli/console.rb
travis-1.8.12.travis.1111.9 lib/travis/cli/console.rb
travis-1.8.12.travis.1101.9 lib/travis/cli/console.rb
travis-1.8.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1098.9 lib/travis/cli/console.rb
travis-1.8.11.travis.1081.9 lib/travis/cli/console.rb
travis-1.8.11.travis.1059.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1058.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1056.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1051.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1048.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1044.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1041.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1040.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1026.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1025.11 lib/travis/cli/console.rb
travis-1.8.11.travis.1024.11 lib/travis/cli/console.rb