pry

Is there a pry debug setup that works with ruby 2.0?

六月ゝ 毕业季﹏ 提交于 2019-11-30 17:20:35
I'm using ruby 2.0.0-p195 on OSX. pry-debugger does not work (step/continue/next all appear to work like continue ). Is there a pry debugging gem that works with ruby 2.0? update: pry-debugger and pry-byebug both appear to work with with ruby 2.0.0-p195 in a simple project. I have some other conflict that is causing both to fail when using binding.pry in tests... update: pry-byebug is working for me with the latest ruby 2.0 release, 2.0.0-p247, with pry-byebug 1.1.1 & byebug 1.5.0 pry-byebug 1.1.1+ works with ruby 2.0.0-p247. It's a fork of pry-debugger & works with ruby 2.0+ only. gem 'pry

Is there a pry debug setup that works with ruby 2.0?

∥☆過路亽.° 提交于 2019-11-30 16:38:17
问题 I'm using ruby 2.0.0-p195 on OSX. pry-debugger does not work (step/continue/next all appear to work like continue ). Is there a pry debugging gem that works with ruby 2.0? update: pry-debugger and pry-byebug both appear to work with with ruby 2.0.0-p195 in a simple project. I have some other conflict that is causing both to fail when using binding.pry in tests... update: pry-byebug is working for me with the latest ruby 2.0 release, 2.0.0-p247, with pry-byebug 1.1.1 & byebug 1.5.0 回答1: pry

Pry not stopping when called from a Ruby script that reads from stdin

我的未来我决定 提交于 2019-11-30 09:03:32
I've created a console Ruby script that uses ARGF to load data from a file or stdin, that then calls Pry. This works great when I pass a file in (Pry pauses) but fails (Pry doesn't stop and just exits Ruby) when I pass my data using stdin. This is weird, anyone know why? I would like to pass data in via stdin and have Pry pause. Behold, an example script: require 'rubygems' require 'pry' def pry_it(str) binding.pry end pry_it(ARGF.read) When I call this app with a file in ARGV I get my proper response - pry pausing % bundle exec ruby pry_test.rb file.txt From: /Users/wilcoxr/Development/json

Pry not stopping when called from a Ruby script that reads from stdin

谁说我不能喝 提交于 2019-11-29 14:02:16
问题 I've created a console Ruby script that uses ARGF to load data from a file or stdin, that then calls Pry. This works great when I pass a file in (Pry pauses) but fails (Pry doesn't stop and just exits Ruby) when I pass my data using stdin. This is weird, anyone know why? I would like to pass data in via stdin and have Pry pause. Behold, an example script: require 'rubygems' require 'pry' def pry_it(str) binding.pry end pry_it(ARGF.read) When I call this app with a file in ARGV I get my proper

pry gem how to reload?

吃可爱长大的小学妹 提交于 2019-11-28 21:06:20
I am using the Pry gem in my Rails console, but the pry flavored rails-console seems to have lost the reload! method for reloading models and stuff. Here's how I start the pry console c:\rails\app> pry -r ./config/environment Thank You horseyguy You could check out this page on the Pry wiki: https://github.com/pry/pry/wiki/Setting-up-Rails-or-Heroku-to-use-Pry Also check out the pry-rails plugin: https://github.com/rweng/pry-rails There's also a lot of other content on that wiki, it's a great resource. To use reload! like the rails console command, add this code to your .pryrc # load Rails

【在 Nervos CKB 上做开发】Nervos CKB脚本编程简介[2]:脚本基础

Deadly 提交于 2019-11-28 18:25:56
CKB脚本编程简介[2]:脚本基础 原文作者:Xuejie 原文链接:Introduction to CKB Script Programming 2: Script 本文译者:Shooter,Jason,Orange (排名不分先后) 上一篇我们介绍了当前 CKB 的验证模型。这一篇会更加有趣一点,我们要向大家展示如何将脚本代码真正部署到 CKB 网络上去。我希望在你看完本文后,你可以有能力自行去探索 CKB 的世界并按照你自己的意愿去编写新的脚本代码。 需要注意的是,尽管我相信目前的 CKB 的编程模型已经相对稳定了,但是开发仍在进行中,因此未来还可能会有一些变化。我将尽力确保本文始终处于最新的状态,但是如果在过程到任何疑惑,本文以 此版本下的 CKB 作为依据。 警告:这是一篇很长的文章,因为我想为下周更有趣的话题提供充足的内容。所以如果你没有充足的时间,你不必马上完成它。我在试着把它分成几个独立的不凡,这样你就可以一次尝试一个。 <br> 语法 在继续之前,我们先来区分两个术语:脚本(script)和脚本代码(script code) 在本文以及整个系列文章内,我们将区分脚本和脚本代码。脚本代码实际上是指你编写和编译并在 CKB 上运行的程序。而脚本,实际上是指 CKB 中使用的脚本数据结构,它会比脚本代码稍微多一点点: pub struct Script { pub

How to use Pry with Sinatra?

大憨熊 提交于 2019-11-28 17:05:19
问题 I am writing my first Sinatra application and would like to use Pry to inspect/debug some things going on in the application. I haven't used Pry before either, but I would like to try it out. How would I get started using Pry with my Sinatra application? 回答1: Summary Use require 'pry' at the top of your application. Call binding.pry in your code whenever you want to drop into the interactive session. For information on using Pry, see Turning IRB on its head with Pry and the Pry wiki. When you

How do I step out of a loop with Ruby Pry?

限于喜欢 提交于 2019-11-28 13:18:15
问题 I'm using Pry with my Rails application. I set binding.pry inside a loop in my model to try and debug a problem. For example: (1..100).each do |i| binding.pry puts i end When I type quit , it goes to the next iteration and stops again. Is there a way to step out of the loop so I don't have to type quit 100 times? Currently the only way I know how to get out of it is to use CTRL + C and restart the application. 回答1: To exit Pry unconditionally, type exit-program Edit from @Nick's comment :

pry gem how to reload?

不打扰是莪最后的温柔 提交于 2019-11-27 20:39:08
问题 I am using the Pry gem in my Rails console, but the pry flavored rails-console seems to have lost the reload! method for reloading models and stuff. Here's how I start the pry console c:\rails\app> pry -r ./config/environment Thank You 回答1: You could check out this page on the Pry wiki: https://github.com/pry/pry/wiki/Setting-up-Rails-or-Heroku-to-use-Pry Also check out the pry-rails plugin: https://github.com/rweng/pry-rails There's also a lot of other content on that wiki, it's a great