tredo 0.1.1 → 0.1.2
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 +4 -4
- data/Gemfile.lock +1 -1
- data/README.md +1 -1
- data/lib/tredo/todo.rb +15 -0
- data/lib/tredo/version.rb +1 -1
- data/lib/tredo.rb +6 -0
- metadata +1 -1
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 0007d04d4e6a9c339010d25a6d854f94e4c5c3c7b543ad702c1c53c447403089
|
4
|
+
data.tar.gz: df612eda42d8c915693d10f90b2a481add44cc51bb44b99b0fa38ebfe1d7c5fc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 2ac97b2d8005a973eb6224c6d8a9e53050cbbe812c7777858b75288dfaf244502681b1f0181e45c4c3ac62dc89ddef52cc04325079a9cafbe5f2bd69f6cf65af
|
7
|
+
data.tar.gz: 43537b87e49dcb9e8f3323f6bc551bebc91673ac7f2861d395b08fe10ed19023d3c6b4d8ee48487cfe115ed038a8d28523fb45b68fba49d632357f1fff9496a9
|
data/Gemfile.lock
CHANGED
data/README.md
CHANGED
@@ -9,7 +9,7 @@ At present it currently supports Trello and as more providers are supported, so
|
|
9
9
|
- Lastly it also tries to be agnostic to REST Provider by leveraging off the Provider model pattern allowing you to leverage [rest-client](https://github.com/rest-client/rest-client), [faraday](https://github.com/lostisland/faraday) or [http party](https://github.com/jnunemaker/httparty).
|
10
10
|
- The intended use case for Tredo is as a gem in a Component Based Rails Application (engine).
|
11
11
|
|
12
|
-
## Status:
|
12
|
+
## Status: Published to [RubyGems](https://rubygems.org/gems/tredo) 🧨
|
13
13
|
|
14
14
|
## Installation
|
15
15
|
|
data/lib/tredo/todo.rb
CHANGED
@@ -45,6 +45,21 @@ module Tredo
|
|
45
45
|
error("Bad request")
|
46
46
|
end
|
47
47
|
|
48
|
+
def actions(list_id)
|
49
|
+
return error(message: "Missing Token or Key") if invalid_auth?
|
50
|
+
return error("List Id cannot be nil or empty") if list_id.nil? || list_id.empty?
|
51
|
+
|
52
|
+
url = "#{BASE_URL}/lists/#{list_id}/actions?token=#{@token}&key=#{@key}"
|
53
|
+
response = @restprovider.get url
|
54
|
+
return error("Failed to retrieve actions for list.") if response.code != 200
|
55
|
+
|
56
|
+
Jsender::Json.success(data: { "result" => response.body })
|
57
|
+
rescue RestClient::Unauthorized
|
58
|
+
error("Unauthorized access.")
|
59
|
+
rescue RestClient::BadRequest
|
60
|
+
error("Bad request")
|
61
|
+
end
|
62
|
+
|
48
63
|
private
|
49
64
|
|
50
65
|
def error(message)
|
data/lib/tredo/version.rb
CHANGED
data/lib/tredo.rb
CHANGED