rallycat 0.4.0 → 0.4.1
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile +0 -6
- data/Gemfile.lock +3 -9
- data/TODO +3 -3
- data/lib/rallycat/cat.rb +2 -2
- data/lib/rallycat/connection.rb +4 -4
- data/lib/rallycat/list.rb +10 -10
- data/lib/rallycat/version.rb +1 -1
- data/rallycat.gemspec +3 -0
- data/spec/rallycat/cat_spec.rb +2 -22
- data/spec/rallycat/cli_spec.rb +8 -8
- data/spec/rallycat/update_spec.rb +27 -29
- data/spec/spec_helper.rb +0 -1
- data/spec/support/rally_auth_responder.rb +4 -2
- data/spec/support/rally_defect_responder.rb +4 -2
- data/spec/support/rally_iterations_responder.rb +72 -66
- data/spec/support/rally_stories_responder.rb +83 -77
- data/spec/support/rally_story_responder.rb +8 -7
- data/spec/support/rally_task_update_responder.rb +56 -42
- metadata +43 -10
data/Gemfile
CHANGED
data/Gemfile.lock
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
PATH
|
2
2
|
remote: .
|
3
3
|
specs:
|
4
|
-
rallycat (0.4.
|
4
|
+
rallycat (0.4.1)
|
5
5
|
builder
|
6
6
|
nokogiri
|
7
7
|
rally_rest_api
|
@@ -12,17 +12,12 @@ GEM
|
|
12
12
|
artifice (0.6)
|
13
13
|
rack-test
|
14
14
|
builder (3.0.0)
|
15
|
-
coderay (1.0.6)
|
16
15
|
diff-lcs (1.1.3)
|
17
|
-
method_source (0.7.1)
|
18
16
|
nokogiri (1.5.5)
|
19
|
-
pry (0.9.9.6)
|
20
|
-
coderay (~> 1.0.5)
|
21
|
-
method_source (~> 0.7.1)
|
22
|
-
slop (>= 2.4.4, < 3)
|
23
17
|
rack (1.4.1)
|
24
18
|
rack-test (0.6.1)
|
25
19
|
rack (>= 1.0)
|
20
|
+
rake (0.9.2.2)
|
26
21
|
rally_rest_api (1.0.3)
|
27
22
|
rspec (2.10.0)
|
28
23
|
rspec-core (~> 2.10.0)
|
@@ -32,13 +27,12 @@ GEM
|
|
32
27
|
rspec-expectations (2.10.0)
|
33
28
|
diff-lcs (~> 1.1.3)
|
34
29
|
rspec-mocks (2.10.1)
|
35
|
-
slop (2.4.4)
|
36
30
|
|
37
31
|
PLATFORMS
|
38
32
|
ruby
|
39
33
|
|
40
34
|
DEPENDENCIES
|
41
35
|
artifice
|
42
|
-
|
36
|
+
rake
|
43
37
|
rallycat!
|
44
38
|
rspec
|
data/TODO
CHANGED
@@ -8,11 +8,9 @@
|
|
8
8
|
* Slow as balls? Make nice wait messages
|
9
9
|
* Add man page
|
10
10
|
* Create .rallycatrc file on first run?
|
11
|
-
* Listing stories
|
12
|
-
* Per iteration
|
13
|
-
* Per project (project configured in rc or passed in?)
|
14
11
|
* AC-only story view
|
15
12
|
* consolidate spec styles
|
13
|
+
* rallycat list stories are colored based on schedule state
|
16
14
|
|
17
15
|
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
|
18
16
|
|
@@ -20,6 +18,8 @@
|
|
20
18
|
|
21
19
|
rallycat list -s <search phrase> # do a contains lookup for an iteration
|
22
20
|
|
21
|
+
rallycat list -pdacb # Filter by schedule states
|
22
|
+
|
23
23
|
Keep a log of last (n) stories typed into `cat` so the default action for
|
24
24
|
`rallycat cat` will list the last (n) stories for the user.
|
25
25
|
|
data/lib/rallycat/cat.rb
CHANGED
@@ -10,7 +10,7 @@ module Rallycat
|
|
10
10
|
def story(story_number)
|
11
11
|
story_type = story_number.start_with?('US') ? :hierarchical_requirement : :defect
|
12
12
|
|
13
|
-
results = @rally_api.find(story_type, fetch
|
13
|
+
results = @rally_api.find(story_type, :fetch => true) do
|
14
14
|
equal :formatted_id, story_number
|
15
15
|
end
|
16
16
|
|
@@ -57,7 +57,7 @@ TEXT
|
|
57
57
|
# [TA12345] [C] The name of the task.
|
58
58
|
#
|
59
59
|
sorted_tasks.map do |task|
|
60
|
-
state = task.state == 'In-Progress' ? 'P' : task.state[0]
|
60
|
+
state = task.state == 'In-Progress' ? 'P' : task.state.split('')[0]
|
61
61
|
"[#{task.formatted_i_d}] [#{state}] #{task.name}"
|
62
62
|
end.join("\n")
|
63
63
|
end
|
data/lib/rallycat/connection.rb
CHANGED
@@ -16,10 +16,10 @@ module Rallycat
|
|
16
16
|
logger = ENV['RALLY_DEBUG'] ? Logger.new(STDOUT) : Logger.new(nil)
|
17
17
|
|
18
18
|
@api = RallyRestAPI.new \
|
19
|
-
base_url
|
20
|
-
username
|
21
|
-
password
|
22
|
-
logger
|
19
|
+
:base_url => 'https://rally1.rallydev.com/slm',
|
20
|
+
:username => username,
|
21
|
+
:password => password,
|
22
|
+
:logger => logger
|
23
23
|
|
24
24
|
rescue Rally::NotAuthenticatedError
|
25
25
|
raise InvalidCredentialsError.new('Your Rally credentials are invalid.')
|
data/lib/rallycat/list.rb
CHANGED
@@ -14,9 +14,9 @@ module Rallycat
|
|
14
14
|
project = find_project(project_name)
|
15
15
|
|
16
16
|
iterations = @api.find_all(:iteration, {
|
17
|
-
project
|
18
|
-
order
|
19
|
-
pagesize
|
17
|
+
:project => project,
|
18
|
+
:order => 'StartDate desc',
|
19
|
+
:pagesize => 10
|
20
20
|
}).results
|
21
21
|
|
22
22
|
if iterations.count == 0
|
@@ -43,15 +43,15 @@ module Rallycat
|
|
43
43
|
iteration = find_iteration(iteration_name, project)
|
44
44
|
|
45
45
|
stories = @api.find(:hierarchical_requirement, {
|
46
|
-
project
|
47
|
-
pagesize
|
48
|
-
fetch
|
46
|
+
:project => project,
|
47
|
+
:pagesize => 100,
|
48
|
+
:fetch => true
|
49
49
|
}) { equal :iteration, iteration }.results
|
50
50
|
|
51
51
|
stories += @api.find(:defect, {
|
52
|
-
project
|
53
|
-
pagesize
|
54
|
-
fetch
|
52
|
+
:project => project,
|
53
|
+
:pagesize => 100,
|
54
|
+
:fetch => true
|
55
55
|
}) { equal :iteration, iteration }.results
|
56
56
|
|
57
57
|
if stories.count == 0
|
@@ -61,7 +61,7 @@ module Rallycat
|
|
61
61
|
list = %{# Stories for iteration "#{iteration_name}" - "#{project_name}"\n\n}
|
62
62
|
|
63
63
|
stories.each do |story|
|
64
|
-
state = story.schedule_state == 'In-Progress' ? 'P' : story.schedule_state[0]
|
64
|
+
state = story.schedule_state == 'In-Progress' ? 'P' : story.schedule_state.split('')[0]
|
65
65
|
list += "* [#{story.formatted_i_d}] [#{state}] #{story.name}\n"
|
66
66
|
end
|
67
67
|
|
data/lib/rallycat/version.rb
CHANGED
data/rallycat.gemspec
CHANGED
data/spec/rallycat/cat_spec.rb
CHANGED
@@ -4,12 +4,7 @@ require 'cgi'
|
|
4
4
|
describe Rallycat::Cat, '#story' do
|
5
5
|
|
6
6
|
before do
|
7
|
-
|
8
|
-
# 'https://rally1.rallydev.com/slm/webservice/current/user'
|
9
|
-
[200, {}, ['<foo>bar</foo>']]
|
10
|
-
end
|
11
|
-
|
12
|
-
Artifice.activate_with responder do
|
7
|
+
Artifice.activate_with RallyAuthResponder.new do
|
13
8
|
@api = Rallycat::Connection.new('foo.bar@rallycat.com', 'password').api
|
14
9
|
end
|
15
10
|
end
|
@@ -127,22 +122,7 @@ STORY
|
|
127
122
|
end
|
128
123
|
|
129
124
|
it 'raises when the story does not exist' do
|
130
|
-
|
131
|
-
[200, {}, [
|
132
|
-
<<-XML
|
133
|
-
<QueryResult rallyAPIMajor="1" rallyAPIMinor="17">
|
134
|
-
<Errors/>
|
135
|
-
<Warnings/>
|
136
|
-
<TotalResultCount>0</TotalResultCount>
|
137
|
-
<StartIndex>1</StartIndex>
|
138
|
-
<PageSize>20</PageSize>
|
139
|
-
<Results/>
|
140
|
-
</QueryResult>
|
141
|
-
XML
|
142
|
-
]]
|
143
|
-
end
|
144
|
-
|
145
|
-
Artifice.activate_with responder do
|
125
|
+
Artifice.activate_with RallyNoResultsResponder.new do
|
146
126
|
story_num = "US9999"
|
147
127
|
cat = Rallycat::Cat.new(@api)
|
148
128
|
|
data/spec/rallycat/cli_spec.rb
CHANGED
@@ -27,8 +27,8 @@ describe Rallycat::CLI, '#options' do
|
|
27
27
|
cli = Rallycat::CLI.new %w{ -u foo.bar@rallycat.com -p password help }, sout
|
28
28
|
|
29
29
|
cli.options.should == {
|
30
|
-
username
|
31
|
-
password
|
30
|
+
:username => 'foo.bar@rallycat.com',
|
31
|
+
:password => 'password'
|
32
32
|
}
|
33
33
|
end
|
34
34
|
|
@@ -45,10 +45,10 @@ describe Rallycat::CLI, '#options' do
|
|
45
45
|
cli = Rallycat::CLI.new %w{ -u foo.bar@rallycat.com -p password update -p TA6666 -b }, sout
|
46
46
|
|
47
47
|
cli.options.should == {
|
48
|
-
username
|
49
|
-
password
|
50
|
-
in_progress
|
51
|
-
blocked
|
48
|
+
:username => 'foo.bar@rallycat.com',
|
49
|
+
:password => 'password',
|
50
|
+
:in_progress => true,
|
51
|
+
:blocked => true
|
52
52
|
}
|
53
53
|
end
|
54
54
|
|
@@ -57,8 +57,8 @@ describe Rallycat::CLI, '#options' do
|
|
57
57
|
cli = Rallycat::CLI.new %w{ update TA6666 -pb }, sout
|
58
58
|
|
59
59
|
cli.options.should == {
|
60
|
-
in_progress
|
61
|
-
blocked
|
60
|
+
:in_progress => true,
|
61
|
+
:blocked => true
|
62
62
|
}
|
63
63
|
end
|
64
64
|
end
|
@@ -1,13 +1,12 @@
|
|
1
1
|
require 'spec_helper'
|
2
2
|
|
3
3
|
describe Rallycat::Update do
|
4
|
-
|
5
|
-
|
6
|
-
|
7
|
-
[200, {}, ['<foo>bar</foo>']]
|
8
|
-
end
|
4
|
+
def get_post_request(responder)
|
5
|
+
responder.requests.detect {|request| request.post? }
|
6
|
+
end
|
9
7
|
|
10
|
-
|
8
|
+
before do
|
9
|
+
Artifice.activate_with RallyAuthResponder.new do
|
11
10
|
@api = Rallycat::Connection.new('foo.bar@rallycat.com', 'password').api
|
12
11
|
end
|
13
12
|
end
|
@@ -21,12 +20,12 @@ describe Rallycat::Update do
|
|
21
20
|
Artifice.activate_with responder do
|
22
21
|
task_num = "TA6666"
|
23
22
|
update = Rallycat::Update.new(@api)
|
24
|
-
update.task(task_num, state
|
23
|
+
update.task(task_num, :state => "In-Progress")
|
25
24
|
end
|
26
25
|
|
27
|
-
post_request = responder
|
28
|
-
|
29
|
-
post_request.
|
26
|
+
post_request = get_post_request(responder)
|
27
|
+
|
28
|
+
post_request.path.should == '/slm/webservice/1.17/task/12345'
|
30
29
|
|
31
30
|
body = post_request.body.tap(&:rewind).read
|
32
31
|
body.should include('<Blocked>false</Blocked>')
|
@@ -40,13 +39,13 @@ describe Rallycat::Update do
|
|
40
39
|
Artifice.activate_with responder do
|
41
40
|
task_num = "TA6666"
|
42
41
|
update = Rallycat::Update.new(@api)
|
43
|
-
message = update.task(task_num, state
|
42
|
+
message = update.task(task_num, :state => "In-Progress", :blocked => true)
|
44
43
|
message.should include('Task (TA6666) was set to "In-Progress"')
|
45
44
|
end
|
46
45
|
|
47
|
-
post_request = responder
|
48
|
-
|
49
|
-
post_request.
|
46
|
+
post_request = get_post_request(responder)
|
47
|
+
|
48
|
+
post_request.path.should == '/slm/webservice/1.17/task/12345'
|
50
49
|
|
51
50
|
body = post_request.body.tap(&:rewind).read
|
52
51
|
body.should include('<Blocked>true</Blocked>')
|
@@ -59,12 +58,12 @@ describe Rallycat::Update do
|
|
59
58
|
Artifice.activate_with responder do
|
60
59
|
task_num = "TA6666"
|
61
60
|
update = Rallycat::Update.new(@api)
|
62
|
-
message = update.task(task_num, state
|
61
|
+
message = update.task(task_num, :state => "Completed")
|
63
62
|
end
|
64
63
|
|
65
|
-
post_request = responder
|
66
|
-
|
67
|
-
post_request.
|
64
|
+
post_request = get_post_request(responder)
|
65
|
+
|
66
|
+
post_request.path.should == '/slm/webservice/1.17/task/12345'
|
68
67
|
|
69
68
|
body = post_request.body.tap(&:rewind).read
|
70
69
|
body.should include('<State>Completed</State>')
|
@@ -78,13 +77,13 @@ describe Rallycat::Update do
|
|
78
77
|
Artifice.activate_with responder do
|
79
78
|
task_num = "TA6666"
|
80
79
|
update = Rallycat::Update.new(@api)
|
81
|
-
message = update.task(task_num, blocked
|
80
|
+
message = update.task(task_num, :blocked => true)
|
82
81
|
message.should include('Task (TA6666) was blocked.')
|
83
82
|
end
|
84
83
|
|
85
|
-
post_request = responder
|
86
|
-
|
87
|
-
post_request.
|
84
|
+
post_request = get_post_request(responder)
|
85
|
+
|
86
|
+
post_request.path.should == '/slm/webservice/1.17/task/12345'
|
88
87
|
|
89
88
|
body = post_request.body.tap(&:rewind).read
|
90
89
|
body.should include('<Blocked>true</Blocked>')
|
@@ -96,13 +95,13 @@ describe Rallycat::Update do
|
|
96
95
|
Artifice.activate_with responder do
|
97
96
|
task_num = "TA6666"
|
98
97
|
update = Rallycat::Update.new(@api)
|
99
|
-
message = update.task(task_num, state
|
98
|
+
message = update.task(task_num, :state => 'Completed', :owner => 'Freddy Fender')
|
100
99
|
message.should include('Task (TA6666) was assigned to "Freddy Fender"')
|
101
100
|
end
|
102
101
|
|
103
|
-
post_request = responder
|
104
|
-
|
105
|
-
post_request.
|
102
|
+
post_request = get_post_request(responder)
|
103
|
+
|
104
|
+
post_request.path.should == '/slm/webservice/1.17/task/12345'
|
106
105
|
|
107
106
|
body = post_request.body.tap(&:rewind).read
|
108
107
|
body.should include('<State>Completed</State>')
|
@@ -118,7 +117,7 @@ describe Rallycat::Update do
|
|
118
117
|
update = Rallycat::Update.new(@api)
|
119
118
|
|
120
119
|
lambda {
|
121
|
-
update.task(task_num, state
|
120
|
+
update.task(task_num, :state => 'Completed', :owner => 'Norman Notreal')
|
122
121
|
}.should raise_error(Rallycat::UserNotFound, 'User (Norman Notreal) does not exist.')
|
123
122
|
end
|
124
123
|
end
|
@@ -131,9 +130,8 @@ describe Rallycat::Update do
|
|
131
130
|
update = Rallycat::Update.new(@api)
|
132
131
|
|
133
132
|
lambda {
|
134
|
-
update.task(task_num, state
|
133
|
+
update.task(task_num, :state => 'Completed')
|
135
134
|
}.should raise_error(Rallycat::TaskNotFound, 'Task (TA6666) does not exist.')
|
136
135
|
end
|
137
|
-
|
138
136
|
end
|
139
137
|
end
|
data/spec/spec_helper.rb
CHANGED
@@ -2,10 +2,12 @@ class RallyAuthResponder < GenericResponder
|
|
2
2
|
|
3
3
|
def call(env)
|
4
4
|
@requests << request = Rack::Request.new(env)
|
5
|
-
|
5
|
+
|
6
|
+
case request.path
|
7
|
+
when '/slm/webservice/current/user'
|
6
8
|
[200, {}, ['<User><DisplayName></DisplayName></User>']]
|
7
9
|
else
|
8
|
-
[500, {}, ['
|
10
|
+
[500, {}, ['No user was found']]
|
9
11
|
end
|
10
12
|
end
|
11
13
|
end
|
@@ -3,8 +3,8 @@ class RallyDefectResponder < GenericResponder
|
|
3
3
|
def call(env)
|
4
4
|
@requests << request = Rack::Request.new(env)
|
5
5
|
|
6
|
-
case request.
|
7
|
-
when "
|
6
|
+
case request.path
|
7
|
+
when "/slm/webservice/current/Defect"
|
8
8
|
[200, {}, [
|
9
9
|
<<-XML
|
10
10
|
<QueryResult>
|
@@ -25,6 +25,8 @@ class RallyDefectResponder < GenericResponder
|
|
25
25
|
</QueryResult>
|
26
26
|
XML
|
27
27
|
]]
|
28
|
+
else
|
29
|
+
RallyNoResultsResponder.new.call(env)
|
28
30
|
end
|
29
31
|
end
|
30
32
|
end
|
@@ -3,72 +3,78 @@ class RallyIterationsResponder < GenericResponder
|
|
3
3
|
def call(env)
|
4
4
|
@requests << request = Rack::Request.new(env)
|
5
5
|
|
6
|
-
case request.
|
7
|
-
when '
|
8
|
-
[
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
<
|
13
|
-
<
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
[
|
21
|
-
|
22
|
-
|
23
|
-
<
|
24
|
-
<
|
25
|
-
<
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
6
|
+
case request.path
|
7
|
+
when '/slm/webservice/current/Project'
|
8
|
+
if request.params["query"].include? "SuperBad"
|
9
|
+
[200, {}, [
|
10
|
+
<<-XML
|
11
|
+
<QueryResult>
|
12
|
+
<Results>
|
13
|
+
<Object ref="/slm/webservice/1.36/project/777555" type="Project">
|
14
|
+
<Name>SuperBad</Name>
|
15
|
+
</Object>
|
16
|
+
</Results>
|
17
|
+
</QueryResult>
|
18
|
+
XML
|
19
|
+
]]
|
20
|
+
elsif request.params["query"].include? "SuperAwful"
|
21
|
+
[200, {}, [
|
22
|
+
<<-XML
|
23
|
+
<QueryResult>
|
24
|
+
<Results>
|
25
|
+
<Object ref="/slm/webservice/1.36/project/888444" type="Project">
|
26
|
+
<Name>SuperAwful</Name>
|
27
|
+
</Object>
|
28
|
+
</Results>
|
29
|
+
</QueryResult>
|
30
|
+
XML
|
31
|
+
]]
|
32
|
+
else
|
33
|
+
RallyNoResultsResponder.new.call(env)
|
34
|
+
end
|
35
|
+
when '/slm/webservice/current/Iteration'
|
36
|
+
if request.params["project"].include? "777555" # Project ID
|
37
|
+
[200, {}, [
|
38
|
+
<<-XML
|
39
|
+
<QueryResult>
|
40
|
+
<Results>
|
41
|
+
<Object type="Iteration">
|
42
|
+
<Name>25 (2012-05-01 to 2012-05-05)</Name>
|
43
|
+
</Object>
|
44
|
+
<Object type="Iteration">
|
45
|
+
<Name>25 (2012-05-01 to 2012-05-05)</Name>
|
46
|
+
</Object>
|
47
|
+
<Object type="Iteration">
|
48
|
+
<Name>24 (2012-04-01 to 2012-04-05)</Name>
|
49
|
+
</Object>
|
50
|
+
<Object type="Iteration">
|
51
|
+
<Name>24 (2012-04-01 to 2012-04-05)</Name>
|
52
|
+
</Object>
|
53
|
+
<Object type="Iteration">
|
54
|
+
<Name>23 (2012-03-01 to 2012-03-05)</Name>
|
55
|
+
</Object>
|
56
|
+
<Object type="Iteration">
|
57
|
+
<Name>23 (2012-03-01 to 2012-03-05)</Name>
|
58
|
+
</Object>
|
59
|
+
<Object type="Iteration">
|
60
|
+
<Name>22 (2012-02-01 to 2012-02-05)</Name>
|
61
|
+
</Object>
|
62
|
+
<Object type="Iteration">
|
63
|
+
<Name>22 (2012-02-01 to 2012-02-05)</Name>
|
64
|
+
</Object>
|
65
|
+
<Object type="Iteration">
|
66
|
+
<Name>21 (2012-01-01 to 2012-01-05)</Name>
|
67
|
+
</Object>
|
68
|
+
<Object type="Iteration">
|
69
|
+
<Name>21 (2012-01-01 to 2012-01-05)</Name>
|
70
|
+
</Object>
|
71
|
+
</Results>
|
72
|
+
</QueryResult>
|
73
|
+
XML
|
74
|
+
]]
|
75
|
+
else
|
76
|
+
RallyNoResultsResponder.new.call(env)
|
77
|
+
end
|
72
78
|
else
|
73
79
|
RallyNoResultsResponder.new.call(env)
|
74
80
|
end
|
@@ -3,18 +3,22 @@ class RallyStoriesResponder < GenericResponder
|
|
3
3
|
def call(env)
|
4
4
|
@requests << request = Rack::Request.new(env)
|
5
5
|
|
6
|
-
case request.
|
7
|
-
when '
|
8
|
-
[
|
9
|
-
|
10
|
-
|
11
|
-
<
|
12
|
-
<
|
13
|
-
|
14
|
-
|
15
|
-
|
16
|
-
|
17
|
-
|
6
|
+
case request.path
|
7
|
+
when '/slm/webservice/current/Project'
|
8
|
+
if request.params["query"].include? "SuperBad"
|
9
|
+
[200, {}, [
|
10
|
+
<<-XML
|
11
|
+
<QueryResult>
|
12
|
+
<Results>
|
13
|
+
<Object ref="https://rally1.rallydev.com/slm/webservice/1.17/project/777555" type="Project" />
|
14
|
+
</Results>
|
15
|
+
</QueryResult>
|
16
|
+
XML
|
17
|
+
]]
|
18
|
+
else
|
19
|
+
RallyNoResultsResponder.new.call(env)
|
20
|
+
end
|
21
|
+
when '/slm/webservice/1.17/project/777555'
|
18
22
|
[200, {}, [
|
19
23
|
<<-XML
|
20
24
|
<Project ref="https://rally1.rallydev.com/slm/webservice/1.17/project/777555">
|
@@ -22,77 +26,79 @@ class RallyStoriesResponder < GenericResponder
|
|
22
26
|
</Project>
|
23
27
|
XML
|
24
28
|
]]
|
25
|
-
when '
|
26
|
-
[
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
</
|
34
|
-
|
35
|
-
|
36
|
-
]
|
37
|
-
|
29
|
+
when '/slm/webservice/current/Iteration'
|
30
|
+
if request.params["query"].include? '25 (2012-05-01 to 2012-05-05)'
|
31
|
+
[200, {}, [
|
32
|
+
<<-XML
|
33
|
+
<QueryResult>
|
34
|
+
<Results>
|
35
|
+
<Object ref="https://rally1.rallydev.com/slm/webservice/1.17/iteration/1234" type="Iteration" />
|
36
|
+
</Results>
|
37
|
+
</QueryResult>
|
38
|
+
XML
|
39
|
+
]]
|
40
|
+
elsif request.params["query"].include? '26 (2012-06-01 to 2012-06-05)'
|
41
|
+
[200, {}, [
|
42
|
+
<<-XML
|
43
|
+
<QueryResult>
|
44
|
+
<Results>
|
45
|
+
<Object ref="https://rally1.rallydev.com/slm/webservice/1.17/iteration/7890" type="Iteration" />
|
46
|
+
</Results>
|
47
|
+
</QueryResult>
|
48
|
+
XML
|
49
|
+
]]
|
50
|
+
else
|
51
|
+
RallyNoResultsResponder.new.call(env)
|
52
|
+
end
|
53
|
+
when '/slm/webservice/1.17/iteration/1234'
|
38
54
|
[200, {}, [
|
39
55
|
<<-XML
|
40
|
-
<Iteration>
|
56
|
+
<Iteration ref="https://https://rally1.rallydev.com/slm/webservice/1.17/iteration/1234">
|
41
57
|
<Name>25 (2012-05-01 to 2012-05-05)</Name>
|
42
58
|
</Iteration>
|
43
59
|
XML
|
44
60
|
]]
|
45
|
-
when '
|
46
|
-
[
|
47
|
-
|
48
|
-
|
49
|
-
<
|
50
|
-
<
|
51
|
-
<
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
<
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
77
|
-
|
78
|
-
|
79
|
-
|
80
|
-
|
81
|
-
|
82
|
-
|
83
|
-
|
84
|
-
|
85
|
-
|
86
|
-
<Results>
|
87
|
-
<Object ref="https://rally1.rallydev.com/slm/webservice/1.17/iteration/7890" type="Iteration" />
|
88
|
-
</Results>
|
89
|
-
</QueryResult>
|
90
|
-
XML
|
91
|
-
]]
|
92
|
-
when 'https://rally1.rallydev.com/slm/webservice/1.17/iteration/7890'
|
93
|
-
# does nothing WTF(but will make tests fail if not here)???
|
94
|
-
when 'https://rally1.rallydev.com/slm/webservice/current/HierarchicalRequirement?query=%28Iteration+%3D+https%3A%2F%2Frally1.rallydev.com%2Fslm%2Fwebservice%2F1.17%2Fiteration%2F7890%29&project=https%3A%2F%2Frally1.rallydev.com%2Fslm%2Fwebservice%2F1.17%2Fproject%2F777555&pagesize=100&fetch=true'
|
95
|
-
RallyNoResultsResponder.new.call(env)
|
61
|
+
when '/slm/webservice/current/HierarchicalRequirement'
|
62
|
+
if request.params["query"].include? '1234' # Iteration ID
|
63
|
+
[200, {}, [
|
64
|
+
<<-XML
|
65
|
+
<QueryResult>
|
66
|
+
<Results>
|
67
|
+
<Object type="HierarchicalRequirement">
|
68
|
+
<FormattedID>US123</FormattedID>
|
69
|
+
<Name>This is story number one</Name>
|
70
|
+
<ScheduleState>Completed</ScheduleState>
|
71
|
+
</Object>
|
72
|
+
<Object type="HierarchicalRequirement">
|
73
|
+
<FormattedID>US456</FormattedID>
|
74
|
+
<Name>This is story number two</Name>
|
75
|
+
<ScheduleState>In-Progress</ScheduleState>
|
76
|
+
</Object>
|
77
|
+
</Results>
|
78
|
+
</QueryResult>
|
79
|
+
XML
|
80
|
+
]]
|
81
|
+
else
|
82
|
+
RallyNoResultsResponder.new.call(env)
|
83
|
+
end
|
84
|
+
when '/slm/webservice/current/Defect'
|
85
|
+
if request.params["query"].include? '1234' # Iteration ID
|
86
|
+
[200, {}, [
|
87
|
+
<<-XML
|
88
|
+
<QueryResult>
|
89
|
+
<Results>
|
90
|
+
<Object type="Defect">
|
91
|
+
<FormattedID>DE789</FormattedID>
|
92
|
+
<Name>This is defect number one</Name>
|
93
|
+
<ScheduleState>Defined</ScheduleState>
|
94
|
+
</Object>
|
95
|
+
</Results>
|
96
|
+
</QueryResult>
|
97
|
+
XML
|
98
|
+
]]
|
99
|
+
else
|
100
|
+
RallyNoResultsResponder.new.call(env)
|
101
|
+
end
|
96
102
|
else
|
97
103
|
RallyNoResultsResponder.new.call(env)
|
98
104
|
end
|
@@ -5,8 +5,8 @@ class RallyStoryResponder < GenericResponder
|
|
5
5
|
def call(env)
|
6
6
|
@requests << request = Rack::Request.new(env)
|
7
7
|
|
8
|
-
case request.
|
9
|
-
when '
|
8
|
+
case request.path
|
9
|
+
when '/slm/webservice/1.17/task/1'
|
10
10
|
[200, {}, [
|
11
11
|
<<-XML
|
12
12
|
<Task refObjectName="Change link to button">
|
@@ -16,7 +16,7 @@ class RallyStoryResponder < GenericResponder
|
|
16
16
|
</Task>
|
17
17
|
XML
|
18
18
|
]]
|
19
|
-
when '
|
19
|
+
when '/slm/webservice/1.17/task/2'
|
20
20
|
[200, {}, [
|
21
21
|
<<-XML
|
22
22
|
<Task refObjectName="Add confirmation">
|
@@ -26,7 +26,7 @@ XML
|
|
26
26
|
</Task>
|
27
27
|
XML
|
28
28
|
]]
|
29
|
-
when '
|
29
|
+
when '/slm/webservice/1.17/task/3'
|
30
30
|
[200, {}, [
|
31
31
|
<<-XML
|
32
32
|
<Task refObjectName="Code Review">
|
@@ -36,7 +36,7 @@ XML
|
|
36
36
|
</Task>
|
37
37
|
XML
|
38
38
|
]]
|
39
|
-
when '
|
39
|
+
when '/slm/webservice/1.17/task/4'
|
40
40
|
[200, {}, [
|
41
41
|
<<-XML
|
42
42
|
<Task refObjectName="QA Test">
|
@@ -46,8 +46,7 @@ XML
|
|
46
46
|
</Task>
|
47
47
|
XML
|
48
48
|
]]
|
49
|
-
|
50
|
-
# https://rally1.rallydev.com/slm/webservice/current/HierarchicalRequirement?query=%28FormattedId+%3D+US7176%29&fetch=true
|
49
|
+
when '/slm/webservice/current/HierarchicalRequirement'
|
51
50
|
[200, {}, [
|
52
51
|
<<-XML
|
53
52
|
<QueryResult>
|
@@ -74,6 +73,8 @@ XML
|
|
74
73
|
</QueryResult>
|
75
74
|
XML
|
76
75
|
]]
|
76
|
+
else
|
77
|
+
RallyNoResultsResponder.new.call(env)
|
77
78
|
end
|
78
79
|
end
|
79
80
|
end
|
@@ -3,7 +3,8 @@ class RallyTaskUpdateResponder < GenericResponder
|
|
3
3
|
def call(env)
|
4
4
|
@requests << request = Rack::Request.new(env)
|
5
5
|
|
6
|
-
|
6
|
+
case request.path
|
7
|
+
when '/slm/webservice/current/Task'
|
7
8
|
[200, {}, [
|
8
9
|
<<-XML
|
9
10
|
<?xml version="1.0" encoding="UTF-8"?>
|
@@ -17,47 +18,60 @@ class RallyTaskUpdateResponder < GenericResponder
|
|
17
18
|
</QueryResult>
|
18
19
|
XML
|
19
20
|
]]
|
20
|
-
|
21
|
-
|
22
|
-
|
23
|
-
|
24
|
-
<
|
25
|
-
|
26
|
-
|
27
|
-
|
28
|
-
|
29
|
-
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
42
|
-
|
43
|
-
|
44
|
-
|
45
|
-
|
46
|
-
|
47
|
-
|
48
|
-
|
49
|
-
|
50
|
-
|
51
|
-
|
52
|
-
|
53
|
-
|
54
|
-
|
55
|
-
|
56
|
-
|
57
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
21
|
+
when '/slm/webservice/1.17/task/12345'
|
22
|
+
if request.get?
|
23
|
+
[200, {}, [
|
24
|
+
<<-XML
|
25
|
+
<Task rallyAPIMajor="1" rallyAPIMinor="17" ref="https://rally1.rallydev.com/slm/webservice/1.17/task/12345" objectVersion="8" refObjectName="Tie your shoes!" CreatedAt="today at 8:31 pm">
|
26
|
+
<CreationDate>2012-07-17T03:31:33.801Z</CreationDate>
|
27
|
+
<ObjectID>12345</ObjectID>
|
28
|
+
<Description />
|
29
|
+
<Discussion />
|
30
|
+
<FormattedID>TA6666</FormattedID>
|
31
|
+
<LastUpdateDate>2012-07-17T04:00:35.888Z</LastUpdateDate>
|
32
|
+
<Name>Tie your shoes!</Name>
|
33
|
+
<Notes />
|
34
|
+
<Owner>tester@testing.com</Owner>
|
35
|
+
<Tags />
|
36
|
+
<Attachments />
|
37
|
+
<Blocked>false</Blocked>
|
38
|
+
<Rank>4000</Rank>
|
39
|
+
<State>Defined</State>
|
40
|
+
<TaskIndex>2</TaskIndex>
|
41
|
+
<ToDo>2.0</ToDo>
|
42
|
+
</Task>
|
43
|
+
XML
|
44
|
+
]]
|
45
|
+
elsif request.post?
|
46
|
+
[200, {}, [
|
47
|
+
<<-XML
|
48
|
+
<OperationResult rallyAPIMajor="1" rallyAPIMinor="17">
|
49
|
+
<Errors />
|
50
|
+
<Warnings />
|
51
|
+
</OperationResult>
|
52
|
+
XML
|
53
|
+
]]
|
54
|
+
end
|
55
|
+
when '/slm/webservice/current/User'
|
56
|
+
if request.params["query"].include? "Freddy Fender"
|
57
|
+
[200, {}, [
|
58
|
+
<<-XML
|
59
|
+
<QueryResult rallyAPIMajor="1" rallyAPIMinor="17">
|
60
|
+
<Errors />
|
61
|
+
<Warnings />
|
62
|
+
<TotalResultCount>1</TotalResultCount>
|
63
|
+
<StartIndex>1</StartIndex>
|
64
|
+
<PageSize>20</PageSize>
|
65
|
+
<Results>
|
66
|
+
<Object rallyAPIMajor="1" rallyAPIMinor="17" ref="https://rally1.rallydev.com/slm/webservice/1.17/user/4567" refObjectName="Freddy Fender" type="User" />
|
67
|
+
</Results>
|
68
|
+
</QueryResult>
|
69
|
+
XML
|
70
|
+
]]
|
71
|
+
else
|
72
|
+
RallyNoResultsResponder.new.call(env)
|
73
|
+
end
|
74
|
+
when '/slm/webservice/1.17/user/4567'
|
61
75
|
[200, {}, [
|
62
76
|
<<-XML
|
63
77
|
<User rallyAPIMajor="1" rallyAPIMinor="17" ref="https://rally1.rallydev.com/slm/webservice/1.17/user/4567" objectVersion="50" refObjectName="Freddy Fender">
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rallycat
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.4.
|
4
|
+
version: 0.4.1
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -10,11 +10,11 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date: 2012-07-
|
13
|
+
date: 2012-07-28 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: builder
|
17
|
-
requirement: &
|
17
|
+
requirement: &70290592025020 !ruby/object:Gem::Requirement
|
18
18
|
none: false
|
19
19
|
requirements:
|
20
20
|
- - ! '>='
|
@@ -22,10 +22,10 @@ dependencies:
|
|
22
22
|
version: '0'
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
|
-
version_requirements: *
|
25
|
+
version_requirements: *70290592025020
|
26
26
|
- !ruby/object:Gem::Dependency
|
27
27
|
name: rally_rest_api
|
28
|
-
requirement: &
|
28
|
+
requirement: &70290592024300 !ruby/object:Gem::Requirement
|
29
29
|
none: false
|
30
30
|
requirements:
|
31
31
|
- - ! '>='
|
@@ -33,10 +33,10 @@ dependencies:
|
|
33
33
|
version: '0'
|
34
34
|
type: :runtime
|
35
35
|
prerelease: false
|
36
|
-
version_requirements: *
|
36
|
+
version_requirements: *70290592024300
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
38
|
name: nokogiri
|
39
|
-
requirement: &
|
39
|
+
requirement: &70290592023620 !ruby/object:Gem::Requirement
|
40
40
|
none: false
|
41
41
|
requirements:
|
42
42
|
- - ! '>='
|
@@ -44,7 +44,40 @@ dependencies:
|
|
44
44
|
version: '0'
|
45
45
|
type: :runtime
|
46
46
|
prerelease: false
|
47
|
-
version_requirements: *
|
47
|
+
version_requirements: *70290592023620
|
48
|
+
- !ruby/object:Gem::Dependency
|
49
|
+
name: rake
|
50
|
+
requirement: &70290592022780 !ruby/object:Gem::Requirement
|
51
|
+
none: false
|
52
|
+
requirements:
|
53
|
+
- - ! '>='
|
54
|
+
- !ruby/object:Gem::Version
|
55
|
+
version: '0'
|
56
|
+
type: :development
|
57
|
+
prerelease: false
|
58
|
+
version_requirements: *70290592022780
|
59
|
+
- !ruby/object:Gem::Dependency
|
60
|
+
name: artifice
|
61
|
+
requirement: &70290592022000 !ruby/object:Gem::Requirement
|
62
|
+
none: false
|
63
|
+
requirements:
|
64
|
+
- - ! '>='
|
65
|
+
- !ruby/object:Gem::Version
|
66
|
+
version: '0'
|
67
|
+
type: :development
|
68
|
+
prerelease: false
|
69
|
+
version_requirements: *70290592022000
|
70
|
+
- !ruby/object:Gem::Dependency
|
71
|
+
name: rspec
|
72
|
+
requirement: &70290592020900 !ruby/object:Gem::Requirement
|
73
|
+
none: false
|
74
|
+
requirements:
|
75
|
+
- - ! '>='
|
76
|
+
- !ruby/object:Gem::Version
|
77
|
+
version: '0'
|
78
|
+
type: :development
|
79
|
+
prerelease: false
|
80
|
+
version_requirements: *70290592020900
|
48
81
|
description: The Rally website sucks. CLI is better.
|
49
82
|
email:
|
50
83
|
- adam@adamtanner.org
|
@@ -104,7 +137,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
104
137
|
version: '0'
|
105
138
|
segments:
|
106
139
|
- 0
|
107
|
-
hash:
|
140
|
+
hash: 682521708574243756
|
108
141
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
109
142
|
none: false
|
110
143
|
requirements:
|
@@ -113,7 +146,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
113
146
|
version: '0'
|
114
147
|
segments:
|
115
148
|
- 0
|
116
|
-
hash:
|
149
|
+
hash: 682521708574243756
|
117
150
|
requirements: []
|
118
151
|
rubyforge_project:
|
119
152
|
rubygems_version: 1.8.7
|