lib/redmine-cli/issue.rb in redmine-cli-0.1.0 vs lib/redmine-cli/issue.rb in redmine-cli-0.1.1
- old
+ new
@@ -1,12 +1,18 @@
+require 'thor'
+require 'active_resource'
+
module Redmine
module Cli
class Issue < ActiveResource::Base
def self.config
- @config ||= Thor::CoreExt::HashWithIndifferentAccess.new(YAML.load_file(File.expand_path("~/.redmine")))
- rescue Errno::ENOENT
- puts "You need to create the file .redmine in your home with your username, password and url"
- exit(1)
+ @config ||=
+ begin
+ Thor::CoreExt::HashWithIndifferentAccess.new(YAML.load_file(File.expand_path("~/.redmine")))
+ rescue Errno::ENOENT
+ puts "You need to create the file .redmine in your home with your username, password and url"
+ Thor::CoreExt::HashWithIndifferentAccess.new
+ end
end
self.site = config.url
self.user = config.username
self.password = config.password