Class: Wrake::Configuration

Inherits:
Object
  • Object
show all
Defined in:
lib/wrake/configuration.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#passwordObject

Returns the value of attribute password.



3
4
5
# File 'lib/wrake/configuration.rb', line 3

def password
  @password
end

#urlObject

Returns the value of attribute url.



3
4
5
# File 'lib/wrake/configuration.rb', line 3

def url
  @url
end

#usernameObject

Returns the value of attribute username.



3
4
5
# File 'lib/wrake/configuration.rb', line 3

def username
  @username
end

Instance Method Details

#from_file(file, env = nil) ⇒ Object



5
6
7
8
9
10
11
12
# File 'lib/wrake/configuration.rb', line 5

def from_file(file, env = nil)
  env ||= defined?(Rails) ? Rails.env : 'production'
  config = YAML::load(File.open(file))[env]

  config.each do |key, value|
    send("#{key}=", value)
  end
end