Class: PluginsUpdater

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

Class Method Summary collapse

Class Method Details

.separatorObject



44
45
46
# File 'lib/plugins_updater.rb', line 44

def self.separator
  '-----------------------------------------------'
end

.update_pluginsObject



5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'lib/plugins_updater.rb', line 5

def self.update_plugins
  xcodes = Xcode.find_xcodes

  if xcodes.empty?
    puts "Didn't find any Xcode installed on your system."
    return
  else
    puts 'Found:'
    puts xcodes
  end

  puts separator

  plugins = XcodePlugin.find_plugins

  if plugins.empty?
    puts "Didn't find any Xcode Plug-in installed on your system."
    return
  else
    puts 'Plugins:'
    puts plugins
  end

  puts separator
  puts 'Updating...'

  uuids = xcodes.collect(&:uuid)
  uuids.each do |uuid|
    plugins.each do |plugin|
      if plugin.add_uuid(uuid) && !CLI.dry_run?
        puts "Added #{uuid} to #{plugin}"
      end
    end
  end

  puts separator
  puts 'Done.'
end