Class: BuildConfig
- Inherits:
-
Object
- Object
- BuildConfig
- Defined in:
- lib/liquidoc.rb
Overview
For now BuildConfig is mostly to objectify the primary build ‘action’ steps
Instance Method Summary collapse
-
#deprecated_format(config) ⇒ Object
for backward compatibility with 0.1.0 and 0.2.0.
-
#initialize(config) ⇒ BuildConfig
constructor
A new instance of BuildConfig.
- #steps ⇒ Object
- #validate(config) ⇒ Object
Constructor Details
#initialize(config) ⇒ BuildConfig
Returns a new instance of BuildConfig.
269 270 271 272 273 274 275 276 |
# File 'lib/liquidoc.rb', line 269 def initialize config if (defined?(config['compile'][0])) # The config is formatted for vesions < 0.3.0; convert it config = deprecated_format(config) end validate(config) @cfg = config end |
Instance Method Details
#deprecated_format(config) ⇒ Object
for backward compatibility with 0.1.0 and 0.2.0
282 283 284 285 286 287 288 289 |
# File 'lib/liquidoc.rb', line 282 def deprecated_format config # for backward compatibility with 0.1.0 and 0.2.0 puts "You are using a deprecated configuration file structure. Update your config files; support for this structure will be dropped in version 1.0.0." # There's only ever one item in the 'compile' array, and only one action type ("parse") config['compile'].each do |n| n.merge!("action" => "parse") # the action type was not previously declared end return config['compile'] end |
#steps ⇒ Object
278 279 280 |
# File 'lib/liquidoc.rb', line 278 def steps @cfg end |
#validate(config) ⇒ Object
291 292 293 294 295 296 |
# File 'lib/liquidoc.rb', line 291 def validate config unless config.is_a? Array raise "ConfigStructError" end # TODO More validation needed end |