lib/buildmaster/java_manifest.rb in BuildMaster-0.8.1 vs lib/buildmaster/java_manifest.rb in BuildMaster-0.9.0
- old
+ new
@@ -9,11 +9,11 @@
end
def version
number = nil
build = nil
- IO.foreach(@manifest_file) do |line|
+ @manifest_file.foreach do |line|
name_value = NameValue.parse(line)
if (name_value.name== "Implementation-Version")
number = name_value.value
elsif (name_value.name == "Implementation-Build")
build = name_value.value
@@ -24,11 +24,11 @@
def increase_build
content = ""
number = nil
build = nil
- IO.foreach(@manifest_file) do |line|
+ @manifest_file.foreach do |line|
name_value = NameValue.parse(line)
if (name_value.name== "Implementation-Version")
number = name_value.value
content = content + line
elsif (name_value.name == "Implementation-Build")
@@ -36,10 +36,10 @@
content = content + "Implementation-Build: #{build}\n"
else
content = content + line
end
end
- File.open(@manifest_file, "w") do |file|
+ @manifest_file.write do |file|
file.printf(content)
end
return Version.new(number, build)
end
end
\ No newline at end of file