Class: Cjoiner::Engines::Joiner

Inherits:
Engine
  • Object
show all
Defined in:
lib/cjoiner/engines/joiner.rb

Overview

join files

Instance Attribute Summary

Attributes inherited from Engine

#engine

Instance Method Summary collapse

Methods inherited from Engine

#render

Methods included from Helpers::Files

#delete_file, #expand_path, #file, #file_exists, #load_yaml, #move_file, #on_windows, #read_file, #temp_file, #write_file

Constructor Details

#initialize(opts) ⇒ Joiner

Returns a new instance of Joiner.



5
6
7
8
9
10
11
# File 'lib/cjoiner/engines/joiner.rb', line 5

def initialize(opts)
  output = ""
  opts[:files].each do |file|
    output << read_file(file) << "\n"
  end
  @engine = output
end