trello-changelog 0.4.0 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/bin/trello-changelog +6 -1
- data/lib/trello-changelog.rb +5 -2
- data/lib/trello-changelog/config.rb +14 -3
- data/lib/trello-changelog/printers.rb +2 -2
- data/lib/trello-changelog/tickets.rb +2 -2
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: e12cbf871ff56176304a80c53fa4f1cc81f0f6be
|
4
|
+
data.tar.gz: 75082590618f93d8e871d3dfb5a7d43de4adbf56
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 3dc8fd987bc9f549ad757f989a4a50a8e97b1bb164e8f6432a9867967c92d61a61da9eeaf551803bb4fd976c560adce4e25d8457816a0b149fadf6348b664392
|
7
|
+
data.tar.gz: f4dd053373ba3ea58737d2f4f9d49ab312ba6ee91bbde414ab0ea90f9cc8b777233a327ea0cf906f5e394f1ca0a76e5a8dbcec12571a5acc579de25c8cb52377
|
data/bin/trello-changelog
CHANGED
@@ -11,9 +11,14 @@ class TrelloChangelogCommand < Thor
|
|
11
11
|
'this parameter is only needed if you want to run on an other day than friday.'
|
12
12
|
)
|
13
13
|
option :start_date, type: :string, desc: 'Start date'
|
14
|
+
option :devkey, type: :string, desc: "Trello key"
|
15
|
+
option :mem_token, type: :string, desc: "Trello token"
|
16
|
+
option :board, type: :string, desc: "Trello board ID"
|
17
|
+
option :done_list_name, type: :string, desc: "Name of the 'Done' list"
|
18
|
+
option :labels, type: :array, desc: "Specific labels you want to output"
|
14
19
|
|
15
20
|
def print
|
16
|
-
TrelloChangelog.new(options
|
21
|
+
TrelloChangelog.new(options)
|
17
22
|
end
|
18
23
|
end
|
19
24
|
|
data/lib/trello-changelog.rb
CHANGED
@@ -2,12 +2,15 @@ require 'date'
|
|
2
2
|
require 'trello'
|
3
3
|
require 'trello-changelog/config'
|
4
4
|
require 'trello-changelog/printers'
|
5
|
+
require 'active_support/core_ext/hash/indifferent_access'
|
5
6
|
|
6
7
|
class TrelloChangelog
|
7
|
-
def initialize(
|
8
|
+
def initialize(options)
|
9
|
+
@options = options.with_indifferent_access
|
10
|
+
|
8
11
|
load_config_file
|
9
12
|
configure_trello
|
10
|
-
start_date
|
13
|
+
start_date(@options[:start_date])
|
11
14
|
|
12
15
|
print
|
13
16
|
end
|
@@ -2,8 +2,19 @@ class TrelloChangelog
|
|
2
2
|
private
|
3
3
|
|
4
4
|
def load_config_file
|
5
|
+
@config = HashWithIndifferentAccess.new(labels: [])
|
6
|
+
if %w(devkey mem_token board done_list_name).all? { |key| @options.has_key?(key) }
|
7
|
+
puts "Config set via cli, ~/.trello-changelog.rb not loaded"
|
8
|
+
@options.each { |key, value| @config[key] = value }
|
9
|
+
return true
|
10
|
+
end
|
5
11
|
begin
|
6
12
|
require '~/.trello-changelog.rb'
|
13
|
+
@config[:devkey] = Variables::DEVKEY
|
14
|
+
@config[:mem_token] = Variables::MEM_TOKEN
|
15
|
+
@config[:board] = Variables::BOARD
|
16
|
+
@config[:done_list_name] = Variables::DONE_LIST_NAME
|
17
|
+
@config[:labels] = Variables::LABELS || []
|
7
18
|
rescue LoadError
|
8
19
|
puts 'File: ".trello-changelog.rb" was not found in your home directory! See README on Github.'
|
9
20
|
exit
|
@@ -12,8 +23,8 @@ class TrelloChangelog
|
|
12
23
|
|
13
24
|
def configure_trello
|
14
25
|
Trello.configure do |trello_config|
|
15
|
-
trello_config.developer_public_key =
|
16
|
-
trello_config.member_token =
|
26
|
+
trello_config.developer_public_key = @config[:devkey]
|
27
|
+
trello_config.member_token = @config[:mem_token]
|
17
28
|
end
|
18
29
|
end
|
19
30
|
|
@@ -23,7 +34,7 @@ class TrelloChangelog
|
|
23
34
|
Date.today - 6
|
24
35
|
else
|
25
36
|
begin
|
26
|
-
Date.parse
|
37
|
+
Date.parse(start_date)
|
27
38
|
rescue ArgumentError
|
28
39
|
puts 'The start date syntax is wrong. Possible correct syntax are:'\
|
29
40
|
'YYYY-MM-DD, DD-MM-YYYY, YYYY/MM/DD, DD/MM/YYYY, ... . Please try again.'
|
@@ -18,7 +18,7 @@ class TrelloChangelog
|
|
18
18
|
end
|
19
19
|
|
20
20
|
def print_labels
|
21
|
-
for label_name in
|
21
|
+
for label_name in @config[:labels] do
|
22
22
|
tickets_label_name = done_tickets.select { |ticket| ticket.labels.select { |label| label.name == label_name}.count > 0 }
|
23
23
|
puts "\n## #{label_name}:\n\n"
|
24
24
|
tickets_label_name.each do |ticket|
|
@@ -31,7 +31,7 @@ class TrelloChangelog
|
|
31
31
|
def print_unlabeled
|
32
32
|
@unlabeled_done_tickets = done_tickets
|
33
33
|
|
34
|
-
|
34
|
+
@config[:labels].each do |label|
|
35
35
|
@unlabeled_done_tickets.select! { |ticket| !ticket.card_labels.find{ |card_label| card_label['name'] == label} }
|
36
36
|
end
|
37
37
|
|
@@ -2,11 +2,11 @@ require 'trello-changelog/trello/card'
|
|
2
2
|
|
3
3
|
class TrelloChangelog
|
4
4
|
def board
|
5
|
-
@board ||= Trello::Board.find(
|
5
|
+
@board ||= Trello::Board.find(@config[:board])
|
6
6
|
end
|
7
7
|
|
8
8
|
def done_list
|
9
|
-
@done_list ||= board.lists.select { |list| list.name ==
|
9
|
+
@done_list ||= board.lists.select { |list| list.name == @config[:done_list_name] }.last
|
10
10
|
end
|
11
11
|
|
12
12
|
def new_tickets
|
metadata
CHANGED
@@ -1,10 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: trello-changelog
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Giel De Bleser
|
8
|
+
- Steven De Coeyer
|
9
|
+
- Joren De Groof
|
8
10
|
autorequire:
|
9
11
|
bindir: bin
|
10
12
|
cert_chain: []
|
@@ -99,7 +101,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
99
101
|
version: '0'
|
100
102
|
requirements: []
|
101
103
|
rubyforge_project:
|
102
|
-
rubygems_version: 2.
|
104
|
+
rubygems_version: 2.5.1
|
103
105
|
signing_key:
|
104
106
|
specification_version: 4
|
105
107
|
summary: Changelog for Trello
|