Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Branch: master
Fetching contributors…

Cannot retrieve contributors at this time

38 lines (32 sloc) 0.954 kB
require "rubygems" unless defined?(Gem)
begin
require "pry-editline"
rescue LoadError
end
Pry.config.history.file =
if defined?(Homebrew)
HOMEBREW_REPOSITORY.join("Meta/irb_history")
elsif defined?(Bundler)
Bundler.tmp.parent.join("history")
else
File.expand_path("~/.history/irb")
end
Pry.config.prompt_name =
if defined?(Homebrew)
"brew"
elsif defined?(Rails)
Rails.application.class.parent_name
elsif defined?(Bundler)
Bundler.root
else
"pry"
end.to_s.downcase.slice(0..7)
version = RUBY_VERSION >= "2.1" ? RUBY_VERSION : "#{RUBY_VERSION}p#{RUBY_PATCHLEVEL}"
Pry.config.prompt = [
lambda { |obj, nest, pry|
"[#{pry.input_array.size}] #{version} #{Pry.config.prompt_name}(#{Pry.view_clip(obj)})#{":#{nest}" unless nest.zero?}> "
},
lambda { |obj, nest, pry|
"[#{pry.input_array.size}] #{version} #{Pry.config.prompt_name}(#{Pry.view_clip(obj)})#{":#{nest}" unless nest.zero?}* "
}
]
Jump to Line
Something went wrong with that request. Please try again.