APITemplate
Bugzilla::User class is to access the Bugzilla::WebService::User API that allows you to create User Accounts and log in/out using an existing account.
Keeps the bugzilla session during doing something in the block.
# File lib/bugzilla/user.rb, line 45 def session(user, password) fname = File.join(ENV['HOME'], '.ruby-bugzilla-cookie.yml') if File.exist?(fname) && File.lstat(fname).mode & 0600 == 0600 then conf = YAML.load(File.open(fname).read) host = @iface.instance_variable_get(:@xmlrpc).instance_variable_get(:@host) cookie = conf[host] unless cookie.nil? then @iface.cookie = cookie print "Using cookie\n" yield conf[host] = @iface.cookie File.open(fname, 'w') {|f| f.chmod(0600); f.write(conf.to_yaml)} return end end if user.nil? || password.nil? then yield else login({'login'=>user, 'password'=>password, 'remember'=>true}) yield logout end end
# File lib/bugzilla/user.rb, line 106 def __create(cmd, *args) # FIXME end
# File lib/bugzilla/user.rb, line 114 def __get(cmd, *args) requires_version(cmd, 3.4) # FIXME end
# File lib/bugzilla/user.rb, line 102 def __offer_account_by_email(cmd, *args) # FIXME end
# File lib/bugzilla/user.rb, line 110 def __update(cmd, *args) # FIXME end
Raw Bugzilla API to log into Bugzilla.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/User.html
Raw Bugzilla API to log out the user.
See www.bugzilla.org/docs/tip/en/html/api/Bugzilla/WebService/User.html
# File lib/bugzilla/user.rb, line 92 def _login(cmd, *args) raise ArgumentError, "Invalid parameters" unless args[0].kind_of?(Hash) @iface.call(cmd,args[0]) end
Generated with the Darkfish Rdoc Generator 2.