jira4r是一個用來操作JIRA 問題跟蹤系統的Ruby庫。
安裝需求 (Windows下):
1. Ruby
2. soap4r (gem install soap4r)
3. jira4r (gem install jira4r)
如果(irb中) require 'jira4r' 後會出現‘XML processor module not found’的抱錯提示,其解決辦法是(windows下面)開啟C:\Ruby193\lib\ruby\gems\1.9.1\gems\soap4r-1.5.8\lib\xsd\xmlparser.rb, 其中66行的 c.downcase == name 改為 c.to_s.downcase == name
Sample Code:
# Use gem('soap4r') to ensure that this package is loaded instead of the default implementation # contained in the ruby interpreter.gem('soap4r')gem('jira4r')require 'jira4r'# 2 = the version of the WSDL interface. At present, only v2 is supported# "http://jira.atlassian.com" = The Base for your JIRA installation# The module is named Jira4R, not only Jirajira = Jira4R::JiraTool.new(2, "http://jira.yourdomain.com")# Login to the JIRAjira.login("username", "password")# Get that projectputs jira.getProjectByKey("XYZ").inspect