I have a rake task that needs to insert a value into multiple databases. I'd like to pass this value into the rake task from the command line, or from another rake task. How can I do this?
![How to pass command line arguments to a rake task](https://cdn-ak-scissors.b.st-hatena.com/image/square/98d6f053a97a87156775f60757c60865d0f2c47d/height=288;version=1;width=512/https%3A%2F%2Fcdn.sstatic.net%2FSites%2Fstackoverflow%2FImg%2Fapple-touch-icon%402.png%3Fv%3D73d79a89bded)
I have a Rakefile that compiles the project in two ways, according to the global variable $build_type, which can be :debug or :release (the results go in separate directories): task :build => [:some_other_tasks] do end I wish to create a task that compiles the project with both configurations in turn, something like this: task :build_all do [ :debug, :release ].each do |t| $build_type = t # call t
Ruby 版 Make である Rake について。 Rake -- Ruby Make { version: 0.8.3 date: 2009/02/11 $ rake [options ...] [VAR=VALUE ...] [tasks...] rake コマンドに引数として、 オプション 変数 タスク名 を渡す。 default タスク タスク名が省略された場合、Rake は default という名前のタスクを実行する。 Rakefile Rake は、タスクを記述した Rakefile というファイルからタスク等の処理を読み込む。 $ rake --help 上記 --help オプションでヘルプが表示される。 ? -C, --classic-namespace タスクの説明を表示する -D, --describe [PATTERN] PATTERN を指定した場合は、マッチ
If you’re developing with Rails you’ve probably encountered rake once or twice. This blog post aims to walk you through where rake came from and an introduction on how to use it effectively in your Rails apps. A Little Bit of History Rake is the project of Jim Weirich. It’s a build tool. For a good laugh and an even more in depth history check out the "rational.rdoc" from the Rake documentation. E
RubyによるビルドツールRakeの覚え書き。興に乗ったので詳しく書いてみた。 2014/02/20 Rakeの作者、Jim Weirich氏が亡くなられました。安らかに… Rakeとは? インストール 単純なRakefile タスク ファイルタスク ルール ディレクトリ作成 タスクの説明 ファイルリスト クリーニング パッケージ作成 タスクの動的生成 テストタスク 複数のRakefileの連携 名前空間 参考URL Rakeとは? Rakeは、MakeをRubyで実装したものを超越したビルドツールである。 世間では、ビルドツールというとMakeやApache Antが有名で、よく使われている。 Rakeは、これらのいいとこ取りをした上で、特有のフィーチャーを追加した新しいビルドツールであり、複雑なビルドを柔軟に書きこなすことができる。その秘密は内部DSLという仕組みにあり、このおかげでビ
In previous posts, Boson was introduced as a command framework, usable from the commandline and irb. In this post, we’ll focus on how Boson enhances irb by treating methods like shell commands. Preface If you’re an avid irb user like me, your ~/.irbrc is littered with methods. These methods are sometimes favorite tweaks to Ruby’s core libraries and sometimes interfaces to gems. But regardless of w
Introducing Boson, a command/task framework that could change how you collect and execute your ruby code. Sure, there’s rake, thor and a dozen other gems. But how many will let you create a universe of ruby commands you can run from the commandline and irb? Spinning On Feel free to follow Boson on the Hub and to install it: $ gem install boson boson-more $ echo "require 'boson/more'" >> ~/.bosonrc
Rake is a build language, similar in purpose to make and ant. Like make and ant it's a Domain Specific Language, unlike those two it's an internal DSL programmed in the Ruby language. In this article I introduce rake and describe some interesting things that came out of my use of rake to build this web site: dependency models, synthesized tasks, custom build routines and debugging the build script
リリース、障害情報などのサービスのお知らせ
最新の人気エントリーの配信
処理を実行中です
j次のブックマーク
k前のブックマーク
lあとで読む
eコメント一覧を開く
oページを開く