Skip to content

Commit

Permalink
Merge pull request #670 from jasl/remove-forked-json-gem
Browse files Browse the repository at this point in the history
Use Ruby bundled json gem instead of forked
  • Loading branch information
amorde authored Jan 14, 2021
2 parents 9584a94 + fec4d27 commit c73c1f8
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 13 deletions.
5 changes: 0 additions & 5 deletions Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,6 @@ source 'https://rubygems.org'

gemspec

# This is the version that ships with OS X 10.10, so be sure we test against it.
# At the same time, the 1.7.7 version won't install cleanly on Ruby > 2.2,
# so we use a fork that makes a trivial change to a macro invocation.
gem 'json', :git => 'https://github.com/segiddins/json.git', :branch => 'seg-1.7.7-ruby-2.2'

group :development do
gem 'bacon'
gem 'mocha', '< 1.5'
Expand Down
9 changes: 1 addition & 8 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -1,10 +1,3 @@
GIT
remote: https://github.com/segiddins/json.git
revision: a9588bc4334c2f5bf985f255b61c05eafdcd8907
branch: seg-1.7.7-ruby-2.2
specs:
json (1.7.7)

PATH
remote: .
specs:
Expand Down Expand Up @@ -46,6 +39,7 @@ GEM
httpclient (2.8.3)
i18n (1.8.7)
concurrent-ruby (~> 1.0)
json (2.5.1)
kicker (3.0.0)
listen (~> 1.3.0)
notify (~> 0.5.2)
Expand Down Expand Up @@ -108,7 +102,6 @@ DEPENDENCIES
awesome_print
bacon
cocoapods-core!
json!
kicker
mocha (< 1.5)
mocha-on-bacon
Expand Down
5 changes: 5 additions & 0 deletions lib/cocoapods-core/source/manager.rb
Original file line number Diff line number Diff line change
Expand Up @@ -265,6 +265,11 @@ def stored_search_index
require 'json'
begin
index = JSON.parse(search_index_path.read)
unless index # JSON.parse("null") => nil
search_index_path.delete
return nil
end

index if index.is_a?(Hash) # TODO: should we also check if hash has correct hierarchy?
rescue JSON::ParserError
search_index_path.delete
Expand Down

0 comments on commit c73c1f8

Please sign in to comment.