aboutsummaryrefslogtreecommitdiffstats
path: root/Library/Homebrew/cmd
diff options
context:
space:
mode:
Diffstat (limited to 'Library/Homebrew/cmd')
-rw-r--r--Library/Homebrew/cmd/info.rb7
-rw-r--r--Library/Homebrew/cmd/search.rb4
2 files changed, 5 insertions, 6 deletions
diff --git a/Library/Homebrew/cmd/info.rb b/Library/Homebrew/cmd/info.rb
index de98d692c..b5f133dfd 100644
--- a/Library/Homebrew/cmd/info.rb
+++ b/Library/Homebrew/cmd/info.rb
@@ -3,6 +3,7 @@ require 'tab'
require 'keg'
require 'caveats'
require 'blacklist'
+require 'utils/json'
module Homebrew extend self
def info
@@ -46,14 +47,12 @@ module Homebrew extend self
end
def print_json
- require 'vendor/multi_json'
-
formulae = ARGV.include?("--all") ? Formula : ARGV.formulae
json = formulae.map {|f| f.to_hash}
if json.size == 1
- puts MultiJson.encode json.pop
+ puts Utils::JSON.dump(json.pop)
else
- puts MultiJson.encode json
+ puts Utils::JSON.dump(json)
end
end
diff --git a/Library/Homebrew/cmd/search.rb b/Library/Homebrew/cmd/search.rb
index 0ac76e435..2ec8afd81 100644
--- a/Library/Homebrew/cmd/search.rb
+++ b/Library/Homebrew/cmd/search.rb
@@ -1,7 +1,7 @@
require 'formula'
require 'blacklist'
require 'utils'
-require 'vendor/multi_json'
+require 'utils/json'
module Homebrew extend self
def search
@@ -73,7 +73,7 @@ module Homebrew extend self
results = []
GitHub.open "https://api.github.com/repos/#{user}/homebrew-#{repo}/git/trees/HEAD?recursive=1" do |f|
user.downcase! if user == "Homebrew" # special handling for the Homebrew organization
- MultiJson.decode(f.read)["tree"].map{ |hash| hash['path'] }.compact.each do |file|
+ Utils::JSON.load(f.read)["tree"].map{ |hash| hash['path'] }.compact.each do |file|
name = File.basename(file, '.rb')
if file =~ /\.rb$/ and name =~ rx
results << "#{user}/#{repo}/#{name}"