module BuildMaster class BuildNumberFile attr_reader :number def initialize(path) @path = path @number = load_content().chomp!.to_i end def increase_build @number = @number + 1 save_content end private def load_content() content = nil File.open(@path, 'r') {|file| content = file.gets} return content end def save_content File.open(@path, 'w') {|file| file.puts @number} end end end