module Rubicon::File

Public Instance Methods

read() click to toggle source
# File lib/rubicon/file.rb, line 11
def read
  write unless ::File.exist?(version_file)

  ver = IO.read(version_file)
  ver.empty? ? '0.0.0' : IO.read(version_file)
end
version_file() click to toggle source
# File lib/rubicon/file.rb, line 7
def version_file
  "#{Rails.root}/VERSION"
end
write(version = '0.0.0') click to toggle source
# File lib/rubicon/file.rb, line 3
def write(version = '0.0.0')
  ::File.open(version_file, 'w') { |f| f.write(version) }
end