タグ

irbに関するnoplansのブックマーク (10)

  • irb の Tips - サブ irb を使う - ruby trunk changes

    この記事は Ruby Advent Calendar jp: 2009 : ATND が楽しそうなので触発されて書いてますが参加してはいません。飛び入りですみません。あとまさかのネタ被りしてたら当にごめんなさい。 sub irb Rubyist の必需品 irb 多くの人が愛用していることと思います。わたしも大好きです。メソッドの挙動を確認したり、ちょっとした作業の補佐に使ったり、あるいは電卓がわりに、常に起動しているプロセスのひとつです。 けど irb に サブirb を起動するという機能があることを知らない、あるいは知ってるけど使いどころがわからないでのあまり使ってないという人は多いのではないでしょうか。 サブirb はRubyリファレンスマニュアルにも書かれていて、拡張ではない(require は必要ない)基機能です。「使用例」の項に書かれているように、irb メソッドによって新

    irb の Tips - サブ irb を使う - ruby trunk changes
  • Always turn on ActiveRecord logging in the console

    Remember that you can turn on ActiveRecord logging for the console and see what SQL-query is executed? Here’s a statement you can put in your environment.rb file (or in one specific environment config file - such as development.rb) to have it turned on permanently: if "irb" == $0 ActiveRecord::Base.logger = Logger.new(STDOUT) end I think it makes most sense to put it in development.rb and have log

    Always turn on ActiveRecord logging in the console
    noplans
    noplans 2010/03/01
    コメント欄
  • irbで便利そうなメソッド - それはそれ、これはこれ

    .irbrcに書いておくと便利そうなメソッド。 オブジェクトに対して、使えるメソッドを取得する。methodsメソッドだと、Objectなど祖先クラスのメソッドが全部出るので見にくい。そのクラスのオブジェクトに特有のメソッドだけが出るといいなと思って書いた。 デフォルトだと、nilとの差分。自然数を引数にすると、その階層分だけさかのぼったクラスorモジュールのインスタンスメソッドとの差分を取る。 module Kernel def m(obj=nil) if obj.instance_of?(Fixnum) and obj > 0 k = self.class.ancestors[obj] k ||= Object (methods-k.instance_methods).sort elsif is_a? Module (methods-Module.methods).sort else

    irbで便利そうなメソッド - それはそれ、これはこれ
    noplans
    noplans 2009/12/12
  • はてなブログ | 無料ブログを作成しよう

    新米と秋刀魚のわた焼き お刺身用の秋刀魚を買いました。1尾250円です 3枚におろして、秋刀魚のわたに酒、味醂、醤油で調味して1時間ほど漬け込み、グリルで焼きました 秋刀魚のわた焼き わたの、苦味が程よくマイルドに調味され、クセになる味わいです 艶やかな新米と一緒に 自家製お漬物 土…

    はてなブログ | 無料ブログを作成しよう
    noplans
    noplans 2009/09/05
  • Tagaholic - hirb

    A mini view framework for console/irb that's easy to use, even while under its influence. Console goodies include a no-wrap table, auto-pager, tree and menu. Install gem install hirb Description Hirb provides a mini view framework for console applications and uses it to improve irb’s default inspect output. Given an object or array of objects, hirb renders a view based on the object’s class and/or

    noplans
    noplans 2009/06/29
    A mini view framework for console/irb that's easy to use, even while under its influence.
  • Hirb: An Easy-to-Use View Framework for irb

    Ruby Weekly is a weekly newsletter covering the latest Ruby and Rails news. The Interactive Ruby Shell (irb) and the Rails console are great for interacting and experimenting with your ruby application code, but sometimes it's hard to visualize the output. Gabriel Horner has come to the rescue with Hirb: a 'mini view framework' for irb which is designed to improve the default output to make it mor

  • Sketches

    Sketches allows you to create and edit Ruby code from the comfort of your editor, while having it safely reloaded in IRB whenever changes to the code are saved. Features Spawn an editor of your choosing from IRB.Automatically reload your code when it changes.Use a custom editor command.Use a custom temp directory to store sketches in. Download it here or run: $ sudo gem install sketches Then requi

  • irb_rocketでirbをハッシュロケット化する - Hello, world! - s21g

    irbはインタラクティブにrubyのコードを実行出来る 非常に便利なユーティリティですが、 脳内にある「irbのあるべき姿」と比べると、 ちょっとだけ足りないところがあると思っていました。 そこで、思い通りの動きをするようにirbをカスタマイズする irbプラグイン irb_rocket を作ってみました。 これを使うと、いつも見慣れたirbが、こんな風になります。 inputの末尾に#=>に続いて結果が表示されます 結果はWirbleを使って色づけしています 標準エラー出力への出力は赤で表示します インストール方法 irb_rocketは wirble と ruby-terminfo に依存しているので、 それらをインストールします。 続いて、以下のようにhttp://merbi.stからgemをインストールします。

  • Pablotron: Wirble

    Wirble is a set of enhancements for Irb. Wirble enables several items mentioned on the RubyGarden "Irb Tips and Tricks" page, including tab-completion, history, and a built-in ri command, as well as colorized results and a couple other goodies. The idea, of course, is to fill Irb with useful features without turning your ~/.irbrc file into swiss cheese. Using Wirble is simple, too. Here's what a

    noplans
    noplans 2008/03/19
    > Wirble is a set of enhancements for irb.
  • [ruby] irbを使う前にしておくべき3つ( α)の設定 - Greenbear Diary (2007-08-01)

    ■ [ruby] irbを使う前にしておくべき3つ(+α)の設定 Rubyで試行錯誤しながら開発したいときにはirbを使うのが便利です。 今日はirbをさらに便利にする設定をいくつか紹介します。 ホームディレクトリ*1に .irbrc というファイルを 作り、そこに設定を書いていきます。 (1) タブ補完 # --- completion require 'irb/completion' メソッド名をTABキーで補完できるようになります。 例: yhara@meteor:~ % irb >> a = [] => [] >> a.ind[TAB] a.index a.indexes a.indices (2) リファレンス検索 川o・-・)<2nd life - Irb/TipsAndTricksより。 IRB上から「r」というメソッドでrefeを引けるようになります。 例: >> r :p

    [ruby] irbを使う前にしておくべき3つ( α)の設定 - Greenbear Diary (2007-08-01)
  • 1