jira4r:使用Ruby操作JIRA

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 Jira
jira = Jira4R::JiraTool.new(2, "http://jira.yourdomain.com")

# Login to the JIRA
jira.login("username", "password")

# Get that project
puts jira.getProjectByKey("XYZ").inspect

 

posted @ 2013-04-01 13:40  小楼  阅读(385)  评论(0编辑  收藏  举报