Commit f5fd3d24 authored by Samuel Giddins's avatar Samuel Giddins Committed by GitHub

Merge pull request #6141 from CocoaPods/seg-sources-mananger-const-hack

[SourcesManager] Remove const_missing hack
parents c2aa84f5 0b0d708f
...@@ -27,6 +27,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre` ...@@ -27,6 +27,9 @@ To install release candidates run `[sudo] gem install cocoapods --pre`
* Fail gracefully when downloading a podspec in `pod spec lint` fails. * Fail gracefully when downloading a podspec in `pod spec lint` fails.
[Samuel Giddins](https://github.com/segiddins) [Samuel Giddins](https://github.com/segiddins)
* Remove the `const_missing` hack for `Pod::SourcesManager`.
[Samuel Giddins](https://github.com/segiddins)
## 1.2.0.beta.1 (2016-10-28) ## 1.2.0.beta.1 (2016-10-28)
......
...@@ -150,35 +150,4 @@ module Pod ...@@ -150,35 +150,4 @@ 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