Class: Poepod::GemProcessor

Inherits:
Processor show all
Defined in:
lib/poepod/gem_processor.rb

Overview

Processes gem files for wrapping, handling unstaged files

Constant Summary

Constants inherited from Processor

Processor::EXCLUDE_DEFAULT

Instance Method Summary collapse

Constructor Details

#initialize(gemspec_path, include_unstaged: false, exclude: nil, include_binary: false, include_dot_files: false, base_dir: nil, config_file: nil) ⇒ GemProcessor

Returns a new instance of GemProcessor.



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
# File 'lib/poepod/gem_processor.rb', line 10

def initialize(
  gemspec_path,
  include_unstaged: false,
  exclude: nil,
  include_binary: false,
  include_dot_files: false,
  base_dir: nil,
  config_file: nil
)
  super(
    config_file,
    include_binary: include_binary,
    include_dot_files: include_dot_files,
    exclude: exclude,
    base_dir: base_dir || File.dirname(gemspec_path),
  )
  @gemspec_path = gemspec_path
  @include_unstaged = include_unstaged
end

Instance Method Details

#process(output_file) ⇒ Object



30
31
32
33
34
35
36
37
38
39
40
41
# File 'lib/poepod/gem_processor.rb', line 30

def process(output_file)
  return error_no_gemspec unless File.exist?(@gemspec_path)

  spec = load_gemspec
  return spec unless spec.is_a?(Gem::Specification)

  unstaged_files = check_unstaged_files

  total_files, copied_files = super(output_file)

  [true, output_file, unstaged_files]
end