itfollowsclient 0.1.8 → 0.1.9

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: 4fcb891123eb577cbf0e2d80cb1b233779526f35
4
- data.tar.gz: 3f53eadbccc4a3286d20dfe5e39313a79bcf8d98
3
+ metadata.gz: a3015c1772804d2f52c6ab6746d74617907f0636
4
+ data.tar.gz: 1614d7973818352867d74b7ffe92521bc17de408
5
5
  SHA512:
6
- metadata.gz: 9489164ed4ae007866cf7d9e03d80a2e8fabdba8cab389986ae5181710b0b60976dbec948434fb9237086635e8d460da1969dae160de750087ea80e0bf10b512
7
- data.tar.gz: 70c9d9c4a5635b354a57750a3e9a8dc942182c0b811a971aadc2ddb2efce37e60836a08b505e1f7b1b48d69d2bfc8efd918d3fc9b75ee6d675e39b51282bb50d
6
+ metadata.gz: 4878aae26a29e6ffb225f738195c6bba574a848a872737e1ff4784be1353cc545c7592059fb8dbf0c6e0df1f73d896b48501aeddc4948eb9c8c28e5ffc143668
7
+ data.tar.gz: bec0a041cfeb70734aa9fa86113c18b450bd7e793aec211bd4fa6192db77fcfcc4fcca312dc47ce74deb077fd71010b7ecc633bf962e77bf4e9a58e64bfccc81
@@ -15,9 +15,11 @@ module Itfollows
15
15
  JSON.parse(response.body)
16
16
  end
17
17
 
18
- def new_followup(line_entry_id, description, percentage)
19
- uri = uri(name)
20
- response = post(name, payload, uri, email, token)
18
+
19
+ def new_followup(name, description, percentage, tasks, id)
20
+ uri = uri_for_update(name, id)
21
+ payload = {"line_entry"=>{"followups_attributes"=>{"0"=>{"description"=> description, "percentage"=> percentage, "tasks"=>tasks}}}, "id"=> id}
22
+ response = patch(name, payload, uri, email, token)
21
23
  JSON.parse(response.body)
22
24
  end
23
25
 
@@ -52,6 +54,10 @@ module Itfollows
52
54
  URI.parse("#{it_follows_host}/#{name}.json")
53
55
  end
54
56
 
57
+ def uri_for_update(name, id)
58
+ URI.parse("#{host}/#{name}/#{id}.json")
59
+ end
60
+
55
61
  def build_http(name, uri)
56
62
  Net::HTTP.new(uri.host, uri.port)
57
63
  end
@@ -64,6 +70,10 @@ module Itfollows
64
70
  build_http(name, uri).post(uri.path, payload.to_json, headers(email, token))
65
71
  end
66
72
 
73
+ def patch(name, payload, uri, email, token)
74
+ build_http(name, uri).patch(uri.path, payload.to_json, headers(email, token))
75
+ end
76
+
67
77
  def uri_for_show(name, id)
68
78
  URI.parse("#{it_follows_host}/#{name}/#{id}/edit.json")
69
79
  end
@@ -1,3 +1,3 @@
1
1
  module Itfollows
2
- VERSION = "0.1.8"
2
+ VERSION = "0.1.9"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: itfollowsclient
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.8
4
+ version: 0.1.9
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maria Velandia
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: exe
11
11
  cert_chain: []
12
- date: 2016-01-21 00:00:00.000000000 Z
12
+ date: 2016-01-22 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: bundler
@@ -80,7 +80,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
80
80
  version: '0'
81
81
  requirements: []
82
82
  rubyforge_project:
83
- rubygems_version: 2.5.1
83
+ rubygems_version: 2.4.5.1
84
84
  signing_key:
85
85
  specification_version: 4
86
86
  summary: y, because Rubygems requires one.