trollolo 0.0.14 → 0.1.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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: f4295e5c47f7aa40b7fad0f65428799f4c9006e7
4
- data.tar.gz: efc7d3c6c3a3fdb1e17e5643ff4d6d070fd1888d
3
+ metadata.gz: fbbc51baa3b518ce1f41bf52c96bd713ad0d6803
4
+ data.tar.gz: d9c196184db4a2428228bc4ed4a3c03db721f468
5
5
  SHA512:
6
- metadata.gz: 52ddc3a73a99e6559108774a4b81c024e3066d1b63d08ed19922391cfafe09245401abfd1264e02e66e908de27506db30c7b747a137dc112cab77a97df9b7a9b
7
- data.tar.gz: 12c796097f02a0d67add11c7c98540409adf165ce9c83a0bb6ebb3530a7032d71afb777c71329cf85022f61c36c71cc6885121b0cde5b1a8b91ffe9a2ef095a5
6
+ metadata.gz: 81f6e72d327accdbfd42bd8d1d2c4716ef7423d99a2e022a3fa0f22f995f7ab22ab839b6b2d69c5f552921df317d13461a3e82b0188d8792edd4258cceb591f4
7
+ data.tar.gz: 219765edd591158ced4a01393dfb4ee8013f6226e349ac5e81077a27778fa138e72d9b7106544a910138c0e1a7f0f0a2b07a94b241c8ea2023eee5c420c591c1
data/CHANGELOG.md CHANGED
@@ -3,6 +3,14 @@
3
3
  ## Master (unreleased)
4
4
 
5
5
 
6
+ ## Version 0.1.0
7
+
8
+ * Fix `plot-to-board` option in the burndown command when it is used together
9
+ with `-o`.
10
+ * `burndown --plot-to-board` always sets the burndown chart as the cover.
11
+ Fix #114.
12
+ * Allow to create and update an Sprint with a custom number. Fix #78.
13
+
6
14
  ## Version 0.0.14
7
15
 
8
16
  * Add a new `plot-to-board` option to the burndown command to send the plotted
data/README.md CHANGED
@@ -26,6 +26,9 @@ You can install Trollolo as gem with `gem install trollolo`.
26
26
  For the chart generation you will need a working matplotlib installation and
27
27
  the python module to read YAML. On openSUSE you can get that with
28
28
 
29
+ zypper install python2-matplotlib python2-matplotlib-tk python2-PyYAML
30
+ or
31
+
29
32
  zypper install python-matplotlib python-matplotlib-tk python-PyYAML
30
33
 
31
34
  ## Configuration
@@ -180,8 +180,9 @@ class BurndownChart
180
180
  last_sprint
181
181
  end
182
182
 
183
- def load_last_sprint(burndown_dir)
184
- self.sprint = last_sprint(burndown_dir)
183
+ # It loads the sprint for the given number or the last one if it is nil
184
+ def load_sprint(burndown_dir, number = nil)
185
+ self.sprint = number || last_sprint(burndown_dir)
185
186
  burndown_data_path = File.join(burndown_dir, burndown_data_filename)
186
187
  begin
187
188
  read_data burndown_data_path
@@ -192,7 +193,7 @@ class BurndownChart
192
193
  end
193
194
 
194
195
  def update(options)
195
- burndown_data_path = load_last_sprint(options['output'] || Dir.pwd)
196
+ burndown_data_path = load_sprint(options['output'] || Dir.pwd, options[:sprint_number])
196
197
 
197
198
  burndown_data = BurndownData.new(@settings)
198
199
  burndown_data.board_id = board_id
@@ -213,13 +214,17 @@ class BurndownChart
213
214
  if options[:plot_to_board]
214
215
  trello = TrelloWrapper.new(@settings)
215
216
  board = trello.board(board_id)
216
- trello.add_attachment(board.burndown_card_id, "burndown-#{sprint.to_s.rjust(2, '0')}.png")
217
+ name = options['output'] ? options['output'] : '.'
218
+ name += "/burndown-#{sprint.to_s.rjust(2, '0')}.png"
219
+ card_id = board.burndown_card_id
220
+ trello.add_attachment(card_id, name)
221
+ trello.make_cover(card_id, name)
217
222
  end
218
223
  end
219
224
 
220
225
  def create_next_sprint(burndown_dir, options = {})
221
- load_last_sprint(burndown_dir)
222
- self.sprint = self.sprint + 1
226
+ load_sprint(burndown_dir)
227
+ self.sprint = options[:sprint_number] || (self.sprint + 1)
223
228
  @data["meta"]["total_days"] = options[:total_days] if options[:total_days]
224
229
  @data["meta"]["weekend_lines"] = options[:weekend_lines] unless options[:weekend_lines].blank?
225
230
  @data["days"] = []
data/lib/card.rb CHANGED
@@ -26,7 +26,7 @@ class Card
26
26
 
27
27
  def init_data(board_data, card_id)
28
28
  @board_data = board_data
29
- @card_data = @board_data["cards"].select{|c| c["id"] == card_id}.first
29
+ @card_data = @board_data["cards"].find{|c| c["id"] == card_id}
30
30
  end
31
31
 
32
32
  def as_json
data/lib/cli.rb CHANGED
@@ -50,6 +50,7 @@ evaluates to the access of
50
50
 
51
51
  https://api.trello.com/1/lists/53186e8391ef8671265eba9f/cards?filter=open&key=xxx&token=yyy
52
52
  EOT
53
+
53
54
  def get_raw(url_fragment)
54
55
  process_global_options options
55
56
  require_trello_credentials
@@ -166,6 +167,7 @@ EOT
166
167
  desc "burndown", "Update burndown chart"
167
168
  option :output, :aliases => :o, :desc => "Output directory", :required => false
168
169
  option :new_sprint, :aliases => :n, :desc => "Create new sprint"
170
+ option :sprint_number, type: :numeric, :desc => "Provide the number of the sprint"
169
171
  option :total_days, type: :numeric, desc: "Provide how many days the sprint longs. 10 days by default"
170
172
  option :weekend_lines, type: :array, desc: "Set the weekend_lines. [3.5, 8.5] by default"
171
173
  option :plot, :type => :boolean, :desc => "also plot the new data"
@@ -180,7 +182,7 @@ EOT
180
182
  chart = BurndownChart.new @@settings
181
183
  begin
182
184
  if options[:new_sprint]
183
- chart.create_next_sprint(options[:output] || Dir.pwd, { total_days: options[:total_days], weekend_lines: options[:weekend_lines] })
185
+ chart.create_next_sprint(options[:output] || Dir.pwd, options)
184
186
  end
185
187
  chart.update(options)
186
188
  puts "Updated data for sprint #{chart.sprint}"
@@ -205,8 +207,7 @@ EOT
205
207
  process_global_options options
206
208
  require_trello_credentials
207
209
 
208
- b = Backup.new @@settings
209
- b.backup(board_id(options["board-id"]))
210
+ Backup.new(@@settings).backup(board_id(options["board-id"]))
210
211
  end
211
212
 
212
213
  desc "list-backups", "List all backups"
@@ -221,8 +222,7 @@ EOT
221
222
  option "board-id", :desc => "Id of Trello board", :required => true
222
223
  option "show-descriptions", :desc => "Show descriptions of cards", :required => false, :type => :boolean
223
224
  def show_backup
224
- b = Backup.new @@settings
225
- b.show(board_id(options["board-id"]), options)
225
+ Backup.new(@@settings).show(board_id(options["board-id"]), options)
226
226
  end
227
227
 
228
228
  desc "organization", "Show organization info"
@@ -231,12 +231,10 @@ EOT
231
231
  process_global_options options
232
232
  require_trello_credentials
233
233
 
234
- trello = TrelloWrapper.new(@@settings)
235
-
236
- o = trello.organization(options["org-name"])
234
+ organization = TrelloWrapper.new(@@settings).organization(options["org-name"])
237
235
 
238
- puts "Display Name: #{o.display_name}"
239
- puts "Home page: #{o.url}"
236
+ puts "Display Name: #{organization.display_name}"
237
+ puts "Home page: #{organization.url}"
240
238
  end
241
239
 
242
240
  desc "get-description", "Reads description"
@@ -256,8 +254,7 @@ EOT
256
254
  process_global_options options
257
255
  require_trello_credentials
258
256
 
259
- trello = TrelloWrapper.new(@@settings)
260
- trello.set_description(options["card-id"], STDIN.read)
257
+ TrelloWrapper.new(@@settings).set_description(options["card-id"], STDIN.read)
261
258
  end
262
259
 
263
260
  desc "organization-members", "Show organization members"
@@ -268,8 +265,7 @@ EOT
268
265
 
269
266
  trello = TrelloWrapper.new(@@settings)
270
267
 
271
- members = trello.organization(options["org-name"]).members
272
- members.sort! { |a, b| a.username <=> b.username }
268
+ members = trello.organization(options["org-name"]).members.sort_by(&:username)
273
269
 
274
270
  members.each do |member|
275
271
  puts "#{member.username} (#{member.full_name})"
@@ -282,8 +278,7 @@ EOT
282
278
  process_global_options(options)
283
279
  require_trello_credentials
284
280
 
285
- trello = TrelloWrapper.new(@@settings)
286
- trello.add_attachment(options["card-id"], filename)
281
+ TrelloWrapper.new(@@settings).add_attachment(options["card-id"], filename)
287
282
  end
288
283
 
289
284
  desc "make-cover <filename>", "Make existing picture the cover"
@@ -292,8 +287,7 @@ EOT
292
287
  process_global_options(options)
293
288
  require_trello_credentials
294
289
 
295
- trello = TrelloWrapper.new(@@settings)
296
- trello.make_cover(options["card-id"], filename)
290
+ TrelloWrapper.new(@@settings).make_cover(options["card-id"], filename)
297
291
  end
298
292
 
299
293
  desc "list-member-boards", "List name and id of all boards"
data/lib/column.rb CHANGED
@@ -17,7 +17,7 @@
17
17
  class Column
18
18
  def initialize(board_data, list_id)
19
19
  @board_data = board_data
20
- @list_data = @board_data["lists"].select{|l| l["id"] == list_id}.first
20
+ @list_data = @board_data["lists"].find{|l| l["id"] == list_id}
21
21
  end
22
22
 
23
23
  def name
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Trollolo
2
2
 
3
- VERSION = "0.0.14"
3
+ VERSION = "0.1.0"
4
4
 
5
5
  end
@@ -367,11 +367,11 @@ EOT
367
367
  end
368
368
  end
369
369
 
370
- describe "load_last_sprint" do
370
+ describe "load_sprint" do
371
371
  let(:path) { given_directory_from_data("burndown_dir") }
372
372
 
373
373
  it "loads the burndown from the 2nd sprint into data" do
374
- @chart.load_last_sprint(path)
374
+ @chart.load_sprint(path)
375
375
  expect(@chart.data).to eq(
376
376
  { "meta" =>
377
377
  { "board_id" => "53186e8391ef8671265eba9d",
@@ -402,7 +402,7 @@ EOT
402
402
  end
403
403
 
404
404
  it "returns the path of the last sprint" do
405
- expect(@chart.load_last_sprint(path)).to eq(File.join(path, "burndown-data-02.yaml"))
405
+ expect(@chart.load_sprint(path)).to eq(File.join(path, "burndown-data-02.yaml"))
406
406
  end
407
407
  end
408
408
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: trollolo
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.1.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Cornelius Schumacher
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2017-09-18 00:00:00.000000000 Z
11
+ date: 2017-10-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor