Commit 3fb285c7 authored by Boris Bügling's avatar Boris Bügling Committed by GitHub

Merge pull request #5635 from DanToml/dan_remove_migrator

[Installer] Remove Migrator
parents 6f91fdb4 c8174897
......@@ -8,7 +8,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Enhancements
* None.
* Remove references to the pre-1.0 Migrator.
[Danielle Tomlinson](https://github.com/dantoml)
[#5635](https://github.com/CocoaPods/CocoaPods/pull/5635)
##### Bug Fixes
......
......@@ -34,7 +34,6 @@ module Pod
autoload :PostInstallHooksContext, 'cocoapods/installer/post_install_hooks_context'
autoload :PreInstallHooksContext, 'cocoapods/installer/pre_install_hooks_context'
autoload :SourceProviderHooksContext, 'cocoapods/installer/source_provider_hooks_context'
autoload :Migrator, 'cocoapods/installer/migrator'
autoload :PodfileValidator, 'cocoapods/installer/podfile_validator'
autoload :PodSourceInstaller, 'cocoapods/installer/pod_source_installer'
autoload :PodSourcePreparer, 'cocoapods/installer/pod_source_preparer'
......@@ -133,7 +132,6 @@ module Pod
deintegrate_if_different_major_version
sandbox.prepare
ensure_plugins_are_installed!
Migrator.migrate(sandbox)
run_plugins_pre_install_hooks
end
end
......
require 'fileutils'
module Pod
class Installer
# Migrates installations performed by previous versions of CocoaPods.
#
class Migrator
class << self
# Performs the migration.
#
# @param [Sandbox] sandbox
# The sandbox which should be migrated.
#
def migrate(sandbox)
return unless sandbox.manifest
end
# @!group Migration Steps
# @!group Private helpers
# Check whether a migration is required
#
# @param [#to_s] target_version
# See Version#new.
#
# @param [Sandbox] sandbox
# The sandbox
#
# @return [void]
#
def installation_minor?(target_version, sandbox)
sandbox.manifest.cocoapods_version < Version.new(target_version)
end
# Makes a path creating any intermediate directory and printing an UI
# message.
#
# @path [#to_s] path
# The path.
#
# @return [void]
#
def make_path(path)
return if path.exist?
UI.message "- Making path #{UI.path(path)}" do
path.mkpath
end
end
# Moves a path to another one printing an UI message.
#
# @path [#to_s] source
# The path to move.
#
# @path [#to_s] destination
# The destination path.
#
# @return [void]
#
def move(source, destination)
return unless source.exist?
make_path(destination.dirname)
UI.message "- Moving #{UI.path(source)} to #{UI.path(destination)}" do
FileUtils.mv(source.to_s, destination.to_s)
end
end
# Deletes a path, including non empty directories, printing an UI
# message.
#
# @path [#to_s] path
# The path.
#
# @return [void]
#
def delete(path)
return unless path.exist?
UI.message "- Deleting #{UI.path(path)}" do
FileUtils.rm_rf(path)
end
end
end
end
end
end
require File.expand_path('../../../spec_helper', __FILE__)
module Pod
describe Installer::Migrator do
end
end
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment