pivotal-tracker-api 1.0.2 → 1.0.3

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 7ce3b6e18ed0a72fc3707c7f5967b7e03bbc818d
4
- data.tar.gz: 006f6bdd3517587f7cfc261229f21e3bdcfb3c93
3
+ metadata.gz: 01d475d2bb83763299e2fd81c24f41421c95ab82
4
+ data.tar.gz: 86ef726fcfb93e90b019ae0af06dc09d019d5d5f
5
5
  SHA512:
6
- metadata.gz: a5c0b17773962b9756fb287ced83a0bec9baea04a7a63cd2b99e7103b571d2c26a0a2f6debb98e666e6987e2d953da4fdf6bf6e2658d33afac12fb765962e17e
7
- data.tar.gz: 5582afefd47383eedc678b8cfc820d3e66d86e3a4597d7a137474169627c996a2a9d95f9c6bdf51d9ef69ad4f961a28bbe08008886ed7fcd6af4b18353875acb
6
+ metadata.gz: 06da62205e127013961dbb9b2af6ebd326ed9695e0919f2f92fe2649827fd62df95922246135edcabad7acd12a86b2ce0360ad00390ebdbd427bc944ec6e3c03
7
+ data.tar.gz: 5ac7b749a84c800b56e8182fd838ba36d0843c11580d06d4bd6ccb21c5a8f3a880a65daf89806b4c49e90a3d6dfc07c2beb758f491499577b1005cc6e47fcb26
data/README.md CHANGED
@@ -3,7 +3,8 @@ pivotal-tracker-api
3
3
 
4
4
  A Pivotal Tracker API gem that can be used to interface with the Pivotal Tracker API v5.
5
5
 
6
- [![Gem](https://img.shields.io/gem/v/pivotal-tracker-api.svg?maxAge=2592000)]() [![Gem](https://img.shields.io/gem/dtv/pivotal-tracker-api.svg?maxAge=2592000)]()
6
+ [![Gem](https://img.shields.io/gem/v/pivotal-tracker-api.svg?maxAge=2592000)](https://rubygems.org/gems/pivotal-tracker-api)
7
+ [![Gem](https://img.shields.io/gem/dt/pivotal-tracker-api.svg?maxAge=2592000)](https://github.com/atljeremy/pivotal-tracker-api.git)
7
8
 
8
9
  ### Basic Example
9
10
 
data/Rakefile CHANGED
@@ -32,13 +32,11 @@ Rake::TestTask.new(:test) do |test|
32
32
  test.verbose = true
33
33
  end
34
34
 
35
- #require 'rcov/rcovtask'
36
- #Rcov::RcovTask.new do |test|
37
- # test.libs << 'test'
38
- # test.pattern = 'test/**/test_*.rb'
39
- # test.verbose = true
40
- # test.rcov_opts << '--exclude "gems/*"'
41
- #end
35
+ # require 'simplecov'
36
+ # SimpleCov.command_name 'Unit Tests'
37
+ # SimpleCov.start do
38
+ # add_filter "/test/"
39
+ # end
42
40
 
43
41
  task :default => :test
44
42
 
data/VERSION CHANGED
@@ -1 +1 @@
1
- 1.0.2
1
+ 1.0.3
@@ -44,12 +44,15 @@ module PivotalAPI
44
44
  Service.activity(opts)
45
45
  end
46
46
 
47
- def story(opts={})
47
+ def story(story_id, opts={})
48
48
  opts[:project_id] = id
49
+ opts[:story_id] = story_id
49
50
  opts[:parameters] = {} unless opts[:parameters]
50
51
  opts[:parameters][:fields] = Story.fields
51
52
 
52
- Service.story(opts)
53
+ story = Service.story(opts)
54
+ story.project_id = id if story && story.project_id.nil?
55
+ story
53
56
  end
54
57
 
55
58
  def stories(opts={})
@@ -176,6 +176,7 @@ module PivotalAPI
176
176
  raise ArgumentError.new("missing required key/value :story_id") unless opts[:story_id]
177
177
 
178
178
  project_id = opts[:project_id]
179
+ story_id = opts[:story_id]
179
180
  opts[:parameters] = {} unless opts[:parameters]
180
181
  opts[:parameters][:fields] = opts[:fields] if opts[:fields] && opts[:parameters][:fields].nil?
181
182
 
@@ -193,7 +194,7 @@ module PivotalAPI
193
194
  raise ArgumentError.new("missing required parameter project_id") unless project_id
194
195
  raise ArgumentError.new("missing required parameter sotry_id") unless story_id
195
196
 
196
- api_url = "/projects/#{project.id}/stories/#{story_id}"
197
+ api_url = "/projects/#{project_id}/stories/#{story_id}"
197
198
  PivotalAPI::Client.put(api_url, updates)
198
199
  end
199
200
 
@@ -153,6 +153,10 @@ module PivotalAPI
153
153
  return false if estimate < 0
154
154
  hours >= estimate
155
155
  end
156
+
157
+ def update(attrs={})
158
+ PivotalAPI::Service.update_story(id, project_id, attrs) if attrs.count > 0
159
+ end
156
160
 
157
161
  protected
158
162
 
@@ -2,16 +2,16 @@
2
2
  # DO NOT EDIT THIS FILE DIRECTLY
3
3
  # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
4
  # -*- encoding: utf-8 -*-
5
- # stub: pivotal-tracker-api 1.0.2 ruby lib
5
+ # stub: pivotal-tracker-api 1.0.3 ruby lib
6
6
 
7
7
  Gem::Specification.new do |s|
8
8
  s.name = "pivotal-tracker-api"
9
- s.version = "1.0.2"
9
+ s.version = "1.0.3"
10
10
 
11
11
  s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
12
12
  s.require_paths = ["lib"]
13
13
  s.authors = ["jfox"]
14
- s.date = "2016-08-24"
14
+ s.date = "2016-10-26"
15
15
  s.description = "A ruby gem to communicate with the Picotal Tracker API v5"
16
16
  s.email = "atljeremy@me.com"
17
17
  s.extra_rdoc_files = [
@@ -4,9 +4,9 @@ class TestService < Test::Unit::TestCase
4
4
 
5
5
  context "PivotalAPI::Service" do
6
6
 
7
- # setup do
8
- # PivotalAPI::Service.set_token "TOKEN_HERE"
9
- # end
7
+ setup do
8
+ PivotalAPI::Service.set_token "5c17c42f0f4c30cbc0c53ddd8f832e7b"
9
+ end
10
10
 
11
11
  # should "get user info" do
12
12
  # me = PivotalAPI::Me.retrieve('USERNAME', 'PASSWORD')
@@ -64,6 +64,13 @@ class TestService < Test::Unit::TestCase
64
64
  #
65
65
  # assert_not_nil(activity)
66
66
  # end
67
+
68
+ should "should get project activity" do
69
+ project = PivotalAPI::Project.retrieve(1158374)
70
+ story = project.story(128105441)
71
+
72
+ assert_not_nil(story)
73
+ end
67
74
 
68
75
  end
69
76
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: pivotal-tracker-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.2
4
+ version: 1.0.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - jfox
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-08-24 00:00:00.000000000 Z
11
+ date: 2016-10-26 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rest-client