class YMDP::Configuration::Setter

Provides an interface to set global configuration variables inside a block.

Used by the YMDP::Base configure method.

Examples

In the following example, the config variable inside the block is an instance of YMDP::Configuration::Setter.

YMDP::Base.configure do |config|
  config.username = 'malreynolds'
  config.load_content_variables('content')
end

It is then up to YMDP::Base.configure to take the Setter instance and set all the appropriate options based on its settings.

Attributes

compress[RW]

Hash value containing settings which tell the application when to compress CSS and JavaScript.

content_variables[RW]

Hash value containing content variables which are made available to the views at build time.

default_server[RW]

String value containing the #default_server name. Matches the related entry in the servers hash to define which server is the default for rake tasks such as deploy.

external_assets[RW]
growl[RW]

Boolean value which sets whether Growl notifications should be used when compiling and deploying the application.

host[RW]

Host name for the website backend of this application.

javascript_library[RW]
jslint_settings[RW]

Configuration options for JSLint JavaScript validator. Should be maintained in jslint_settings.yml.

password[RW]

String value containing the password used to communicate with the Yahoo! Mail Development Platform to deploy the application.

paths[RW]

Hash value containing paths used by the application to locate its files. This can be used to overwrite default settings.

servers[RW]

Hash value containing application data about the servers, such as their asset and application IDs.

username[RW]

String value containing the login used to communicate with the Yahoo! Mail Development Platform to deploy the application.

validate[RW]

Hash value containing settings which tell the application when to validate HTML and JavaScript.

verbose[RW]

Boolean value which sets whether to output verbose messages or not.

Public Instance Methods

add_content_variable(name, value) click to toggle source

Adds an entry to the content_variables hash.

# File lib/ymdp/configuration/config.rb, line 85
def add_content_variable(name, value)
  @content_variables[name] = value
end
add_path(name, value) click to toggle source

Adds an entry to the paths hash.

# File lib/ymdp/configuration/config.rb, line 79
def add_path(name, value)
  @paths[name] = value
end
jquery() click to toggle source
# File lib/ymdp/configuration/config.rb, line 101
def jquery
  @javascript_library = "jquery"
end
load_content_variables(filename) click to toggle source

Loads the content_variables hash from a Yaml file.

# File lib/ymdp/configuration/config.rb, line 91
def load_content_variables(filename)
  path = "#{CONFIG_PATH}/#{filename}".gsub(%r\.yml$/, "")
  path = "#{path}.yml"
  @content_variables = YAML.load_file(path)
end
prototype() click to toggle source
# File lib/ymdp/configuration/config.rb, line 97
def prototype
  @javascript_library = "prototype"
end