Class: Poepod::Processor

Inherits:
Object
  • Object
show all
Defined in:
lib/poepod/processor.rb

Overview

Base processor class

Direct Known Subclasses

FileProcessor, GemProcessor

Constant Summary collapse

EXCLUDE_DEFAULT =
[
  %r{node_modules/}, %r{.git/}, /.gitignore$/, /.DS_Store$/,
].freeze

Instance Method Summary collapse

Constructor Details

#initialize(config_file = nil, include_binary: false, include_dot_files: false, exclude: nil, base_dir: nil) ⇒ Processor

Returns a new instance of Processor.



16
17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/poepod/processor.rb', line 16

def initialize(
  config_file = nil,
  include_binary: false,
  include_dot_files: false,
  exclude: nil,
  base_dir: nil
)
  @config = load_config(config_file)
  @include_binary = include_binary
  @include_dot_files = include_dot_files
  @exclude = exclude || EXCLUDE_DEFAULT
  @base_dir = base_dir
  @failed_files = []
end

Instance Method Details

#process(output_file) ⇒ Object



31
32
33
34
35
# File 'lib/poepod/processor.rb', line 31

def process(output_file)
  files_to_process = collect_files_to_process
  total_files, copied_files = process_files(files_to_process, output_file)
  [total_files, copied_files]
end