Commit 75227482 authored by Samuel Giddins's avatar Samuel Giddins

Merge pull request #5162 from CocoaPods/seg-sources-manager-constant-deprecation

[SourcesManager] Provide a deprecation path for access to Pod::SourcesManager
parents 96c6d8ba eddf3578
...@@ -12,12 +12,22 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -12,12 +12,22 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
##### Bug Fixes ##### Bug Fixes
* Headers from vendored frameworks no longer end up in the HEADER_SEARCH_PATH when * Headers from vendored frameworks no longer end up in the `HEADER_SEARCH_PATH`
using frameworks. They are assumed to be already present as modular headers in the when using frameworks. They are now assumed to be already present as modular
framework itself. headers in the framework itself.
[Mark Spanbroek](https://github.com/markspanbroek) [Mark Spanbroek](https://github.com/markspanbroek)
[#5146](https://github.com/CocoaPods/CocoaPods/pull/5146) [#5146](https://github.com/CocoaPods/CocoaPods/pull/5146)
* Access to the `Pod::SourcesManager` constant has been restored, though its use
is considered deprecated and subject to removal at any time. Migrate to use
`Pod::Config.instance.sources_manager` in some manner as soon as possible.
[Samuel Giddins](https://github.com/segiddins)
* Running `pod repo update --silent` will now properly silence git output while
updating the repository.
[Samuel Giddins](https://github.com/segiddins)
## 1.0.0.beta.7 (2016-04-15) ## 1.0.0.beta.7 (2016-04-15)
##### Enhancements ##### Enhancements
......
...@@ -19,7 +19,8 @@ module Pod ...@@ -19,7 +19,8 @@ module Pod
end end
def run def run
config.sources_manager.update(@name, true) show_output = !config.silent?
config.sources_manager.update(@name, show_output)
end end
end end
end end
......
...@@ -153,4 +153,35 @@ module Pod ...@@ -153,4 +153,35 @@ module Pod
UI.puts(message) UI.puts(message)
end end
end end
# @!visibility private
module SourcesManagerMissingConstant
SOURCES_MANAGER_CONSTANT_WARNINGS = Set.new
# Warn about deprecated use of `Pod::SourcesManager` and return the config's
# Source::Manager
#
# @param [#to_sym] const the missing constant
#
# @return [Pod::Source::Manager]
#
def const_missing(const)
unless const.to_sym == :SourcesManager &&
ancestors.any? { |a| a == ::Pod || a.name.start_with?('Pod::') }
return super
end
calling_line = caller.first
if Pod::SourcesManagerMissingConstant::SOURCES_MANAGER_CONSTANT_WARNINGS.add?(calling_line)
warn 'Usage of the constant `Pod::SourcesManager` is deprecated, ' \
'use `Pod::Config.instance.sources_manager` instead ' \
"(called from #{calling_line})"
end
Config.instance.sources_manager
end
end
extend SourcesManagerMissingConstant
::Object.send(:extend, SourcesManagerMissingConstant)
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