height-api 0.0.1 → 0.0.2

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
  SHA256:
3
- metadata.gz: b45bd952c9fcf17f329987f231db25cec405e9b6f2e1917ab974f90cc458a5a1
4
- data.tar.gz: 36f22f469e81fffffc74ab8155452efb6b44e592c30f2c813cb324a530c1c7b7
3
+ metadata.gz: 1aa6fe8422292bad2ef75dc3cbdf94cfc8eed5d628ec3b7ad16414acf4845b03
4
+ data.tar.gz: e3a410a55ce001c7af8aea0606a3fe73fc0786b78d8e741c9d5bf60a66d3f55b
5
5
  SHA512:
6
- metadata.gz: d69e0344946cf9814d2fcce3cea22c383ef08d1108c932e97e61b91defac66278e5a59b984fd74a044d336d02497faa5fb5e15389d4dcc66a594abcc2f26c1a0
7
- data.tar.gz: 7f4faad3d023507bc7393fd3628aad60e661a55cb507a9a75700f681de66530c0e05a0d7e3a7d8b0b3848b9a02da7b9b8647094829256abce989f22a31ff7d61
6
+ metadata.gz: b805ca3be1acc18914c69938398dfc26c71465107aa35469e4eb9d12dd6859656714d89f6edd068cf0cb6f93d8afca09f3820b3b2a152c709b13f8ffba689a9e
7
+ data.tar.gz: 1721360d2dd15c903449572c66782e7fb5abbd35cb9a5fa63e89c42b55a9e586f1d60933f51ced0c1a92de56283199d556caaeb80c2ef19b110e6d0b6e54c21d
data/.gitignore CHANGED
@@ -13,3 +13,4 @@
13
13
  .byebug_history
14
14
 
15
15
  tags
16
+ height-api-*.gem
data/CHANGELOG.md CHANGED
@@ -1,5 +1,9 @@
1
1
  # Changelog
2
2
 
3
+ ## 0.0.2
4
+
5
+ - Update task
6
+
3
7
  ## 0.0.1 Initial release
4
8
 
5
9
  - List lists
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- height-api (0.0.1)
4
+ height-api (0.0.2)
5
5
 
6
6
  GEM
7
7
  remote: https://rubygems.org/
@@ -39,12 +39,12 @@ PLATFORMS
39
39
  ruby
40
40
 
41
41
  DEPENDENCIES
42
- byebug
42
+ byebug (~> 11.1.3)
43
43
  height-api!
44
44
  rake (~> 12.0)
45
45
  rspec (~> 3.0)
46
- vcr
47
- webmock
46
+ vcr (~> 6.0.0)
47
+ webmock (~> 3.12.2)
48
48
 
49
49
  BUNDLED WITH
50
50
  2.1.4
data/README.md CHANGED
@@ -53,6 +53,12 @@ You can also get a task if you know the index or id
53
53
  task = height.tasks.get(2)
54
54
  ```
55
55
 
56
+ And update it
57
+
58
+ ```ruby
59
+ updated_task = task.update('status' => 'inProgress')
60
+ ```
61
+
56
62
  ## Development
57
63
 
58
64
  After checking out the repo, run `bin/setup` to install dependencies. Then, run
data/height-api.gemspec CHANGED
@@ -14,7 +14,7 @@ Gem::Specification.new do |spec|
14
14
 
15
15
  spec.metadata["homepage_uri"] = spec.homepage
16
16
  spec.metadata["source_code_uri"] = spec.homepage
17
- spec.metadata["changelog_uri"] = "https://github.com/mauromorales/height-api/CHANGELOG.md"
17
+ spec.metadata["changelog_uri"] = "#{spec.homepage}/blob/main/CHANGELOG.md"
18
18
 
19
19
  # Specify which files should be added to the gem when it is released.
20
20
  # The `git ls-files -z` loads the files in the RubyGem that have been added into git.
@@ -12,6 +12,12 @@ class Height::API::Tasks
12
12
 
13
13
  Height::Response.parse(res.body)
14
14
  end
15
+
16
+ def update_task(id_or_index, data)
17
+ res = Height::Request.put("tasks/#{id_or_index}", data)
18
+
19
+ Height::Response.parse(res.body)
20
+ end
15
21
  end
16
22
  end
17
23
 
@@ -8,5 +8,9 @@ module Height::Model
8
8
  :created_user_id, :last_activity_at, :url
9
9
  ]
10
10
  end
11
+
12
+ def update(attrs)
13
+ Height::API::Tasks.update_task(id, attrs)
14
+ end
11
15
  end
12
16
  end
@@ -12,4 +12,19 @@ class Height::Request
12
12
 
13
13
  http.request(req)
14
14
  end
15
+
16
+ def self.put(endpoint, data)
17
+ uri = URI("https://api.height.app/#{endpoint}")
18
+ http = Net::HTTP.new(uri.hostname, uri.port)
19
+ http.use_ssl = true
20
+ headers = {
21
+ 'Authorization' => "api-key #{ENV['HEIGHT_API_KEY']}",
22
+ 'Content-Type' => 'application/json'
23
+ }
24
+ req = Net::HTTP::Put.new(uri, headers)
25
+ req.body = data.to_json
26
+ res = http.request(req)
27
+
28
+ http.request(req)
29
+ end
15
30
  end
@@ -1,3 +1,3 @@
1
1
  module Height
2
- VERSION = '0.0.1'
2
+ VERSION = '0.0.2'
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: height-api
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Mauro Morales
@@ -90,7 +90,7 @@ licenses:
90
90
  metadata:
91
91
  homepage_uri: https://github.com/mauromorales/height-api
92
92
  source_code_uri: https://github.com/mauromorales/height-api
93
- changelog_uri: https://github.com/mauromorales/height-api/CHANGELOG.md
93
+ changelog_uri: https://github.com/mauromorales/height-api/blob/main/CHANGELOG.md
94
94
  post_install_message:
95
95
  rdoc_options: []
96
96
  require_paths: