artisan 0.5.2 → 0.5.3
Sign up to get free protection for your applications and to get access to all the features.
- data/LICENSE.txt +1 -1
- data/VERSION +1 -1
- data/artisan.gemspec +4 -2
- data/lib/artisan.rb +7 -0
- data/lib/artisan/iteration_total_billed_points_by_craftsman.rb +9 -0
- data/lib/artisan/query.rb +13 -7
- data/spec/artisan/iteration_total_billed_points_by_craftsman_spec.rb +17 -0
- data/spec/artisan/query_spec.rb +1 -0
- metadata +18 -16
data/LICENSE.txt
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.5.
|
1
|
+
0.5.3
|
data/artisan.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{artisan}
|
8
|
-
s.version = "0.5.
|
8
|
+
s.version = "0.5.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["patrickgombert"]
|
12
|
-
s.date = %q{2012-
|
12
|
+
s.date = %q{2012-11-29}
|
13
13
|
s.description = %q{Make calls to the Artisan API.}
|
14
14
|
s.email = %q{patrick@8thlight.com}
|
15
15
|
s.extra_rdoc_files = [
|
@@ -29,6 +29,7 @@ Gem::Specification.new do |s|
|
|
29
29
|
"lib/artisan.rb",
|
30
30
|
"lib/artisan/base.rb",
|
31
31
|
"lib/artisan/iteration.rb",
|
32
|
+
"lib/artisan/iteration_total_billed_points_by_craftsman.rb",
|
32
33
|
"lib/artisan/project.rb",
|
33
34
|
"lib/artisan/query.rb",
|
34
35
|
"lib/artisan/signoff_pdf.rb",
|
@@ -36,6 +37,7 @@ Gem::Specification.new do |s|
|
|
36
37
|
"spec/artisan/artisan_spec.rb",
|
37
38
|
"spec/artisan/base_spec.rb",
|
38
39
|
"spec/artisan/iteration_spec.rb",
|
40
|
+
"spec/artisan/iteration_total_billed_points_by_craftsman_spec.rb",
|
39
41
|
"spec/artisan/project_spec.rb",
|
40
42
|
"spec/artisan/query_spec.rb",
|
41
43
|
"spec/artisan/signoff_pdf_spec.rb",
|
data/lib/artisan.rb
CHANGED
@@ -1,5 +1,6 @@
|
|
1
1
|
require 'artisan/project'
|
2
2
|
require 'artisan/iteration'
|
3
|
+
require 'artisan/iteration_total_billed_points_by_craftsman'
|
3
4
|
require 'artisan/story'
|
4
5
|
require 'artisan/query'
|
5
6
|
require 'artisan/signoff_pdf'
|
@@ -22,6 +23,12 @@ module Artisan
|
|
22
23
|
return @iterations
|
23
24
|
end
|
24
25
|
|
26
|
+
def self.get_iteration_total_billed_points_by_craftsman(key, iteration_number, address = 'artisan.8thlight.com')
|
27
|
+
response = Query.get_iteration_total_billed_points_by_craftsman(key, iteration_number, address)
|
28
|
+
json_chunk = JSON::parse(response)
|
29
|
+
return IterationTotalBilledPointsByCraftsman.new(json_chunk)
|
30
|
+
end
|
31
|
+
|
25
32
|
def self.get_signoff_pdf(key, iteration_id, address = 'artisan.8thlight.com')
|
26
33
|
response = Query.get_signoff_pdf(key, iteration_id, address)
|
27
34
|
|
data/lib/artisan/query.rb
CHANGED
@@ -3,13 +3,19 @@ require 'httparty'
|
|
3
3
|
module Artisan
|
4
4
|
module Query
|
5
5
|
def self.get_project(key, address)
|
6
|
-
response = HTTParty.get
|
6
|
+
response = HTTParty.get "http://#{address}/api/projects", :headers => {'accept' => 'application/json'}, :query => {'key' => key}
|
7
7
|
Validation.validate_response response.code
|
8
8
|
return response.body
|
9
9
|
end
|
10
10
|
|
11
11
|
def self.get_iterations(key, address)
|
12
|
-
response = HTTParty.get
|
12
|
+
response = HTTParty.get "http://#{address}/api/projects/iterations", :headers => {'accept' => 'application/json'}, :query => {'key' => key}
|
13
|
+
Validation.validate_response response.code
|
14
|
+
return response.body
|
15
|
+
end
|
16
|
+
|
17
|
+
def self.get_iteration_total_billed_points_by_craftsman(key, iteration_number, address)
|
18
|
+
response = HTTParty.get "http://#{address}/api/projects/iterations/#{iteration_number}/total_billed_points_by_craftsman", :headers => {'accept' => 'application/json'}, :query => {'key' => key}
|
13
19
|
Validation.validate_response response.code
|
14
20
|
return response.body
|
15
21
|
end
|
@@ -40,7 +46,7 @@ module Artisan
|
|
40
46
|
|
41
47
|
def self.get_stories_by_iteration(key, iteration_number, address)
|
42
48
|
response = HTTParty.get(
|
43
|
-
|
49
|
+
"http://#{address}/api/projects/iterations/stories",
|
44
50
|
:headers => {
|
45
51
|
'accept' => 'application/json'
|
46
52
|
},
|
@@ -54,25 +60,25 @@ module Artisan
|
|
54
60
|
end
|
55
61
|
|
56
62
|
def self.get_stories(key, address)
|
57
|
-
response = HTTParty.get
|
63
|
+
response = HTTParty.get "http://#{address}/api/projects/stories", :headers => {'accept' => 'application/json'}, :query => {'key' => key}
|
58
64
|
Validation.validate_response response.code
|
59
65
|
return response.body
|
60
66
|
end
|
61
67
|
|
62
68
|
def self.get_backlog_stories(key, address)
|
63
|
-
response = HTTParty.get
|
69
|
+
response = HTTParty.get "http://#{address}/api/projects/stories/backlog", :headers => {'accept' => 'application/json'}, :query => {'key' => key}
|
64
70
|
Validation.validate_response response.code
|
65
71
|
return response.body
|
66
72
|
end
|
67
73
|
|
68
74
|
def self.update_estimates(key, story, address)
|
69
|
-
response = HTTParty.put
|
75
|
+
response = HTTParty.put "http://#{address}/api/projects/stories/#{story.number.to_s}/estimates", :query => {:key => key}, :headers => {'accept' => 'application/json', 'content-type' => 'application/json'}, :body => {"optimistic" => story.optimistic, "realistic" => story.realistic, "pessimistic" => story.pessimistic}.to_json
|
70
76
|
Validation.validate_response response.code
|
71
77
|
return response.body
|
72
78
|
end
|
73
79
|
|
74
80
|
def self.authenticate(username, password, address)
|
75
|
-
response = HTTParty.get
|
81
|
+
response = HTTParty.get "http://#{address}/api/auth/authenticate", :headers => {'accept' => 'application/json'}, :query => {'username' => username, 'password' => password}
|
76
82
|
Validation.validate_response response.code
|
77
83
|
return response.body
|
78
84
|
end
|
@@ -0,0 +1,17 @@
|
|
1
|
+
require 'spec_helper'
|
2
|
+
|
3
|
+
describe Artisan::IterationTotalBilledPointsByCraftsman do
|
4
|
+
|
5
|
+
it "initializes with an api call json chunk" do
|
6
|
+
hash = {
|
7
|
+
'total_billed_points_by_craftsman' => {
|
8
|
+
'Brian' => 10.5,
|
9
|
+
'Joe' => 4
|
10
|
+
}
|
11
|
+
}
|
12
|
+
data = Artisan::IterationTotalBilledPointsByCraftsman.new(hash)
|
13
|
+
data.total_billed_points_by_craftsman["Brian"].should == 10.5
|
14
|
+
data.total_billed_points_by_craftsman["Joe"].should == 4
|
15
|
+
end
|
16
|
+
|
17
|
+
end
|
data/spec/artisan/query_spec.rb
CHANGED
metadata
CHANGED
@@ -1,11 +1,11 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: artisan
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.5.
|
4
|
+
version: 0.5.3
|
5
5
|
segments:
|
6
6
|
- 0
|
7
7
|
- 5
|
8
|
-
-
|
8
|
+
- 3
|
9
9
|
prerelease: false
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
@@ -13,12 +13,12 @@ authors:
|
|
13
13
|
autorequire: !!null
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
|
-
date: 2012-
|
16
|
+
date: 2012-11-29 00:00:00.000000000 -06:00
|
17
17
|
default_executable: !!null
|
18
18
|
dependencies:
|
19
19
|
- !ruby/object:Gem::Dependency
|
20
20
|
name: httparty
|
21
|
-
requirement: &
|
21
|
+
requirement: &70285296777480 !ruby/object:Gem::Requirement
|
22
22
|
none: false
|
23
23
|
requirements:
|
24
24
|
- - ~>
|
@@ -30,10 +30,10 @@ dependencies:
|
|
30
30
|
- 3
|
31
31
|
type: :runtime
|
32
32
|
prerelease: false
|
33
|
-
version_requirements: *
|
33
|
+
version_requirements: *70285296777480
|
34
34
|
- !ruby/object:Gem::Dependency
|
35
35
|
name: shoulda
|
36
|
-
requirement: &
|
36
|
+
requirement: &70285296776600 !ruby/object:Gem::Requirement
|
37
37
|
none: false
|
38
38
|
requirements:
|
39
39
|
- - ! '>='
|
@@ -43,10 +43,10 @@ dependencies:
|
|
43
43
|
- 0
|
44
44
|
type: :development
|
45
45
|
prerelease: false
|
46
|
-
version_requirements: *
|
46
|
+
version_requirements: *70285296776600
|
47
47
|
- !ruby/object:Gem::Dependency
|
48
48
|
name: jeweler
|
49
|
-
requirement: &
|
49
|
+
requirement: &70285296775680 !ruby/object:Gem::Requirement
|
50
50
|
none: false
|
51
51
|
requirements:
|
52
52
|
- - ~>
|
@@ -58,10 +58,10 @@ dependencies:
|
|
58
58
|
- 4
|
59
59
|
type: :development
|
60
60
|
prerelease: false
|
61
|
-
version_requirements: *
|
61
|
+
version_requirements: *70285296775680
|
62
62
|
- !ruby/object:Gem::Dependency
|
63
63
|
name: rcov
|
64
|
-
requirement: &
|
64
|
+
requirement: &70285296774560 !ruby/object:Gem::Requirement
|
65
65
|
none: false
|
66
66
|
requirements:
|
67
67
|
- - ! '>='
|
@@ -71,10 +71,10 @@ dependencies:
|
|
71
71
|
- 0
|
72
72
|
type: :development
|
73
73
|
prerelease: false
|
74
|
-
version_requirements: *
|
74
|
+
version_requirements: *70285296774560
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
76
|
name: rspec
|
77
|
-
requirement: &
|
77
|
+
requirement: &70285296773760 !ruby/object:Gem::Requirement
|
78
78
|
none: false
|
79
79
|
requirements:
|
80
80
|
- - ~>
|
@@ -86,10 +86,10 @@ dependencies:
|
|
86
86
|
- 0
|
87
87
|
type: :development
|
88
88
|
prerelease: false
|
89
|
-
version_requirements: *
|
89
|
+
version_requirements: *70285296773760
|
90
90
|
- !ruby/object:Gem::Dependency
|
91
91
|
name: cucumber
|
92
|
-
requirement: &
|
92
|
+
requirement: &70285296772720 !ruby/object:Gem::Requirement
|
93
93
|
none: false
|
94
94
|
requirements:
|
95
95
|
- - ~>
|
@@ -101,7 +101,7 @@ dependencies:
|
|
101
101
|
- 2
|
102
102
|
type: :development
|
103
103
|
prerelease: false
|
104
|
-
version_requirements: *
|
104
|
+
version_requirements: *70285296772720
|
105
105
|
description: Make calls to the Artisan API.
|
106
106
|
email: patrick@8thlight.com
|
107
107
|
executables: []
|
@@ -122,6 +122,7 @@ files:
|
|
122
122
|
- lib/artisan.rb
|
123
123
|
- lib/artisan/base.rb
|
124
124
|
- lib/artisan/iteration.rb
|
125
|
+
- lib/artisan/iteration_total_billed_points_by_craftsman.rb
|
125
126
|
- lib/artisan/project.rb
|
126
127
|
- lib/artisan/query.rb
|
127
128
|
- lib/artisan/signoff_pdf.rb
|
@@ -129,6 +130,7 @@ files:
|
|
129
130
|
- spec/artisan/artisan_spec.rb
|
130
131
|
- spec/artisan/base_spec.rb
|
131
132
|
- spec/artisan/iteration_spec.rb
|
133
|
+
- spec/artisan/iteration_total_billed_points_by_craftsman_spec.rb
|
132
134
|
- spec/artisan/project_spec.rb
|
133
135
|
- spec/artisan/query_spec.rb
|
134
136
|
- spec/artisan/signoff_pdf_spec.rb
|
@@ -151,7 +153,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
151
153
|
version: '0'
|
152
154
|
segments:
|
153
155
|
- 0
|
154
|
-
hash:
|
156
|
+
hash: 4226835987318000970
|
155
157
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
156
158
|
none: false
|
157
159
|
requirements:
|