Class: Pod::X::Installer
- Inherits:
-
Object
- Object
- Pod::X::Installer
- Extended by:
- Executable
- Defined in:
- lib/cocoapods-x/extension/installer.rb
Instance Attribute Summary collapse
-
#init_method ⇒ Object
Returns the value of attribute init_method.
-
#init_self ⇒ Object
Returns the value of attribute init_self.
-
#pod_method ⇒ Object
Returns the value of attribute pod_method.
-
#pod_self ⇒ Object
Returns the value of attribute pod_self.
-
#pods_builder ⇒ Object
Returns the value of attribute pods_builder.
-
#print_post_install_message_method ⇒ Object
Returns the value of attribute print_post_install_message_method.
-
#print_post_install_message_self ⇒ Object
Returns the value of attribute print_post_install_message_self.
-
#project ⇒ Object
Returns the value of attribute project.
-
#repos ⇒ Object
Returns the value of attribute repos.
-
#sources_builder ⇒ Object
Returns the value of attribute sources_builder.
-
#target_method ⇒ Object
Returns the value of attribute target_method.
-
#target_self ⇒ Object
Returns the value of attribute target_self.
-
#use_repos ⇒ Object
Returns the value of attribute use_repos.
-
#workspace ⇒ Object
Returns the value of attribute workspace.
Class Method Summary collapse
Instance Method Summary collapse
-
#initialize ⇒ Installer
constructor
A new instance of Installer.
-
#monitor_initialize_begin(defined_in_file = nil, internal_hash = {}, &block) ⇒ Object
monitor.
- #monitor_initialize_end(defined_in_file = nil, internal_hash = {}, &block) ⇒ Object
- #monitor_pod_begin(name, *requirements) ⇒ Object
- #monitor_pod_end(name, *requirements) ⇒ Object
- #monitor_print_post_install_message_begin ⇒ Object
- #monitor_print_post_install_message_end ⇒ Object
- #monitor_target_begin(name, options = nil, &block) ⇒ Object
- #monitor_target_end(name, options = nil, &block) ⇒ Object
Constructor Details
#initialize ⇒ Installer
Returns a new instance of Installer.
24 25 26 27 28 29 |
# File 'lib/cocoapods-x/extension/installer.rb', line 24 def initialize @project = nil @workspace = nil @pods_builder = Pod::X::PodsBuilder::new @sources_builder = Pod::X::SourcesBuilder::new end |
Instance Attribute Details
#init_method ⇒ Object
Returns the value of attribute init_method.
12 13 14 |
# File 'lib/cocoapods-x/extension/installer.rb', line 12 def init_method @init_method end |
#init_self ⇒ Object
Returns the value of attribute init_self.
11 12 13 |
# File 'lib/cocoapods-x/extension/installer.rb', line 11 def init_self @init_self end |
#pod_method ⇒ Object
Returns the value of attribute pod_method.
12 13 14 |
# File 'lib/cocoapods-x/extension/installer.rb', line 12 def pod_method @pod_method end |
#pod_self ⇒ Object
Returns the value of attribute pod_self.
11 12 13 |
# File 'lib/cocoapods-x/extension/installer.rb', line 11 def pod_self @pod_self end |
#pods_builder ⇒ Object
Returns the value of attribute pods_builder.
14 15 16 |
# File 'lib/cocoapods-x/extension/installer.rb', line 14 def pods_builder @pods_builder end |
#print_post_install_message_method ⇒ Object
Returns the value of attribute print_post_install_message_method.
12 13 14 |
# File 'lib/cocoapods-x/extension/installer.rb', line 12 def end |
#print_post_install_message_self ⇒ Object
Returns the value of attribute print_post_install_message_self.
11 12 13 |
# File 'lib/cocoapods-x/extension/installer.rb', line 11 def end |
#project ⇒ Object
Returns the value of attribute project.
15 16 17 |
# File 'lib/cocoapods-x/extension/installer.rb', line 15 def project @project end |
#repos ⇒ Object
Returns the value of attribute repos.
17 18 19 |
# File 'lib/cocoapods-x/extension/installer.rb', line 17 def repos @repos end |
#sources_builder ⇒ Object
Returns the value of attribute sources_builder.
14 15 16 |
# File 'lib/cocoapods-x/extension/installer.rb', line 14 def sources_builder @sources_builder end |
#target_method ⇒ Object
Returns the value of attribute target_method.
12 13 14 |
# File 'lib/cocoapods-x/extension/installer.rb', line 12 def target_method @target_method end |
#target_self ⇒ Object
Returns the value of attribute target_self.
11 12 13 |
# File 'lib/cocoapods-x/extension/installer.rb', line 11 def target_self @target_self end |
#use_repos ⇒ Object
Returns the value of attribute use_repos.
18 19 20 |
# File 'lib/cocoapods-x/extension/installer.rb', line 18 def use_repos @use_repos end |
#workspace ⇒ Object
Returns the value of attribute workspace.
15 16 17 |
# File 'lib/cocoapods-x/extension/installer.rb', line 15 def workspace @workspace end |
Class Method Details
.installer ⇒ Object
31 32 33 34 |
# File 'lib/cocoapods-x/extension/installer.rb', line 31 def self.installer @@shared ||= Pod::X::Installer::new @@shared end |
Instance Method Details
#monitor_initialize_begin(defined_in_file = nil, internal_hash = {}, &block) ⇒ Object
monitor
38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 |
# File 'lib/cocoapods-x/extension/installer.rb', line 38 def monitor_initialize_begin(defined_in_file = nil, internal_hash = {}, &block) workspace = Pod::X::Sandbox::workspace return unless workspace.source_file.exist? conf = Pod::X::Configurator::find_conf?(Dir.pwd) return if conf.nil? project = Pod::X::Sandbox::Project::new(conf) return unless project.pods_file.exist? @project = project @workspace = workspace @pods_builder::build(project.pods_file) @sources_builder::build(workspace.source_file) @repos = build_repos() @use_repos = Array::new UI.puts 'Pod::X '.magenta + 'Working...'.green end |
#monitor_initialize_end(defined_in_file = nil, internal_hash = {}, &block) ⇒ Object
56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 |
# File 'lib/cocoapods-x/extension/installer.rb', line 56 def monitor_initialize_end(defined_in_file = nil, internal_hash = {}, &block) return nil if @repos.nil? return nil if @use_repos.nil? @use_repos.each do |name| repo = @repos[name] repo_url = repo.repo_url location_url = repo.location_url if repo_url.nil? || location_url.nil? UI.puts 'Pod::X '.magenta + "You must specify a repository to clone for '#{name}'.".yellow elsif !Dir::exist?(location_url) || Dir::empty?(location_url) UI.section('Pod::X '.magenta + "Cloning into '#{name}'...".green) do UI.puts 'Pod::X '.magenta + "'#{name}' from: #{repo_url}".magenta UI.puts 'Pod::X '.magenta + "'#{name}' to: #{location_url}".magenta rm! ['-rf', location_url] git! ['clone', repo_url, location_url] end end end end |
#monitor_pod_begin(name, *requirements) ⇒ Object
85 86 87 88 89 90 91 92 93 |
# File 'lib/cocoapods-x/extension/installer.rb', line 85 def monitor_pod_begin(name, *requirements) return nil if @repos.nil? return nil if @repos[name].nil? return nil if @use_repos.nil? unless @use_repos.include?(name) @use_repos << name end @repos[name].location_url end |
#monitor_pod_end(name, *requirements) ⇒ Object
95 96 97 |
# File 'lib/cocoapods-x/extension/installer.rb', line 95 def monitor_pod_end(name, *requirements) nil end |
#monitor_print_post_install_message_begin ⇒ Object
99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 |
# File 'lib/cocoapods-x/extension/installer.rb', line 99 def return nil if @repos.nil? return nil if @use_repos.nil? return nil if @use_repos.size <= 0 @use_repos.each do |name| repo = @repos[name] location_url = repo.location_url unless location_url.nil? Dir.chdir(location_url) do begin branch = git! ['rev-parse', '--abbrev-ref', 'HEAD'] branch = branch.chomp UI.puts 'Pod::X '.magenta + "Installing #{name} (#{branch.red})".green rescue => exception UI.puts 'Pod::X '.magenta + "Installing #{name}".green end end end end UI.puts 'Pod::X '.magenta + "installation complete!".green end |
#monitor_print_post_install_message_end ⇒ Object
122 123 124 |
# File 'lib/cocoapods-x/extension/installer.rb', line 122 def end |
#monitor_target_begin(name, options = nil, &block) ⇒ Object
77 78 79 |
# File 'lib/cocoapods-x/extension/installer.rb', line 77 def monitor_target_begin(name, = nil, &block) end |
#monitor_target_end(name, options = nil, &block) ⇒ Object
81 82 83 |
# File 'lib/cocoapods-x/extension/installer.rb', line 81 def monitor_target_end(name, = nil, &block) end |