class Object
Public Instance Methods
getDirPath()
click to toggle source
# File lib/translateUtil.rb, line 10 def getDirPath fatherDir = File.expand_path("..", Dir.pwd) outputDir = fatherDir + "/Output" FileUtils.mkdir_p(outputDir) unless File.exists?(outputDir) return outputDir end
parseJson(path)
click to toggle source
# File lib/translateUtil.rb, line 5 def parseJson(path) json = File.read(path) obj = JSON.parse(json) end
replace_file(path, content)
click to toggle source
# File lib/translateUtil.rb, line 17 def replace_file(path, content) File.open(path, "w") do |file| file.write(content) end end
startTranlate2Code(jsonFilePath,codeGenerateModel)
click to toggle source
# File lib/translate2code.rb, line 4 def startTranlate2Code(jsonFilePath,codeGenerateModel) codeGenerateModel.startTranslate(jsonFilePath) end