public
Rubygem
Description: Take FogBugz offline with you
Clone URL: git://github.com/francois/fogbugz_offline.git
fogbugz_offline / lib / fogbugz_offline.rb
100644 32 lines (26 sloc) 0.854 kb
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
require "fogbugz_offline/config"
require "fogbugz_offline/connection"
require "fogbugz_offline/commands"
 
module FogbugzOffline
  def self.config
    FogbugzOffline::Config.instance
  end
 
  def self.connection_to(url)
    FogbugzOffline::Connection.new(url)
  end
 
  class NoValidToken < RuntimeError
    def initialize(url)
      super("You have never logged in to #{url}.\n fogbugz_offline login --email you@yourdomain.com --password thepassword #{url}\n\nwill generate a token for you.")
    end
  end
 
  class NoApiAtLocation < RuntimeError
    def initialize(url)
      super("The URL #{url} does not seem to be a valid FogBugz install.")
    end
  end
 
  class InvalidApiResponse < RuntimeError
    def initialize(url, response)
      super("The URL #{url} returned an unpexected response: I expected XML, I got:\n#{response}")
    end
  end
end