Class: Rubyzilla::Bugzilla
- Inherits:
-
Object
- Object
- Rubyzilla::Bugzilla
- Defined in:
- lib/rubyzilla.rb
Class Method Summary collapse
Instance Method Summary collapse
- #bug(id = nil) ⇒ Object
-
#initialize(server) ⇒ Bugzilla
constructor
A new instance of Bugzilla.
- #login(login, password) ⇒ Object
- #product(id = nil) ⇒ Object
Constructor Details
#initialize(server) ⇒ Bugzilla
Returns a new instance of Bugzilla.
9 10 11 12 |
# File 'lib/rubyzilla.rb', line 9 def initialize server @@server = XMLRPC::Client.new2(server) @@logged_in = false end |
Class Method Details
.logged_in? ⇒ Boolean
18 19 20 |
# File 'lib/rubyzilla.rb', line 18 def self.logged_in? @@logged_in end |
.server ⇒ Object
14 15 16 |
# File 'lib/rubyzilla.rb', line 14 def self.server @@server end |
Instance Method Details
#bug(id = nil) ⇒ Object
40 41 42 |
# File 'lib/rubyzilla.rb', line 40 def bug id=nil return Bug.new(id) end |
#login(login, password) ⇒ Object
22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/rubyzilla.rb', line 22 def login login, password result = @@server.call("User.login", { :login => login.chomp, :password => password.chomp, :remember => 1 }) @id = result['id'] # Workaround for Bugzilla's broken cookies. if @@server. =~ /Bugzilla_logincookie=([^;]+)/ @@server. = "Bugzilla_login=#{@id}; Bugzilla_logincookie=#{$1}" @@logged_in = true end return @@logged_in end |