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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: dd4f0cf602199fad19074ed29b18790479cd500e48ab53f1a610039aadc94ced
4
- data.tar.gz: 12500593cc560ea42b4a24fac93a20bf70a5e1804af46e74725078c85696f395
3
+ metadata.gz: 0007d04d4e6a9c339010d25a6d854f94e4c5c3c7b543ad702c1c53c447403089
4
+ data.tar.gz: df612eda42d8c915693d10f90b2a481add44cc51bb44b99b0fa38ebfe1d7c5fc
5
5
  SHA512:
6
- metadata.gz: aaa7ccae5edec5abbe16486314c95fed2c65a66edaa2af89c47dc4413d0d0cb76a3e39bd796e1d3dcf200128cc313a7f23a80fa7cfbc5fbcd6790d8f91bce2d6
7
- data.tar.gz: fd73e9c618a4d10482d934b76b45fa76218161052d365b99f1823ff8528fd8fbcb1036dac5da35a2967ceee30b1d2bd2b80e77e7433d5723c6af1c2b72f1a0a1
6
+ metadata.gz: 2ac97b2d8005a973eb6224c6d8a9e53050cbbe812c7777858b75288dfaf244502681b1f0181e45c4c3ac62dc89ddef52cc04325079a9cafbe5f2bd69f6cf65af
7
+ data.tar.gz: 43537b87e49dcb9e8f3323f6bc551bebc91673ac7f2861d395b08fe10ed19023d3c6b4d8ee48487cfe115ed038a8d28523fb45b68fba49d632357f1fff9496a9
data/Gemfile.lock CHANGED
@@ -1,7 +1,7 @@
1
1
  PATH
2
2
  remote: .
3
3
  specs:
4
- tredo (0.1.1)
4
+ tredo (0.1.2)
5
5
  jsender (~> 2.2.0)
6
6
  rest-client (~> 2.1.0)
7
7
 
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: Unpublished to RubyGems 🧨
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
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module Tredo
4
- VERSION = "0.1.1"
4
+ VERSION = "0.1.2"
5
5
  end
data/lib/tredo.rb CHANGED
@@ -15,6 +15,12 @@ module Tredo
15
15
  todo = Todo.new(restclient)
16
16
  todo.lists
17
17
  end
18
+
19
+ def self.todos_for_list(list_id)
20
+ restclient = RestProvider.new
21
+ todo = Todo.new(restclient)
22
+ todo.actions(list_id)
23
+ end
18
24
  end
19
25
 
20
26
  require "tredo/todo"
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: tredo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.1
4
+ version: 0.1.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dane Balia