class Unmarshalize

Public Class Methods

new(args) click to toggle source
# File lib/unmarshalize.rb, line 2
def initialize(args)
  if args.size == 4
    if args[0] == '-i' && args[2] == '-o'
      @path_input = args[1]
      @path_output = args[3]
      begin
        do_unmarshalize
      rescue
      end
    end
  end
end

Private Instance Methods

do_unmarshalize() click to toggle source
# File lib/unmarshalize.rb, line 16
def do_unmarshalize
  File.open(@path_output, 'w') {|f| f.write(Marshal.load(File.binread(@path_input)))}
  puts @path_output
end