1

I have installed gem rvpacker gem. From command runs fine but I want to set its options. I have this method by now

def runPacker(dir, type)
  puts dir
  puts type
  begin
    rvpacker -V -f -d #{dir} -t ace -a #{type}
  rescue Exception =>e
    puts "Error!"
    puts e.message
    puts e.backtrace.inspect 
    return 1
  end
  return 0
end

How to write this rvpacker line by using my parameters?

It's the script which I will run from Java App by using JRuby. When I call this command from JRuby directly I got

org.jruby.embed.ParseFailedException: (SyntaxError) <script>:1: syntax error, unexpected tUMINUS
rvpacker -V -f -d P:\temp-workspace\RPGTestProject1 -t ace -a unpack

But when I write it in console directly it's fine.

Levvy
  • 1,100
  • 1
  • 10
  • 21

2 Answers2

0

rvpacker -V -f -d #{dir} -t ace -a #{type} this is not ruby code and I wanted to execute it from ruby interpreter ;) Ave me!

Levvy
  • 1,100
  • 1
  • 10
  • 21
-1

If I've understood your question right, then I think you'll find the answer here. For instance, you could wrap your command in a system call so that instead of the line:

rvpacker -V -f -d #{dir} -t ace -a #{type}

you would use

system "rvpacker -V -f -d #{dir} -t ace -a #{type}"
Community
  • 1
  • 1
baob
  • 19
  • 4