lib/morale/client.rb in morale-0.1.0 vs lib/morale/client.rb in morale-0.1.1

- old
+ new

@@ -1,14 +1,18 @@ require 'httparty' -require "json" +require 'json' +require 'morale/account' +require 'morale/connection_store' module Morale class Client class Unauthorized < RuntimeError; end class NotFound < RuntimeError; end include HTTParty + extend Morale::ConnectionStore + format :json API_VERSION = 'v1' attr_accessor :api_key @@ -39,11 +43,10 @@ end def initialize(subdomain="", api_key="") @api_key = api_key @subdomain = subdomain - #TODO: Save the domain in a config file - self.class.default_options[:base_uri] = HTTParty.normalize_base_uri("#{subdomain}#{"." unless subdomain.nil? || subdomain.empty?}lvh.me:3000/api/#{API_VERSION}") + self.class.default_options[:base_uri] = HTTParty.normalize_base_uri("#{subdomain}#{"." unless subdomain.nil? || subdomain.empty?}#{self.class.base_url}/api/#{API_VERSION}") end def projects authorize response = self.class.get('/projects') \ No newline at end of file