I want to integrate HP qc with my rails application, on linux OS, anybody worked on any api or ruby gem?
Thanks in advance.
Anurag Saxena.
checkout this post:
Rails Activeresource Integration
I have since rewrote the application controller as the following:
class ApplicationController < ActionController::Base
protect_from_forgery
helper_method :Sessions
$HPQC_HOST = "http://hpqc.example.com:8080"
$HPQC_REST_URL = "#{$HPQC_HOST}/qcbin/rest/domains/<your_domain>/projects/<your_project>"
$HPQC_LOGIN_URL = "#{$HPQC_HOST}/qcbin/authentication-point/authenticate"
$HPQC_LOGOUT_URL = "#{$HPQC_HOST}/qcbin/authentication-point/logout"
def allow_cross_domain_access
response.headers["Access-Control-Allow-Origin"] = "*"
response.headers["Access-Control-Allow-Methods"] = "*"
response.headers["Access-Control-Allow-Headers"] = "x-requested-with"
end
def getAuthenticatedCurl
@conn = Curl::Easy.new($HPQC_LOGIN_URL)
@conn.verbose = true
@conn.http_auth_types = :basic
@conn.userpwd = '<your_username>:<your_password>'
@conn.enable_cookies = true
@conn.cookiejar = 'cookies.txt'
@conn.perform #creates the first cookie instance, which allows subsequent calls to the HPQC API
#return _conn
puts "connected...."
end
end
Simply put these methods is your RoR app's ApplicationController and then call them from each of your Controllers to access HPQC. Then build an XML request and use the Curl::Easy Gem(i.e., @conn.post_body) to post the request to HPQC.
I plan on building an HPQC Gem to configure and initialize HPQC requests but that'll take me a little time!