Created
November 15, 2012 19:12
-
-
Save markbates/4080572 to your computer and use it in GitHub Desktop.
SublimeREPL & Rails
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| require 'rubygems' | |
| gem 'pry' | |
| require 'pry' | |
| PWD = ENV["PWD"] | |
| env_rb = File.join(PWD, "config", "environment.rb") | |
| FileUtils.cd PWD | |
| if File.exists?(env_rb) | |
| require env_rb | |
| end | |
| class PryInput | |
| def readline(prompt) | |
| $stdout.print prompt | |
| $stdout.flush | |
| $stdin.readline | |
| end | |
| end | |
| class PryOutput | |
| def puts(data="") | |
| $stdout.puts(data.gsub('`', "'")) | |
| $stdout.flush | |
| end | |
| def to_s | |
| to_str | |
| end | |
| def to_str | |
| File.join(PWD, "log", "pry.log") | |
| end | |
| end | |
| Pry.config.input = PryInput.new() | |
| Pry.config.output = PryOutput.new() | |
| Pry.config.color = false | |
| Pry.config.editor = ARGV[0] | |
| Pry.config.auto_indent = false | |
| Pry.config.correct_indent = false | |
| Pry.start self |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment