LoginSignup
3
3

More than 5 years have passed since last update.

【pryあるある】binding.pry がどこにあるのかわからなくなる

Posted at

またbindin.pryを消し忘れて実行しちゃったよ

Pryがないと生きていけない体のわたくし。
すごい便利なんですが、長いコードになってくると

binding.pry

がどこにあるのかわからなくなります。
ちょっと休憩するともうどこにあったか覚えてない。
で、こういうスニペットを作ってみたという。

<snippet>
  <content><![CDATA[
######################

    binding.pry

######################
]]></content>
  <tabTrigger>bi</tabTrigger>
  <scope>source.ruby</scope>
  <scope>source.erb</scope>
  <description>pry breakpoint</description>
</snippet>

まぁここまでデカいと見逃しませんよね。という。

ERBファイルの中に無理やり打ち込むのはこちら。
こちらは動くかどうかわかりませんが

<snippet>
  <content><![CDATA[
<!----------------------------->

       <%= binding.pry %>

<!----------------------------->

]]></content>
  <!-- Optional: Set a tabTrigger to define how to trigger the snippet -->
  <tabTrigger>bi</tabTrigger>
  <!-- Optional: Set a scope to limit where the snippet will trigger -->
  <description> pry in erb template </description>
  <scope>text.html.ruby</scope>
</snippet>

エディタの設定で強調表示とか出来ないんですかねぇ。
もしくはGemかなんかでbinding.pryを削除するかどうか聞いてきたりとか。

3
3
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3