Class: Yalphabetize::CLI

Inherits:
Object
  • Object
show all
Defined in:
lib/yalphabetize/cli.rb

Class Method Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(argv) ⇒ CLI

Returns a new instance of CLI.



18
19
20
# File 'lib/yalphabetize/cli.rb', line 18

def initialize(argv)
  @argv = argv
end

Class Method Details

.call(argv) ⇒ Object



14
15
16
# File 'lib/yalphabetize/cli.rb', line 14

def self.call(argv)
  new(argv).call
end

Instance Method Details

#callObject



22
23
24
25
26
27
28
29
30
31
32
33
# File 'lib/yalphabetize/cli.rb', line 22

def call
  Yalphabetizer.call(
    argv,
    reader_class: Yalphabetize::Reader,
    finder: Yalphabetize::YamlFinder.new,
    alphabetizer_class: Yalphabetize::Alphabetizer,
    writer_class: Yalphabetize::Writer,
    offence_detector_class: Yalphabetize::OffenceDetector,
    logger: Yalphabetize::Logger.new($stdout),
    file_yalphabetizer_class: Yalphabetize::FileYalphabetizer
  )
end