0

I have install gem rak i want to use rak command inside rake task ...

How may i use that ??

I know how to use it on command prompt ...

This is working fine on command prompt ...

rak RAILS_ENV

krunal shah
  • 16,089
  • 25
  • 97
  • 143
  • 1
    do you mean rack or rake when you say "rak" – rogerdpack Sep 03 '10 at 21:53
  • @rogerdpack rak is a gem .rak is a replacement of grep ... If i write rak RAILS_ENV on my command prompt than it will display all the files with the line number which containing RAILS_ENV... – krunal shah Sep 04 '10 at 19:11
  • Like rogerdpack, I thought that "rak" was a mis-spelling. I think the poor grammar in your question made me think that. – Andrew Grimm Sep 09 '10 at 11:40

2 Answers2

0

to run 'rak' you can either run it as a command, like

 a = `rak asdf`

ref: http://en.wikibooks.org/wiki/Ruby_Programming/Running_Multiple_Processes

or hack into the rak source code and figure out how to call it.

rogerdpack
  • 62,887
  • 36
  • 269
  • 388
0

This links may help you run command line command into ruby ...

http://zhangxh.net/programming/ruby/6-ways-to-run-shell-commands-in-ruby/

Calling shell commands from Ruby

http://blog.jayfields.com/2006/06/ruby-kernel-system-exec-and-x.html

%x[command].each do |f|
  value = f
end
Community
  • 1
  • 1
krunal shah
  • 16,089
  • 25
  • 97
  • 143