Class: PodAlexandria::LocalPreInstallHook

Inherits:
Object
  • Object
show all
Defined in:
lib/cocoapods-alexandria/env_local/pre_install.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(installer_context, user_options) ⇒ LocalPreInstallHook

Returns a new instance of LocalPreInstallHook.



5
6
7
8
# File 'lib/cocoapods-alexandria/env_local/pre_install.rb', line 5

def initialize(installer_context, user_options)
  @podfile = installer_context.podfile
  @options = UserOptions.new(installer_context, user_options)
end

Instance Attribute Details

#optionsObject (readonly)

Returns the value of attribute options.



3
4
5
# File 'lib/cocoapods-alexandria/env_local/pre_install.rb', line 3

def options
  @options
end

#podfileObject (readonly)

Returns the value of attribute podfile.



3
4
5
# File 'lib/cocoapods-alexandria/env_local/pre_install.rb', line 3

def podfile
  @podfile
end

Instance Method Details

#runObject



10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# File 'lib/cocoapods-alexandria/env_local/pre_install.rb', line 10

def run
  Pod::UI.puts 'Cocoapods Alexandria running in local mode.'

  if should_predownload_dep
    Pod::UI.title 'Pre-downloading dependency for XcodeGen'
    predownload_dep
  end

  Pod::UI.title 'Generating project using XcodeGen'
  XcodeGen::cleanupRome
  XcodeGen::clearDependencies(options.xcodegen_dependencies_file)
  XcodeGen::generate

  Pod::UI.title 'Preparing environment...'
  podfile.prepare_for_xcodegen

  Pod::UI.title 'Continuing with normal CocoaPods'
end