1 Star 0 Fork 0

代码神童 / testWeb

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
该仓库未声明开源许可证文件(LICENSE),使用请关注具体项目描述及其代码上游依赖。
克隆/下载
pry_repl.rb 1.31 KB
一键复制 编辑 原始数据 按行查看 历史
guoGuiBiao 提交于 2017-08-15 23:36 . test ruby
require 'rubygems'
require 'pry'
require 'pry/input_completer'
require 'thread'
require 'json'
require 'pry-rails/version'
pry_rails_path = Gem.loaded_specs['pry-rails']
class PryInput
def readline(prompt)
$stdout.print prompt
$stdout.flush
$stdin.readline
end
end
class PryOutput
def print(data="")
$stdout.puts(data.gsub('`', "'"))
$stdout.flush
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
port = ENV["SUBLIMEREPL_AC_PORT"].to_i
completer = Pry::InputCompleter.new(binding)
def read_netstring(s)
size = 0
while true
ch = s.recvfrom(1)[0]
if ch == ':'
break
end
size = size * 10 + ch.to_i
end
msg = ""
while size != 0
msg += s.recvfrom(size)[0]
size -= msg.length
end
ch = s.recvfrom(1)[0]
return msg
end
ENV['RAILS_ENV'] = "development"
#APP_PATH = File.expand_path('config/application')
require_relative('config/application')
#require APP_PATH
if Rails::VERSION::MAJOR >= 3
# class Rails::Console
# end
end
ARGV.unshift "console"
$: << File.join(pry_rails_path.full_gem_path, 'lib')
require 'pry-rails'
require 'rails/commands'
Ruby
1
https://gitee.com/shentong_012/testWeb.git
git@gitee.com:shentong_012/testWeb.git
shentong_012
testWeb
testWeb
master

搜索帮助