tracker_api 0.2.2 → 0.2.3

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 58b985867493c40993433ea092acf680a7f4380d
4
- data.tar.gz: 0d1ad7f6314e67d9da1b4469da9ca20efbcdbf4f
3
+ metadata.gz: b84fbb4e12e6c6e77d1d39a87f966eeecb350602
4
+ data.tar.gz: 3c425c3512cc62a954238f0d270e88d18d5abc9b
5
5
  SHA512:
6
- metadata.gz: 2e8e8023fc4a22eedf7d101bce65067640ce530d7e1a052ec43490175faabac0f8447f1779ffe4ac7887498362596dbf09fd789729b656d11f4b5e8fae7d6b77
7
- data.tar.gz: 2ca8846f9d6b86561b7cdef9e2978de8e38bd487f640d28d0c7fb1d8aab292b116f6d5526ead23fd09e7e2529c8227d7550d823deeb5071c48b1629a4b71e3b2
6
+ metadata.gz: 4e0c37eb1e518ef0b7638d946d545ac3b1c7c0e9bbfdba4807c7bc5d6bdb4e96cd320043113d0b4f7a4b62f0642c540d95d96afce10411e05c9e7f3808af045b
7
+ data.tar.gz: 9f12d4cc1eafb6d7cdb8d5a7420552cffea6eea8e48542f8f8ac727749ced54e7b42c0823a9e274e11bf6bfef826427677c07d26279203fdb6baf93c37203294
@@ -6,7 +6,7 @@ rvm:
6
6
  # Faraday::ConnectionFailed: Could not generate DH keypair (Java::JavaLang::RuntimeException)
7
7
  # http://bugs.java.com/bugdatabase/view_bug.do?bug_id=7044060
8
8
  # - jruby-19mode # JRuby in 1.9 mode
9
- - rbx
9
+ # - rbx
10
10
  # - "1.8.7"
11
11
  # uncomment this line if your project needs to run something other than `rake`:
12
12
  # script: bundle exec rspec spec
data/README.md CHANGED
@@ -59,6 +59,7 @@ client = TrackerApi::Client.new(token: 'my-api-token') # Crea
59
59
 
60
60
  client.project(project_id, fields: ':default,labels(name)') # Eagerly get labels with a project
61
61
  client.project(project_id, fields: ':default,epics') # Eagerly get epics with a project
62
+ client.project(project_id).stories(fields: ':default,tasks') # Eagerly get stories with tasks
62
63
  ```
63
64
 
64
65
  ## TODO
@@ -24,9 +24,11 @@ module TrackerApi
24
24
  autoload :Epics, 'tracker_api/endpoints/epics'
25
25
  autoload :Iterations, 'tracker_api/endpoints/iterations'
26
26
  autoload :Me, 'tracker_api/endpoints/me'
27
+ autoload :Memberships, 'tracker_api/endpoints/memberships'
27
28
  autoload :Project, 'tracker_api/endpoints/project'
28
29
  autoload :Projects, 'tracker_api/endpoints/projects'
29
30
  autoload :Stories, 'tracker_api/endpoints/stories'
31
+ autoload :Story, 'tracker_api/endpoints/story'
30
32
  end
31
33
 
32
34
  module Resources
@@ -36,8 +38,11 @@ module TrackerApi
36
38
  autoload :Me, 'tracker_api/resources/me'
37
39
  autoload :MembershipSummary, 'tracker_api/resources/membership_summary'
38
40
  autoload :Label, 'tracker_api/resources/label'
41
+ autoload :Person, 'tracker_api/resources/person'
39
42
  autoload :Project, 'tracker_api/resources/project'
43
+ autoload :ProjectMembership, 'tracker_api/resources/project_membership'
40
44
  autoload :Story, 'tracker_api/resources/story'
45
+ autoload :Task, 'tracker_api/resources/task'
41
46
  autoload :TimeZone, 'tracker_api/resources/time_zone'
42
47
  end
43
48
  end
@@ -0,0 +1,18 @@
1
+ module TrackerApi
2
+ module Endpoints
3
+ class Memberships
4
+ attr_accessor :client
5
+
6
+ def initialize(client)
7
+ @client = client
8
+ end
9
+
10
+ def get(project_id, params={})
11
+ data = client.paginate("/projects/#{project_id}/memberships", params: params)
12
+ raise TrackerApi::Errors::UnexpectedData, 'Array of memberships expected' unless data.is_a? Array
13
+
14
+ data.map { |membership| Resources::ProjectMembership.new({ client: client }.merge(membership)) }
15
+ end
16
+ end
17
+ end
18
+ end
@@ -0,0 +1,16 @@
1
+ module TrackerApi
2
+ module Resources
3
+ class Person
4
+ include Virtus.model
5
+
6
+ attribute :client
7
+
8
+ attribute :kind, String
9
+ attribute :id, Integer
10
+ attribute :name, String
11
+ attribute :email, String
12
+ attribute :initials, String
13
+ attribute :username, String
14
+ end
15
+ end
16
+ end
@@ -81,6 +81,10 @@ module TrackerApi
81
81
  Endpoints::Stories.new(client).get(id, params)
82
82
  end
83
83
 
84
+ def memberships(params = {})
85
+ Endpoints::Memberships.new(client).get(id, params)
86
+ end
87
+
84
88
  # @param [Fixnum] story_id id of story to get
85
89
  # @return [Story] Story with given id
86
90
  def story(story_id)
@@ -0,0 +1,18 @@
1
+ module TrackerApi
2
+ module Resources
3
+ class ProjectMembership
4
+ include Virtus.model
5
+
6
+ attribute :client
7
+
8
+ attribute :id, Integer
9
+ attribute :person_id, Integer
10
+ attribute :project_id, Integer
11
+ attribute :role, String
12
+ attribute :project_color, String
13
+ attribute :wants_comment_notification_emails, Boolean
14
+ attribute :kind, String
15
+ attribute :person, TrackerApi::Resources::Person
16
+ end
17
+ end
18
+ end
@@ -26,6 +26,7 @@ module TrackerApi
26
26
  attribute :requested_by_id, Integer
27
27
  attribute :story_type, String # (feature, bug, chore, release)
28
28
  attribute :task_ids, Array[Integer]
29
+ attribute :tasks, Array[TrackerApi::Resources::Task]
29
30
  attribute :updated_at, DateTime
30
31
  attribute :url, String
31
32
 
@@ -0,0 +1,18 @@
1
+ module TrackerApi
2
+ module Resources
3
+ class Task
4
+ include Virtus.model
5
+
6
+ attribute :client
7
+
8
+ attribute :id, Integer
9
+ attribute :story_id, Integer
10
+ attribute :description, String
11
+ attribute :complete, Boolean
12
+ attribute :position, Integer
13
+ attribute :created_at, DateTime
14
+ attribute :updated_at, DateTime
15
+ attribute :kind, String
16
+ end
17
+ end
18
+ end
@@ -1,3 +1,3 @@
1
1
  module TrackerApi
2
- VERSION = '0.2.2'
2
+ VERSION = '0.2.3'
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tracker_api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.2
4
+ version: 0.2.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Forest Carlisle
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-05-07 00:00:00.000000000 Z
11
+ date: 2014-05-30 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -170,6 +170,7 @@ files:
170
170
  - lib/tracker_api/endpoints/epics.rb
171
171
  - lib/tracker_api/endpoints/iterations.rb
172
172
  - lib/tracker_api/endpoints/me.rb
173
+ - lib/tracker_api/endpoints/memberships.rb
173
174
  - lib/tracker_api/endpoints/project.rb
174
175
  - lib/tracker_api/endpoints/projects.rb
175
176
  - lib/tracker_api/endpoints/stories.rb
@@ -182,8 +183,11 @@ files:
182
183
  - lib/tracker_api/resources/label.rb
183
184
  - lib/tracker_api/resources/me.rb
184
185
  - lib/tracker_api/resources/membership_summary.rb
186
+ - lib/tracker_api/resources/person.rb
185
187
  - lib/tracker_api/resources/project.rb
188
+ - lib/tracker_api/resources/project_membership.rb
186
189
  - lib/tracker_api/resources/story.rb
190
+ - lib/tracker_api/resources/task.rb
187
191
  - lib/tracker_api/resources/time_zone.rb
188
192
  - lib/tracker_api/version.rb
189
193
  - test/client_test.rb