trello-changelog 1.0.0 → 1.0.1

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: e12cbf871ff56176304a80c53fa4f1cc81f0f6be
4
- data.tar.gz: 75082590618f93d8e871d3dfb5a7d43de4adbf56
3
+ metadata.gz: dcf21cfc9aa10d0da0b5727a1050f24cde0d4560
4
+ data.tar.gz: f1118d878ba03c2ff7b5897b12894ab66401557b
5
5
  SHA512:
6
- metadata.gz: 3dc8fd987bc9f549ad757f989a4a50a8e97b1bb164e8f6432a9867967c92d61a61da9eeaf551803bb4fd976c560adce4e25d8457816a0b149fadf6348b664392
7
- data.tar.gz: f4dd053373ba3ea58737d2f4f9d49ab312ba6ee91bbde414ab0ea90f9cc8b777233a327ea0cf906f5e394f1ca0a76e5a8dbcec12571a5acc579de25c8cb52377
6
+ metadata.gz: e95de4e22874c3ca62c3da0fb7bbddd038934989991c8128380547d09e6f8bc0cd86e8e00241c62ddd720c5997464ee6549a9f0f4f2ff44477197d861000aab9
7
+ data.tar.gz: 621986ec58ec2362fa6b1fed0dd5d486b56838491a7e67babc19769d88ff80cf13acb17395bdec6535e40071d917be18165e60b500b8e47c8a66480b55e3e12a
@@ -18,7 +18,7 @@ class TrelloChangelogCommand < Thor
18
18
  option :labels, type: :array, desc: "Specific labels you want to output"
19
19
 
20
20
  def print
21
- TrelloChangelog.new(options)
21
+ TrelloChangelog.new(options).print
22
22
  end
23
23
  end
24
24
 
@@ -11,7 +11,5 @@ class TrelloChangelog
11
11
  load_config_file
12
12
  configure_trello
13
13
  start_date(@options[:start_date])
14
-
15
- print
16
14
  end
17
15
  end
@@ -2,42 +2,49 @@ require 'trello-changelog/tickets'
2
2
 
3
3
  class TrelloChangelog
4
4
  def print
5
- print_summary
6
- print_labels
7
- print_unlabeled
5
+ puts build_output
8
6
  end
9
7
 
10
- def print_summary
11
- puts "# Start date: #{start_date}\n\n"
8
+ def build_output
9
+ @output = ""
10
+ build_summary
11
+ build_labels
12
+ build_unlabeled
12
13
 
13
- puts "Created Trello items since #{start_date}: #{new_tickets_count}\n\n"
14
- puts "Finished Trello items since #{start_date}: #{done_tickets_count}\n\n"
15
- puts "Archived Trello items since #{start_date}: #{archived_tickets_count}\n\n"
14
+ @output
15
+ end
16
+
17
+ def build_summary
18
+ @output << "# Start date: #{start_date}\n\n"
19
+
20
+ @output << "Created Trello items since #{start_date}: #{new_tickets_count}\n\n"
21
+ @output << "Finished Trello items since #{start_date}: #{done_tickets_count}\n\n"
22
+ @output << "Archived Trello items since #{start_date}: #{archived_tickets_count}\n\n"
16
23
 
17
- puts "Summary: #{new_tickets_count} tickets in, #{done_tickets_count + archived_tickets_count} tickets out\n\n"
24
+ @output << "Summary: #{new_tickets_count} tickets in, #{done_tickets_count + archived_tickets_count} tickets out\n\n"
18
25
  end
19
26
 
20
- def print_labels
27
+ def build_labels
21
28
  for label_name in @config[:labels] do
22
29
  tickets_label_name = done_tickets.select { |ticket| ticket.labels.select { |label| label.name == label_name}.count > 0 }
23
- puts "\n## #{label_name}:\n\n"
30
+ @output << "\n## #{label_name}:\n\n"
24
31
  tickets_label_name.each do |ticket|
25
- puts " * [#{ticket.name}](#{ticket.url})"
32
+ @output << " * [#{ticket.name}](#{ticket.url})\n"
26
33
  end
27
- puts 'n.a.' if tickets_label_name.count == 0
34
+ @output << 'n.a.' if tickets_label_name.count == 0
28
35
  end
29
36
  end
30
37
 
31
- def print_unlabeled
38
+ def build_unlabeled
32
39
  @unlabeled_done_tickets = done_tickets
33
40
 
34
41
  @config[:labels].each do |label|
35
42
  @unlabeled_done_tickets.select! { |ticket| !ticket.card_labels.find{ |card_label| card_label['name'] == label} }
36
43
  end
37
44
 
38
- puts "\n## Other"
45
+ @output << "\n## Other\n\n"
39
46
  @unlabeled_done_tickets.each do |ticket|
40
- puts " * [#{ticket.name}](#{ticket.url})"
47
+ @output << " * [#{ticket.name}](#{ticket.url})\n"
41
48
  end
42
49
  end
43
50
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trello-changelog
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.0.0
4
+ version: 1.0.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Giel De Bleser
@@ -19,7 +19,7 @@ dependencies:
19
19
  - - ">="
20
20
  - !ruby/object:Gem::Version
21
21
  version: '0'
22
- type: :runtime
22
+ type: :development
23
23
  prerelease: false
24
24
  version_requirements: !ruby/object:Gem::Requirement
25
25
  requirements: