lib/claide/command/plugins_helper.rb in claide-plugins-0.9.0 vs lib/claide/command/plugins_helper.rb in claide-plugins-0.9.1
- old
+ new
@@ -9,10 +9,14 @@
module PluginsHelper
def self.plugins_raw_url
CLAide::Plugins.config.plugin_list_url
end
+ def self.plugin_prefix
+ CLAide::Plugins.config.plugin_prefix
+ end
+
# Force-download the JSON
#
# @return [Hash] The hash representing the JSON with all known plugins
#
def self.download_json
@@ -20,11 +24,11 @@
response = REST.get(plugins_raw_url)
if response.ok?
parse_json(response.body)
else
raise Informative, 'Could not download plugins list ' \
- "from cocoapods-plugins: #{response.inspect}"
+ "from #{plugin_prefix}-plugins: #{response.inspect}"
end
end
# The list of all known plugins, according to
# the JSON hosted on github's cocoapods-plugins
@@ -107,10 +111,11 @@
# 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-plugins: #{e}"
+ raise Informative,
+ "Invalid plugins list from #{plugin_prefix}-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
#