LoginSignup
6
5

More than 5 years have passed since last update.

Padrino の runner コマンド

Last updated at Posted at 2013-12-19

Padrino には runner コマンドがあるのですが、
その存在に気づいている人が少ないのでは?と思ったので紹介します
(Padrino 公式ドキュメントにもそのうちにサラッとし
た感じで載ると思います)

ちなみに、runner コマンドは 0.11.0 で追加されました。(Change Log)

つかいかた

スクリプトの断片もしくはファイルを引数にしてコマンドを実行します

$ padrino runnner ‘puts Padrino.env’
development
script/confirm_padrino_env.rb
puts Padrino.env
$ padrino r script/confirm_padrino_env.rb -e production
production

こんな感じでもOKですね

lib/greeting.rb
module Greeting
  def self.say
    puts 'Hello'
  end
end
$ padrino r Greeting.say
hello
6
5
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
6
5