Method: Cuki#initialize

Defined in:
lib/cuki.rb

#initialize(args) ⇒ Cuki

Returns a new instance of Cuki.



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
# File 'lib/cuki.rb', line 27

def initialize(args)
  @args = args
  validate_args
  read_config
  configure_http_client
  @link_builder = LinkBuilder.new(@config['host'])
  action = args.first
  if args.include?(FLAGS[:skip_autoformat])
    args.delete_if { |arg| FLAGS[:skip_autoformat] == arg }
    @skip_autoformat = true
  end
  configure_pull_stubs
  verify_project
  file = args[1]
  if file
    id = mappings.invert[file]
    terminate "could not get id for #{file}" unless id
    pull_feature id, file
  else
    Parallel.map(mappings, :in_processes => 4) do |id, filepath|
      pull_feature id, filepath
    end
  end
  autoformat!
end