Class: Lokale::Main

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

Instance Method Summary collapse

Instance Method Details

#find_dirObject



69
70
71
72
73
74
75
76
77
78
# File 'lib/lokale.rb', line 69

def find_dir 
  begin
    @project_path, @project_name = ProjectFinder::find_proj   
  rescue Exception => e
    puts e
    exit
  end

  puts "Target Xcode project: '#{@project_name}'".green
end

#init_workersObject



94
95
96
97
# File 'lib/lokale.rb', line 94

def init_workers
  @agent = Lokale::Agent.new(@project_path, Config.get.macros)
  @reporter = Lokale::Reporter.new(@agent)
end

#read_configObject



80
81
82
83
84
85
86
87
88
89
90
91
92
# File 'lib/lokale.rb', line 80

def read_config
  Config.init
  Config.get.project_path = @project_path
  Config.get.project_name = @project_name

  begin
    Config.get.read_lokalefile
  rescue Exception => e
    puts "Error reading config file".red
    puts e
    exit
  end
end

#runObject



60
61
62
63
64
65
# File 'lib/lokale.rb', line 60

def run
  find_dir
  read_config
  init_workers
  run_actions
end

#run_actionsObject



99
100
101
# File 'lib/lokale.rb', line 99

def run_actions
  Config.get.actions.each { |action| action.perform(@agent, @reporter) }
end