module RapperLite::Utils

Protected Instance Methods

config_key?( key ) click to toggle source

True if the given string is a reserved config key name.

# File lib/rapper_lite/utils.rb, line 16
def config_key?( key )
  self.config_keys.include?( key )
end
config_keys() click to toggle source
# File lib/rapper_lite/utils.rb, line 20
def config_keys
  %w( root destination compress )
end
join_files( source_paths, destination_path ) click to toggle source

Concatenate one or more files by shelling out to ‘cat`.

# File lib/rapper_lite/utils.rb, line 6
def join_files( source_paths, destination_path )
  source_paths = Array( source_paths )
  source_paths.each do |path|
    raise "#{path} doesn't exist." unless File.exists?( path )
  end
  
  system "cat #{source_paths.join( " " )} > #{destination_path}"
end