lib/pod/command/plugins_helper.rb in cocoapods-plugins-0.3.1 vs lib/pod/command/plugins_helper.rb in cocoapods-plugins-0.3.2
- old
+ new
@@ -5,11 +5,11 @@
# This module is used by Command::Plugins::List
# and Command::Plugins::Search to download and parse
# the JSON describing the plugins list and manipulate it
#
module PluginsHelper
- PLUGINS_JSON_REPO_NAME = 'CocoaPods/cocoapods.org'
+ PLUGINS_JSON_REPO_NAME = 'CocoaPods/cocoapods-plugins'
PLUGINS_JSON_REPO = 'https://github.com/' + PLUGINS_JSON_REPO_NAME
PLUGINS_JSON_REL_URL = '/master/plugins.json'
PLUGINS_RAW_URL = 'https://raw.githubusercontent.com/' \
+ PLUGINS_JSON_REPO_NAME + PLUGINS_JSON_REL_URL
@@ -18,21 +18,22 @@
#
# @return [Hash] The hash representing the JSON with all known plugins
#
def self.download_json
UI.puts 'Downloading Plugins list...'
+ puts PLUGINS_RAW_URL
response = REST.get(PLUGINS_RAW_URL)
if response.ok?
parse_json(response.body)
else
raise Informative, 'Could not download plugins list ' \
- "from cocoapods.org: #{response.inspect}"
+ "from cocoapods-plugins: #{response.inspect}"
end
end
# The list of all known plugins, according to
- # the JSON hosted on github's cocoapods.org
+ # the JSON hosted on github's cocoapods-plugins
#
# @return [Array] all known plugins, as listed in the downloaded JSON
#
def self.known_plugins
json = download_json
@@ -110,10 +111,10 @@
# The string representation of the JSON to parse
#
def self.parse_json(json_str)
JSON.parse(json_str)
rescue JSON::ParserError => e
- raise Informative, "Invalid plugins list from cocoapods.org: #{e}"
+ raise Informative, "Invalid plugins list from cocoapods-plugins: #{e}"
end
# Format the title line to print the plugin info with print_plugin
# coloring it according to whether the plugin is installed or not
#