Class: Pidgin2Adium::Cli

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

Instance Method Summary collapse

Constructor Details

#initialize(options, stdout = STDOUT, stderr = STDERR) ⇒ Cli

Returns a new instance of Cli


3
4
5
6
7
# File 'lib/pidgin2adium/cli.rb', line 3

def initialize(options, stdout=STDOUT, stderr=STDERR)
  @options = options
  @stdout = stdout
  @stderr = stderr
end

Instance Method Details

#runObject


9
10
11
12
13
14
15
16
17
18
19
20
21
# File 'lib/pidgin2adium/cli.rb', line 9

def run
  if @options[:in_directory] && @options[:aliases]
    runner = Runner.new(
      @options[:in_directory],
      @options[:aliases],
      @options[:out_directory]
    )
    runner.run
  else
    @stderr.puts "Please provide -i/--in argument and -a/--aliases. Run with --help for more information"
    exit 1
  end
end