3llo 1.0.0.pre.rc.0 → 1.0.0

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.
@@ -55,5 +55,15 @@ module Tr3llo
55
55
  def format_highlight(string)
56
56
  paint(string, "yellow")
57
57
  end
58
+
59
+ def build_req_path(path, extra_params = {})
60
+ params =
61
+ {
62
+ "key" => Application.fetch_configuration!().api_key,
63
+ "token" => Application.fetch_configuration!().api_token
64
+ }.merge(extra_params)
65
+
66
+ [path, URI.encode_www_form(params)].join("?")
67
+ end
58
68
  end
59
69
  end
@@ -1,3 +1,3 @@
1
1
  module Tr3llo
2
- VERSION = "1.0.0-rc.0"
2
+ VERSION = "1.0.0".freeze
3
3
  end
@@ -1,11 +1,11 @@
1
- require '3llo/view/help'
2
- require '3llo/view/board/list'
3
- require '3llo/view/board/help'
4
- require '3llo/view/card/help'
5
- require '3llo/view/card/list'
6
- require '3llo/view/card/list_mine'
7
- require '3llo/view/card/show'
8
- require '3llo/view/card/comments'
9
- require '3llo/view/list/help'
10
- require '3llo/view/list/list'
11
- require '3llo/view/list/cards'
1
+ require "3llo/view/help"
2
+ require "3llo/view/board/list"
3
+ require "3llo/view/board/help"
4
+ require "3llo/view/card/help"
5
+ require "3llo/view/card/list"
6
+ require "3llo/view/card/list_mine"
7
+ require "3llo/view/card/show"
8
+ require "3llo/view/card/comments"
9
+ require "3llo/view/list/help"
10
+ require "3llo/view/list/list"
11
+ require "3llo/view/list/cards"
@@ -6,8 +6,8 @@ module Tr3llo
6
6
 
7
7
  def render(boards)
8
8
  boards
9
- .map { |board| render_board(board) }
10
- .join("\n")
9
+ .map { |board| render_board(board) }
10
+ .join("\n")
11
11
  end
12
12
 
13
13
  private
@@ -9,7 +9,7 @@ module Tr3llo
9
9
  #{Utils.format_bold("# Available card commands:")}
10
10
 
11
11
  card list - Show list of cards grouped by list
12
- card list mine - Show list of my cards
12
+ card list-mine - Show list of my cards
13
13
  card add - Create a card
14
14
  card show <key> - Show card information
15
15
  card move <key> - Move card to a list
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: 3llo
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0.pre.rc.0
4
+ version: 1.0.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cẩm Huỳnh
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2020-01-17 00:00:00.000000000 Z
11
+ date: 2020-01-23 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: tty-prompt
@@ -38,6 +38,20 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: '3.0'
41
+ - !ruby/object:Gem::Dependency
42
+ name: rubocop
43
+ requirement: !ruby/object:Gem::Requirement
44
+ requirements:
45
+ - - "~>"
46
+ - !ruby/object:Gem::Version
47
+ version: '0.79'
48
+ type: :development
49
+ prerelease: false
50
+ version_requirements: !ruby/object:Gem::Requirement
51
+ requirements:
52
+ - - "~>"
53
+ - !ruby/object:Gem::Version
54
+ version: '0.79'
41
55
  description: Interactive CLI application for Trello
42
56
  email:
43
57
  - huynhquancam@gmail.com
@@ -48,6 +62,7 @@ extra_rdoc_files: []
48
62
  files:
49
63
  - ".github/workflows/ci.yml"
50
64
  - ".gitignore"
65
+ - ".rubocop.yml"
51
66
  - 3llo.gemspec
52
67
  - CHANGELOG.md
53
68
  - Gemfile
@@ -79,6 +94,7 @@ files:
79
94
  - lib/3llo/command/card/check_item.rb
80
95
  - lib/3llo/command/card/comment.rb
81
96
  - lib/3llo/command/card/comments.rb
97
+ - lib/3llo/command/card/edit.rb
82
98
  - lib/3llo/command/card/edit_checklist.rb
83
99
  - lib/3llo/command/card/edit_item.rb
84
100
  - lib/3llo/command/card/invalid.rb
@@ -102,10 +118,9 @@ files:
102
118
  - lib/3llo/controller.rb
103
119
  - lib/3llo/entities.rb
104
120
  - lib/3llo/errors.rb
105
- - lib/3llo/http/client.rb
106
- - lib/3llo/http/request_error.rb
107
121
  - lib/3llo/interface.rb
108
122
  - lib/3llo/registry.rb
123
+ - lib/3llo/remote_server.rb
109
124
  - lib/3llo/utils.rb
110
125
  - lib/3llo/version.rb
111
126
  - lib/3llo/view.rb
@@ -138,9 +153,9 @@ required_ruby_version: !ruby/object:Gem::Requirement
138
153
  version: '2.5'
139
154
  required_rubygems_version: !ruby/object:Gem::Requirement
140
155
  requirements:
141
- - - ">"
156
+ - - ">="
142
157
  - !ruby/object:Gem::Version
143
- version: 1.3.1
158
+ version: '0'
144
159
  requirements: []
145
160
  rubygems_version: 3.1.2
146
161
  signing_key:
@@ -1,95 +0,0 @@
1
- require 'uri'
2
- require 'net/http'
3
- require 'openssl'
4
- require '3llo/http/request_error'
5
-
6
- module Tr3llo
7
- module HTTP
8
- module Client
9
- extend self
10
-
11
- BASE_URL = "https://api.trello.com/1"
12
-
13
- def get(path, params = {})
14
- uri = URI("#{BASE_URL}#{path}?#{query_string(params)}")
15
-
16
- http = Net::HTTP.new(uri.host, uri.port)
17
- http.use_ssl = true
18
- request = Net::HTTP::Get.new(uri.request_uri)
19
-
20
- res = http.request(request)
21
-
22
- case res
23
- when Net::HTTPSuccess then res.body
24
- else raise(RequestError.new(res.body))
25
- end
26
- end
27
-
28
- def post(path, params)
29
- uri = URI("#{BASE_URL}#{path}")
30
-
31
- http = Net::HTTP.new(uri.host, uri.port)
32
- http.use_ssl = true
33
- req_headers = {
34
- 'Accept' => 'application/json',
35
- 'Content-Type' => 'application/json',
36
- }
37
- request = Net::HTTP::Post.new(uri.request_uri, req_headers)
38
- request.body = JSON.dump(params)
39
-
40
- res = http.request(request)
41
-
42
- case res
43
- when Net::HTTPOK then res.body
44
- else raise(RequestError.new(res.body))
45
- end
46
- end
47
-
48
- def put(path, params)
49
- uri = URI("#{BASE_URL}#{path}")
50
-
51
- http = Net::HTTP.new(uri.host, uri.port)
52
- http.use_ssl = true
53
- req_headers = {
54
- 'Accept' => 'application/json',
55
- 'Content-Type' => 'application/json',
56
- }
57
- request = Net::HTTP::Put.new(uri.request_uri, req_headers)
58
- request.body = JSON.dump(params)
59
-
60
- res = http.request(request)
61
-
62
- case res
63
- when Net::HTTPOK then res.body
64
- else raise(RequestError.new(res.body))
65
- end
66
- end
67
-
68
- def delete(path, params)
69
- uri = URI("#{BASE_URL}#{path}")
70
-
71
- http = Net::HTTP.new(uri.host, uri.port)
72
- http.use_ssl = true
73
- req_headers = {
74
- 'Accept' => 'application/json',
75
- 'Content-Type' => 'application/json',
76
- }
77
- request = Net::HTTP::Delete.new(uri.request_uri, req_headers)
78
- request.body = JSON.dump(params)
79
-
80
- res = http.request(request)
81
-
82
- case res
83
- when Net::HTTPOK then res.body
84
- else raise(RequestError.new(res.body))
85
- end
86
- end
87
-
88
- private
89
-
90
- def query_string(params)
91
- URI.encode_www_form(params)
92
- end
93
- end
94
- end
95
- end
@@ -1,18 +0,0 @@
1
- module Tr3llo
2
- module HTTP
3
- module Client
4
- class RequestError < ::StandardError
5
- attr_reader :response
6
-
7
- def initialize(response)
8
- @response = response
9
- super()
10
- end
11
-
12
- def message
13
- "Request error: #{response}"
14
- end
15
- end
16
- end
17
- end
18
- end