Ruby on rails 如何将HP Quality center与rails集成?

Ruby on rails 如何将HP Quality center与rails集成?,ruby-on-rails,ruby,hp-quality-center,Ruby On Rails,Ruby,Hp Quality Center,我想将HP qc与我的rails应用程序集成,在linux操作系统上,有人使用过任何api或ruby gem吗 提前谢谢 Anurag Saxena。我想QC OTA库存在一些限制,阻止了ROR的直接实现。但似乎有一个解决办法。查看下面的链接 查看此帖子: 此后,我将应用程序控制器改写为以下内容: class ApplicationController < ActionController::Base protect_from_forgery helper_method :Ses

我想将HP qc与我的rails应用程序集成,在linux操作系统上,有人使用过任何api或ruby gem吗

提前谢谢


Anurag Saxena。

我想QC OTA库存在一些限制,阻止了ROR的直接实现。但似乎有一个解决办法。查看下面的链接

查看此帖子:

此后,我将应用程序控制器改写为以下内容:

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
class ApplicationController
简单地说,这些方法就是RoR应用程序的ApplicationController,然后从每个控制器调用它们以访问HPQC。然后构建一个XML请求,并使用Curl::Easy Gem(即@conn.post_body)将请求发布到HPQC

我计划构建一个HPQC Gem来配置和初始化HPQC请求,但这需要一点时间