Skip to content

Commit

Permalink
Merge pull request #21 from CocoaPods/seg-source-metadata
Browse files Browse the repository at this point in the history
Update for removal of Pod::SourcesManager
  • Loading branch information
segiddins committed Apr 14, 2016
2 parents 34c73b0 + a2b10ba commit 26290a1
Show file tree
Hide file tree
Showing 3 changed files with 38 additions and 30 deletions.
56 changes: 30 additions & 26 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,30 +1,32 @@
GIT
remote: https://github.com/CocoaPods/CocoaPods.git
revision: 6c64eeb69443d9ab18081ad330a134cfb0e46169
revision: 6d77bb4884bf7a5a24909a26f9434ae17dfa558a
branch: master
specs:
cocoapods (0.39.0)
cocoapods (1.0.0.beta.6)
activesupport (>= 4.0.2)
claide (~> 0.9.1)
cocoapods-core (= 0.39.0)
cocoapods-downloader (~> 0.9.3)
cocoapods-plugins (~> 0.4.2)
cocoapods-search (~> 1.0.0.beta.1)
cocoapods-stats (~> 0.6.2)
cocoapods-trunk (~> 0.6.4)
cocoapods-try (~> 0.5.1)
claide (>= 1.0.0.beta.3, < 2.0)
cocoapods-core (= 1.0.0.beta.6)
cocoapods-deintegrate (>= 1.0.0.beta.1, < 2.0)
cocoapods-downloader (>= 1.0.0.beta.2, < 2.0)
cocoapods-plugins (>= 1.0.0.beta.1, < 2.0)
cocoapods-search (>= 1.0.0.beta.1, < 2.0)
cocoapods-stats (>= 1.0.0.beta.3, < 2.0)
cocoapods-trunk (>= 1.0.0.beta.2, < 2.0)
cocoapods-try (>= 1.0.0.beta.3, < 2.0)
colored (~> 1.2)
escape (~> 0.0.4)
molinillo (~> 0.4.0)
fourflusher (~> 0.3.0)
molinillo (~> 0.4.4)
nap (~> 1.0)
xcodeproj (~> 0.28.2)
xcodeproj (>= 1.0.0.beta.3, < 2.0)

GIT
remote: https://github.com/CocoaPods/Core.git
revision: 6c2544496ed201104e712dd95793ec7bc6a171e8
revision: fff02c11422963e4bce9c2796c00bd9b471d79b7
branch: master
specs:
cocoapods-core (0.39.0)
cocoapods-core (1.0.0.beta.6)
activesupport (>= 4.0.2)
fuzzy_match (~> 2.0.4)
nap (~> 1.0)
Expand All @@ -37,45 +39,47 @@ PATH
GEM
remote: https://rubygems.org/
specs:
activesupport (4.2.4)
activesupport (4.2.6)
i18n (~> 0.7)
json (~> 1.7, >= 1.7.7)
minitest (~> 5.1)
thread_safe (~> 0.3, >= 0.3.4)
tzinfo (~> 1.1)
bacon (1.2.0)
claide (0.9.1)
cocoapods-downloader (0.9.3)
cocoapods-plugins (0.4.2)
claide (1.0.0.beta.3)
cocoapods-deintegrate (1.0.0.beta.1)
cocoapods-downloader (1.0.0.beta.2)
cocoapods-plugins (1.0.0.beta.1)
nap
cocoapods-stats (0.6.2)
cocoapods-trunk (0.6.4)
cocoapods-stats (1.0.0.beta.3)
cocoapods-trunk (1.0.0.beta.2)
nap (>= 0.8, < 2.0)
netrc (= 0.7.8)
cocoapods-try (0.5.1)
cocoapods-try (1.0.0.beta.3)
colored (1.2)
escape (0.0.4)
fourflusher (0.3.0)
fuzzy_match (2.0.4)
i18n (0.7.0)
json (1.8.3)
metaclass (0.0.4)
minitest (5.7.0)
minitest (5.8.4)
mocha (1.1.0)
metaclass (~> 0.0.1)
mocha-on-bacon (0.2.2)
mocha (>= 0.13.0)
molinillo (0.4.0)
nap (1.0.0)
molinillo (0.4.4)
nap (1.1.0)
netrc (0.7.8)
prettybacon (0.0.2)
bacon (~> 1.2)
rake (10.4.2)
thread_safe (0.3.5)
tzinfo (1.2.2)
thread_safe (~> 0.1)
xcodeproj (0.28.2)
xcodeproj (1.0.0.beta.3)
activesupport (>= 3)
claide (~> 0.9.1)
claide (>= 1.0.0.beta.1, < 2.0)
colored (~> 1.2)

PLATFORMS
Expand Down
10 changes: 7 additions & 3 deletions lib/cocoapods-search/command/search.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ def self.options
end
options << ['--no-pager', 'Do not pipe search results into a pager']
options.concat(super.reject { |option, _| option == '--silent' })
end
end

def initialize(argv)
@use_regex = argv.flag?('regex')
Expand All @@ -50,7 +50,7 @@ def validate!
rescue RegexpError
help! 'A valid regular expression is required.'
end
end
end
end

def run
Expand All @@ -62,6 +62,10 @@ def run
end
end

def sources_manager
defined?(Pod::SourcesManager) ? Pod::SourcesManager : config.sources_manager
end

def web_search
queries = @platform_filters.map do |platform|
"on:#{platform}"
Expand All @@ -78,7 +82,7 @@ def local_search
result << (@use_regex ? q : Regexp.escape(q))
}.join(' ').strip

sets = SourcesManager.search_by_name(query_regex, !@simple_search)
sets = sources_manager.search_by_name(query_regex, !@simple_search)

@platform_filters.each do |platform|
sets.reject! { |set| !set.specification.available_platforms.map(&:name).include?(platform) }
Expand Down
2 changes: 1 addition & 1 deletion spec/command/search_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ module Pod
before do
@test_source = Source.new(fixture('spec-repos/test_repo'))
Source::Aggregate.any_instance.stubs(:sources).returns([@test_source])
SourcesManager.updated_search_index = nil
Config.instance.sources_manager.updated_search_index = nil
end

describe 'Search' do
Expand Down

0 comments on commit 26290a1

Please sign in to comment.