class PropertiesReader

Public Class Methods

new(file) click to toggle source
# File lib/capistrano/rack/props_reader.rb, line 2
def initialize(file)
  @file = file
  @properties = {}
  IO.foreach(file) do |line|
    @properties[$1.strip] = $2 if line =~ /([^=]*)=(.*)\/\/(.*)/ || line =~ /([^=]*)=(.*)/
  end
end

Public Instance Methods

get(key) click to toggle source
# File lib/capistrano/rack/props_reader.rb, line 16
def get(key)
  @properties[key].strip
end
to_s() click to toggle source
# File lib/capistrano/rack/props_reader.rb, line 10
def to_s
  output = "File Name #{@file} \n"
  @properties.each {|key,value| output += "#{key}= #{value} \n"}
  output
end