Provides an interface to set global configuration variables inside a block.
Used by the YMDP::Base configure
method.
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.
Hash value containing settings which tell the application when to compress CSS and JavaScript.
Hash value containing content variables which are made available to the views at build time.
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
.
Boolean value which sets whether Growl notifications should be used when compiling and deploying the application.
Host name for the website backend of this application.
Configuration options for JSLint
JavaScript validator. Should be maintained in
jslint_settings.yml
.
String value containing the password used to communicate with the Yahoo! Mail Development Platform to deploy the application.
Hash value containing paths used by the application to locate its files. This can be used to overwrite default settings.
Hash value containing application data about the servers, such as their asset and application IDs.
String value containing the login used to communicate with the Yahoo! Mail Development Platform to deploy the application.
Hash value containing settings which tell the application when to validate HTML and JavaScript.
Boolean value which sets whether to output verbose messages or not.
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
Adds an entry to the paths
hash.
# File lib/ymdp/configuration/config.rb, line 79 def add_path(name, value) @paths[name] = value end
# File lib/ymdp/configuration/config.rb, line 101 def jquery @javascript_library = "jquery" end
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
# File lib/ymdp/configuration/config.rb, line 97 def prototype @javascript_library = "prototype" end