lib/qlang/exec.rb in qlang-0.0.1414 vs lib/qlang/exec.rb in qlang-0.0.14142
- old
+ new
@@ -17,36 +17,38 @@
exit 1
ensure
exit 0
end
- private def ch_compile_type(lang)
- case lang
- when '-Ruby'
- Qlang.to_ruby
- when '-R'
- Qlang.to_r
- else
- print 'Q support Ruby and R now.'
+ private
+
+ def ch_compile_type(lang)
+ case lang
+ when '-Ruby'
+ Qlang.to_ruby
+ when '-R'
+ Qlang.to_r
+ else
+ print 'Q support Ruby and R now.'
+ end
end
- end
- private def parse
- raise '#{@args[0]} is unsupported option' unless @args[0] == '-q'
- filename = @args[1]
- file = open_file(filename)
- string = read_file(file)
- print(Kconv.tosjis(Qlang.compile(string)), '\n')
- file.close
- end
+ def parse
+ raise '#{@args[0]} is unsupported option' unless @args[0] == '-q'
+ filename = @args[1]
+ file = open_file(filename)
+ string = read_file(file)
+ print(Kconv.tosjis(Qlang.compile(string)), '\n')
+ file.close
+ end
- private def open_file(filename, flag = 'r')
- return if filename.nil?
- File.open(filename, flag)
- end
+ def open_file(filename, flag = 'r')
+ return if filename.nil?
+ File.open(filename, flag)
+ end
- private def read_file(file)
- file.read
- end
+ def read_file(file)
+ file.read
+ end
end
end
end