class CHBuild::Config::Before
Before
section
Attributes
errors[R]
Public Class Methods
new(before_commands)
click to toggle source
before_commands is required so no default value
Calls superclass method
# File lib/chbuild/config/before.rb, line 7 def initialize(before_commands) super([]) validate!(before_commands) replace(before_commands) unless before_commands.nil? end
Public Instance Methods
name()
click to toggle source
# File lib/chbuild/config/before.rb, line 21 def name "Section 'before'" end
to_bash_script()
click to toggle source
# File lib/chbuild/config/before.rb, line 25 def to_bash_script reduce('') { |a, e| a + "#{e}\n" } end
validate!(before_commands)
click to toggle source
# File lib/chbuild/config/before.rb, line 13 def validate!(before_commands) @errors = [] @errors << 'Required' if before_commands.nil? @errors << 'Cannot be empty' if before_commands == [] end