trello_tool 0.2.0 → 0.3.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +4 -0
- data/lib/trello_tool/health.rb +5 -1
- data/lib/trello_tool/trello_client.rb +6 -0
- data/lib/trello_tool/util.rb +7 -0
- data/lib/trello_tool/version.rb +1 -1
- data/lib/trello_tool_thor.rb +32 -0
- metadata +3 -7
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 6285e864995998fa87994fef2bc12d24aa75b9e041a021c694a441ef66f2ee6f
|
|
4
|
+
data.tar.gz: 0f4513bd8adb2690cc7b3fa6f8f3e18bbd3646e1f0cdad4ffdecf686953e2007
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: d69e46335a0ce78842525b55bf821e3af32ffc72eaaee6c4de4da144827b91fd5f21df905d5ffa52ebc21e8b5ec972f5bb62ecd8c5f179138ffe427ad4174143
|
|
7
|
+
data.tar.gz: 5fe44e4a578ea926056e8617a8e1080dd30df28fca91c03733ce175e80066a3881f23e466a3c77700e9452c43d6b43f20850d7eb73c0099bdd2a3256ae7f8628
|
data/CHANGELOG.md
CHANGED
data/lib/trello_tool/health.rb
CHANGED
|
@@ -3,7 +3,11 @@
|
|
|
3
3
|
module TrelloTool
|
|
4
4
|
# Health analysis of a board
|
|
5
5
|
class Health
|
|
6
|
-
|
|
6
|
+
# @return [Trello::Board]
|
|
7
|
+
attr_reader :board
|
|
8
|
+
# @return [TrelloTool::Configuration]
|
|
9
|
+
attr_reader :configuration
|
|
10
|
+
attr_reader :symbols_and_colours, :unexpected, :expected_lists
|
|
7
11
|
|
|
8
12
|
def initialize(board, configuration)
|
|
9
13
|
@board = board
|
|
@@ -54,6 +54,12 @@ module TrelloTool
|
|
|
54
54
|
end
|
|
55
55
|
end
|
|
56
56
|
|
|
57
|
+
# @param card_id [String]
|
|
58
|
+
# @return [Trello::Card]
|
|
59
|
+
def find_card(card_id)
|
|
60
|
+
client.find(:cards, card_id)
|
|
61
|
+
end
|
|
62
|
+
|
|
57
63
|
def next_version_list
|
|
58
64
|
@next_version_list ||= find_list_by_list_name(main_board, configuration.next_version_list_name)
|
|
59
65
|
end
|
data/lib/trello_tool/util.rb
CHANGED
|
@@ -14,6 +14,13 @@ module TrelloTool
|
|
|
14
14
|
match_data[1]
|
|
15
15
|
end
|
|
16
16
|
|
|
17
|
+
# @param card_id_or_url [String] a card id or a https://trello.com/c/ID/description url
|
|
18
|
+
# @return [String] the card id
|
|
19
|
+
def extract_card_id(card_id_or_url)
|
|
20
|
+
match_data = %r{\Ahttps://trello.com/c/([a-zA-Z0-9]+)/?.*}.match(card_id_or_url)
|
|
21
|
+
match_data ? match_data[1] : card_id_or_url
|
|
22
|
+
end
|
|
23
|
+
|
|
17
24
|
# @param board [Trello::Board]
|
|
18
25
|
# @param list_name [String]
|
|
19
26
|
# @return [Trello::List]
|
data/lib/trello_tool/version.rb
CHANGED
data/lib/trello_tool_thor.rb
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
# frozen_string_literal: true
|
|
2
2
|
|
|
3
|
+
require "json"
|
|
3
4
|
require "thor"
|
|
4
5
|
require "trello_tool/configuration"
|
|
5
6
|
require "trello_tool/health"
|
|
@@ -89,6 +90,14 @@ class TrelloToolThor < Thor
|
|
|
89
90
|
end
|
|
90
91
|
end
|
|
91
92
|
|
|
93
|
+
desc "card CARD_ID_OR_URL",
|
|
94
|
+
"prints out a card as json (title, description, url, checklists, attachment urls)"
|
|
95
|
+
|
|
96
|
+
def card(card_id_or_url)
|
|
97
|
+
card = client.find_card(extract_card_id(card_id_or_url))
|
|
98
|
+
say JSON.pretty_generate(card_as_hash(card))
|
|
99
|
+
end
|
|
100
|
+
|
|
92
101
|
desc "release (VERSION)",
|
|
93
102
|
"rename next_version to VERSION and create next_version. If VERSION isn't specified use whatever is in ./.RELEASE_NEW_VERSION"
|
|
94
103
|
|
|
@@ -167,5 +176,28 @@ class TrelloToolThor < Thor
|
|
|
167
176
|
def client
|
|
168
177
|
TrelloTool::TrelloClient.new(configuration)
|
|
169
178
|
end
|
|
179
|
+
|
|
180
|
+
# @param card [Trello::Card]
|
|
181
|
+
# @return [Hash]
|
|
182
|
+
def card_as_hash(card)
|
|
183
|
+
{
|
|
184
|
+
title: card.name,
|
|
185
|
+
description: card.desc,
|
|
186
|
+
url: card.url,
|
|
187
|
+
checklists: card.checklists.map { |checklist| checklist_as_hash(checklist) },
|
|
188
|
+
attachment_urls: card.attachments.map(&:url)
|
|
189
|
+
}
|
|
190
|
+
end
|
|
191
|
+
|
|
192
|
+
# @param checklist [Trello::Checklist]
|
|
193
|
+
# @return [Hash]
|
|
194
|
+
def checklist_as_hash(checklist)
|
|
195
|
+
{
|
|
196
|
+
name: checklist.name,
|
|
197
|
+
items: checklist.check_items.map do |item|
|
|
198
|
+
{ name: item["name"], complete: item["state"] == "complete" }
|
|
199
|
+
end
|
|
200
|
+
}
|
|
201
|
+
end
|
|
170
202
|
end
|
|
171
203
|
# rubocop:enable Metrics/ClassLength
|
metadata
CHANGED
|
@@ -1,14 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: trello_tool
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
version: 0.
|
|
4
|
+
version: 0.3.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- Tim Diggins
|
|
8
|
-
autorequire:
|
|
9
8
|
bindir: exe
|
|
10
9
|
cert_chain: []
|
|
11
|
-
date:
|
|
10
|
+
date: 1980-01-02 00:00:00.000000000 Z
|
|
12
11
|
dependencies:
|
|
13
12
|
- !ruby/object:Gem::Dependency
|
|
14
13
|
name: ruby-trello
|
|
@@ -38,7 +37,6 @@ dependencies:
|
|
|
38
37
|
- - ">="
|
|
39
38
|
- !ruby/object:Gem::Version
|
|
40
39
|
version: '0'
|
|
41
|
-
description:
|
|
42
40
|
email:
|
|
43
41
|
- tim@red56.uk
|
|
44
42
|
executables:
|
|
@@ -73,7 +71,6 @@ metadata:
|
|
|
73
71
|
source_code_uri: https://github.com/timdiggins/trello_tool
|
|
74
72
|
changelog_uri: https://github.com/timdiggins/trello_tool/blob/main/CHANGELOG.md
|
|
75
73
|
rubygems_mfa_required: 'true'
|
|
76
|
-
post_install_message:
|
|
77
74
|
rdoc_options: []
|
|
78
75
|
require_paths:
|
|
79
76
|
- lib
|
|
@@ -88,8 +85,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
|
88
85
|
- !ruby/object:Gem::Version
|
|
89
86
|
version: '0'
|
|
90
87
|
requirements: []
|
|
91
|
-
rubygems_version:
|
|
92
|
-
signing_key:
|
|
88
|
+
rubygems_version: 4.0.14
|
|
93
89
|
specification_version: 4
|
|
94
90
|
summary: Tool for doing basic things to a dev trello using the api.
|
|
95
91
|
test_files: []
|