require 'uri'
+require 'cgi'
require 'net/http'
require 'multi_json'
require 'nokogiri'
# Enables a source via the Source Manager
def self.enable(source_name)
source_manager = SourceManager.new
- source_manager.enable(source_name)
+ begin
+ source_manager.enable(source_name)
+ rescue Exceptions::UnknownSourceError
+ "There is no such Source"
+ end
end
# Disables a source via the Source Manager
def self.disable(source_name)
source_manager = SourceManager.new
- source_manager.disable(source_name)
+ begin
+ source_manager.disable(source_name)
+ rescue Exceptions::UnknownSourceError
+ "There is no such Source"
+ end
end
# Resets all configuration for a source via the Source Manager
def self.reset(source_name)
source_manager = SourceManager.new
- source_manager.reset(source_name)
+ begin
+ source_manager.reset(source_name)
+ rescue Exceptions::UnknownSourceError
+ "There is no such Source"
+ end
+ end
+
+ # Returns the root of the Gem.
+ #
+ # @return [String] the root path for this gem
+ def self.root
+ File.expand_path('../..',__FILE__)
end
end