trollolo 0.0.11 → 0.0.12

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: c81c5e55feaec3e0be0ae73576597ab84a310037
4
- data.tar.gz: 502a1150ba391df1bba717877667265cb986cfde
3
+ metadata.gz: 3d1e86a9dd1be0ff123b37a05416e21318de22f9
4
+ data.tar.gz: caaeb7842dd40a818ff85e567dc2a6871c420657
5
5
  SHA512:
6
- metadata.gz: e8e73f18474d9cbcd72db9da626c031e29871a363c9d2d81d8be643662e1c402644ecb8471bde6a663d74d149b2db24a37d6dd010e9ad502f246cdaaa7d12d4f
7
- data.tar.gz: d8c6391a08fe5580948940acfa577df331684985219fdb02deec3cd45e2643b32f92a6b599b75720c6ce1f0ab62d7cdd7023baf5dcd154a343728aafca8aa290
6
+ metadata.gz: '008b5b1b137be95287ca54d235a6ee4cb3a1a95dd3dfbb37eb47168a482155ca48a20a3ebf72cbe918ea15ac9140f14372f318fcf89bab53de15c35d2aabc9aa'
7
+ data.tar.gz: d513f80bf8f48e1c0de5059c2889d6acaa64cf474d703cab004abdc3b61662ab6a7f77d702907c3da189a6416c706b5d537e8edb7095fba2b0fe9f016fd71929
@@ -1 +1,9 @@
1
- inherit_from: .rubocop_todo.yml
1
+ inherit_from: .rubocop_todo.yml
2
+
3
+ #################### Metrics ###############################
4
+
5
+ Metrics/AbcSize:
6
+ Enabled: false
7
+
8
+ Metrics/PerceivedComplexity:
9
+ Enabled: false
@@ -1,6 +1,6 @@
1
1
  # This configuration was generated by
2
2
  # `rubocop --auto-gen-config`
3
- # on 2017-09-10 17:36:28 +0200 using RuboCop version 0.49.1.
3
+ # on 2017-09-12 15:08:33 +0200 using RuboCop version 0.49.1.
4
4
  # The point is for the user to remove these configuration records
5
5
  # one by one as the offenses are removed from the code base.
6
6
  # Note that changes in the inspected code, or installation of new
@@ -84,13 +84,12 @@ Layout/EmptyLinesAroundModuleBody:
84
84
  Exclude:
85
85
  - 'lib/version.rb'
86
86
 
87
- # Offense count: 4
87
+ # Offense count: 3
88
88
  # Cop supports --auto-correct.
89
89
  # Configuration parameters: AllowForAlignment, ForceEqualSignAlignment.
90
90
  Layout/ExtraSpacing:
91
91
  Exclude:
92
92
  - 'lib/scrum/backlog_mover.rb'
93
- - 'lib/scrum/priority_name.rb'
94
93
  - 'spec/unit/scrum/prioritizer_spec.rb'
95
94
 
96
95
  # Offense count: 2
@@ -162,30 +161,6 @@ Layout/MultilineOperationIndentation:
162
161
  - 'lib/backup.rb'
163
162
  - 'lib/card.rb'
164
163
 
165
- # Offense count: 1
166
- # Cop supports --auto-correct.
167
- Layout/SpaceAfterNot:
168
- Exclude:
169
- - 'lib/cli.rb'
170
-
171
- # Offense count: 1
172
- # Cop supports --auto-correct.
173
- # Configuration parameters: EnforcedStyle, SupportedStyles.
174
- # SupportedStyles: space, no_space
175
- Layout/SpaceAroundEqualsInParameterDefault:
176
- Exclude:
177
- - 'lib/cli.rb'
178
-
179
- # Offense count: 30
180
- # Cop supports --auto-correct.
181
- # Configuration parameters: AllowForAlignment.
182
- Layout/SpaceAroundOperators:
183
- Exclude:
184
- - 'lib/scrum/priority_name.rb'
185
- - 'spec/unit/burndown_chart_spec.rb'
186
- - 'spec/unit/cli_spec.rb'
187
- - 'spec/unit/settings_spec.rb'
188
- - 'spec/unit/trello_wrapper_spec.rb'
189
164
 
190
165
  # Offense count: 23
191
166
  # Cop supports --auto-correct.
@@ -266,13 +241,6 @@ Lint/AmbiguousRegexpLiteral:
266
241
  - 'spec/unit/cli_spec.rb'
267
242
  - 'spec/unit/scrum/sprint_cleaner_spec.rb'
268
243
 
269
- # Offense count: 2
270
- # Configuration parameters: AllowSafeAssignment.
271
- Lint/AssignmentInCondition:
272
- Exclude:
273
- - 'lib/scrum/priority_name.rb'
274
- - 'spec/unit/support/vcr.rb'
275
-
276
244
  # Offense count: 1
277
245
  # Cop supports --auto-correct.
278
246
  Lint/DeprecatedClassMethods:
@@ -303,10 +271,6 @@ Lint/UselessAssignment:
303
271
  Exclude:
304
272
  - 'spec/unit/support/webmocks.rb'
305
273
 
306
- # Offense count: 16
307
- Metrics/AbcSize:
308
- Max: 50
309
-
310
274
  # Offense count: 41
311
275
  # Configuration parameters: CountComments, ExcludedMethods.
312
276
  Metrics/BlockLength:
@@ -325,17 +289,13 @@ Metrics/CyclomaticComplexity:
325
289
  # Configuration parameters: AllowHeredoc, AllowURI, URISchemes, IgnoreCopDirectives, IgnoredPatterns.
326
290
  # URISchemes: http, https
327
291
  Metrics/LineLength:
328
- Max: 210
292
+ Max: 220
329
293
 
330
294
  # Offense count: 18
331
295
  # Configuration parameters: CountComments.
332
296
  Metrics/MethodLength:
333
297
  Max: 35
334
298
 
335
- # Offense count: 1
336
- Metrics/PerceivedComplexity:
337
- Max: 10
338
-
339
299
  # Offense count: 1
340
300
  # Cop supports --auto-correct.
341
301
  Security/YAMLLoad:
@@ -348,14 +308,6 @@ Style/AccessorMethodName:
348
308
  - 'lib/burndown_data.rb'
349
309
  - 'lib/cli.rb'
350
310
 
351
- # Offense count: 1
352
- # Cop supports --auto-correct.
353
- # Configuration parameters: EnforcedStyle, SupportedStyles.
354
- # SupportedStyles: always, conditionals
355
- Style/AndOr:
356
- Exclude:
357
- - 'spec/unit/support/update_webmock_data'
358
-
359
311
  # Offense count: 17
360
312
  # Cop supports --auto-correct.
361
313
  # Configuration parameters: EnforcedStyle, SupportedStyles, ProceduralMethods, FunctionalMethods, IgnoredMethods.
@@ -1,5 +1,14 @@
1
1
  # Trollolo Changelog
2
2
 
3
+ ## Master (unreleased)
4
+
5
+
6
+ ## Version 0.0.12
7
+
8
+ * Find and remove 'Unplanned' labels on `cleanup-sprint`. Fixes #72.
9
+ * Fix `trollolo burndown-init` and `trollolo backup`.
10
+ * Remove Ruby 2.1 support. Closes #96.
11
+
3
12
  ## Version 0.0.11
4
13
 
5
14
  * Add in `trollolo burndown --new-sprint` command the `total_days` and
@@ -12,6 +12,8 @@ To contribute code please open pull requests.
12
12
 
13
13
  Ensure that rspec and rubocop pass locally before sending your PR and always that you add new changes.
14
14
 
15
+ If your changes include important new features or bug fixes please add them to the [Master (unreleased) section fo the CHANGELOG.md](https://github.com/openSUSE/trollolo/blob/master/CHANGELOG.md#master-unreleased)
16
+
15
17
  ## To run rspec test
16
18
 
17
19
  To run all the rspec test:
@@ -1,3 +1,5 @@
1
+ require 'fileutils'
2
+
1
3
  class Backup
2
4
 
3
5
  attr_accessor :directory
@@ -14,6 +14,8 @@
14
14
  #
15
15
  # To contact SUSE about this file by physical or electronic mail,
16
16
  # you may find current contact information at www.suse.com
17
+ require 'fileutils'
18
+
17
19
  class BurndownChart
18
20
 
19
21
  attr_accessor :data
data/lib/cli.rb CHANGED
@@ -144,7 +144,7 @@ EOT
144
144
  destdir = name
145
145
  end
146
146
  chart = BurndownChart.new @@settings
147
- if ! File.directory?(destdir)
147
+ if !File.directory?(destdir)
148
148
  chart.setup(destdir, board["boardid"])
149
149
  end
150
150
  chart.update({'output' => destdir, plot: options[:plot]})
@@ -154,7 +154,7 @@ EOT
154
154
  desc "burndown-init", "Initialize burndown chart"
155
155
  option :output, :aliases => :o, :desc => "Output directory", :required => true
156
156
  option "board-id", :desc => "Id of Trello board", :required => true
157
- def burndown_init command=nil
157
+ def burndown_init command = nil
158
158
  process_global_options options
159
159
  require_trello_credentials
160
160
 
@@ -1,9 +1,9 @@
1
1
  module Scrum
2
2
  class PriorityName
3
- PRIORITY_REGEX = /^(?:\([\d.]+\) )?P(\d+): /
3
+ PRIORITY_REGEX = /^(?:\([\d.]+\) )?P(\d+): /
4
4
 
5
5
  def self.priority(name)
6
- return unless m = name.match(PRIORITY_REGEX)
6
+ return unless (m = name.match(PRIORITY_REGEX))
7
7
  m.captures.first.to_i
8
8
  end
9
9
 
@@ -46,6 +46,12 @@ module Scrum
46
46
  end
47
47
  end
48
48
 
49
+ def find_unplanned_label(labels)
50
+ labels.find do |label|
51
+ label.name =~ /unplanned/i
52
+ end
53
+ end
54
+
49
55
  private
50
56
 
51
57
  def under_waterline_label
@@ -28,12 +28,22 @@ module Scrum
28
28
  card.remove_label(label) if label
29
29
  end
30
30
 
31
+ def unplanned_label(card)
32
+ @board.find_unplanned_label(card.labels)
33
+ end
34
+
35
+ def remove_unplanned_label(card)
36
+ label = unplanned_label(card)
37
+ card.remove_label(label) if label
38
+ end
39
+
31
40
  def move_cards(source_list)
32
41
  source_list.cards.each do |card|
33
42
  next if @board.sticky?(card)
34
43
  puts %(moving card "#{card.name}" to list "#{target_list.name}")
35
44
  card.members.each { |member| card.remove_member(member) }
36
45
  remove_waterline_label(card)
46
+ remove_unplanned_label(card)
37
47
  card.move_to_board(@target_board, target_list)
38
48
  end
39
49
  end
@@ -1,5 +1,5 @@
1
1
  module Trollolo
2
2
 
3
- VERSION = "0.0.11"
3
+ VERSION = "0.0.12"
4
4
 
5
5
  end
@@ -155,6 +155,9 @@ class BurndownData:
155
155
  return
156
156
 
157
157
  def setScaleFactor(self, total_tasks, total_story_points):
158
- self.scalefactor = float(total_tasks) / float(total_story_points)
158
+ if total_story_points <= 0.001:
159
+ self.scalefactor = 1
160
+ else:
161
+ self.scalefactor = float(total_tasks) / float(total_story_points)
159
162
  return
160
163
 
@@ -383,15 +383,15 @@ EOT
383
383
  { "date" => "2015-08-28",
384
384
  "updated_at" => "2015-08-28T11:04:52+02:00",
385
385
  "story_points" =>
386
- { "total"=>24.0,
387
- "open"=>24.0
386
+ { "total" => 24.0,
387
+ "open" => 24.0
388
388
  },
389
389
  "tasks" =>
390
390
  { "total" => 43,
391
391
  "open" => 28
392
392
  },
393
393
  "story_points_extra" =>
394
- { "done"=>2.0
394
+ { "done" => 2.0
395
395
  },
396
396
  "tasks_extra" =>
397
397
  { "done" => 5
@@ -134,9 +134,9 @@ EOT
134
134
  :get, "https://api.trello.com/1/cards/54ae8485221b1cc5b173e713?key=mykey&token=mytoken"
135
135
  ).with(
136
136
  :headers => {
137
- 'Accept'=>'*/*; q=0.5, application/xml',
138
- 'Accept-Encoding'=>'gzip, deflate',
139
- 'User-Agent'=>'Ruby'
137
+ 'Accept' => '*/*; q=0.5, application/xml',
138
+ 'Accept-Encoding' => 'gzip, deflate',
139
+ 'User-Agent' => 'Ruby'
140
140
  }
141
141
  ).to_return(:status => 200, :body => body, :headers => {})
142
142
  @cli.options = {"card-id" => "54ae8485221b1cc5b173e713"}
@@ -152,11 +152,11 @@ EOT
152
152
  :put, "https://api.trello.com/1/cards/54ae8485221b1cc5b173e713/desc?key=mykey&token=mytoken&value=My%20description"
153
153
  ).with(
154
154
  :headers => {
155
- 'Accept'=>'*/*; q=0.5, application/xml',
156
- 'Accept-Encoding'=>'gzip, deflate',
157
- 'Content-Length'=>'0',
158
- 'Content-Type'=>'application/x-www-form-urlencoded',
159
- 'User-Agent'=>'Ruby'
155
+ 'Accept' => '*/*; q=0.5, application/xml',
156
+ 'Accept-Encoding' => 'gzip, deflate',
157
+ 'Content-Length' => '0',
158
+ 'Content-Type' => 'application/x-www-form-urlencoded',
159
+ 'User-Agent' => 'Ruby'
160
160
  }
161
161
  ).to_return(:status => 200, :body => "", :headers => {})
162
162
  @cli.options = {"card-id" => "54ae8485221b1cc5b173e713"}
@@ -24,7 +24,7 @@ describe Settings do
24
24
  @settings = Settings.new( File.expand_path('../../data/trollolorc_with_board_aliases', __FILE__) )
25
25
  end
26
26
  it "returns default settings" do
27
- expect(@settings.scrum["board_names"]).to eq({"planning"=>"Planning Board", "sprint"=>"Sprint Board"})
27
+ expect(@settings.scrum["board_names"]).to eq({"planning" => "Planning Board", "sprint" => "Sprint Board"})
28
28
  end
29
29
  end
30
30
 
@@ -11,7 +11,7 @@ STDERR.puts "Updating web mock data"
11
11
 
12
12
  def scrub_file(file)
13
13
  json = JSON.parse(File.read(file))
14
- if json.is_a?(Hash) and json.has_key?("cards")
14
+ if json.is_a?(Hash) && json.has_key?("cards")
15
15
  json["cards"].each do |card|
16
16
  if card.has_key?("email")
17
17
  card["email"] = "trello@example.com"
@@ -39,7 +39,7 @@ end
39
39
 
40
40
  RSpec.configure do |c|
41
41
  c.around do |example|
42
- if cassette = example.metadata[:vcr]
42
+ if (cassette = example.metadata[:vcr])
43
43
  fail "you need to use real_settings to re-record vcr data" if real_settings_needed?(example)
44
44
  VCR.use_cassette(cassette, record: vcr_record_mode(example)) do
45
45
  example.run
@@ -81,11 +81,11 @@ describe TrelloWrapper do
81
81
  EOT
82
82
 
83
83
  stub_request(:get, "https://api.trello.com/1/cards/123?key=mykey&token=mytoken").
84
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
84
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'}).
85
85
  to_return(:status => 200, :body => card_body, :headers => {})
86
86
 
87
87
  stub_request(:post, "https://api.trello.com/1/cards/123/attachments?key=mykey&token=mytoken").
88
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'188', 'Content-Type'=>'multipart/form-data; boundary=470924', 'User-Agent'=>'Ruby'}).
88
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'Content-Length' => '188', 'Content-Type' => 'multipart/form-data; boundary=470924', 'User-Agent' => 'Ruby'}).
89
89
  to_return(:status => 200, :body => "", :headers => {})
90
90
 
91
91
  path = given_file("attachment-data")
@@ -115,10 +115,10 @@ EOF
115
115
 
116
116
  before(:each) do
117
117
  stub_request(:get, "https://api.trello.com/1/cards/#{card_id}/attachments?fields=name&key=mykey&token=mytoken").
118
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'User-Agent'=>'Ruby'}).
118
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'User-Agent' => 'Ruby'}).
119
119
  to_return(:status => 200, :body => card_attachments_body, :headers => {})
120
120
  stub_request(:put, "https://api.trello.com/1/cards/#{card_id}/idAttachmentCover?key=mykey&token=mytoken&value=#{image_id}").
121
- with(:headers => {'Accept'=>'*/*; q=0.5, application/xml', 'Accept-Encoding'=>'gzip, deflate', 'Content-Length'=>'0', 'Content-Type'=>'application/x-www-form-urlencoded', 'User-Agent'=>'Ruby'})
121
+ with(:headers => {'Accept' => '*/*; q=0.5, application/xml', 'Accept-Encoding' => 'gzip, deflate', 'Content-Length' => '0', 'Content-Type' => 'application/x-www-form-urlencoded', 'User-Agent' => 'Ruby'})
122
122
  end
123
123
 
124
124
  it "make the attachment with the file name passed.jpg the cover" do
@@ -12,13 +12,12 @@ Gem::Specification.new do |s|
12
12
  s.summary = 'Trello command line client'
13
13
  s.description = 'Trollolo is a command line tool to access Trello and support tasks like generation of burndown charts.'
14
14
 
15
- s.required_ruby_version = '>= 2.1'
15
+ s.required_ruby_version = '>= 2.2'
16
16
  s.required_rubygems_version = '>= 1.3.6'
17
17
  s.rubyforge_project = 'trollolo'
18
18
 
19
19
  s.add_dependency 'thor', '~> 0.19'
20
20
  s.add_dependency 'ruby-trello', '~> 1.5.0'
21
- s.add_dependency 'activesupport', '~> 4'
22
21
 
23
22
  s.files = `git ls-files`.split("\n")
24
23
  s.executables = `git ls-files`.split("\n").map{|f| f =~ /^bin\/(.*)/ ? $1 : nil}.compact
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.11
4
+ version: 0.0.12
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-11 00:00:00.000000000 Z
11
+ date: 2017-09-13 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: thor
@@ -38,20 +38,6 @@ dependencies:
38
38
  - - "~>"
39
39
  - !ruby/object:Gem::Version
40
40
  version: 1.5.0
41
- - !ruby/object:Gem::Dependency
42
- name: activesupport
43
- requirement: !ruby/object:Gem::Requirement
44
- requirements:
45
- - - "~>"
46
- - !ruby/object:Gem::Version
47
- version: '4'
48
- type: :runtime
49
- prerelease: false
50
- version_requirements: !ruby/object:Gem::Requirement
51
- requirements:
52
- - - "~>"
53
- - !ruby/object:Gem::Version
54
- version: '4'
55
41
  description: Trollolo is a command line tool to access Trello and support tasks like
56
42
  generation of burndown charts.
57
43
  email:
@@ -193,7 +179,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
193
179
  requirements:
194
180
  - - ">="
195
181
  - !ruby/object:Gem::Version
196
- version: '2.1'
182
+ version: '2.2'
197
183
  required_rubygems_version: !ruby/object:Gem::Requirement
198
184
  requirements:
199
185
  - - ">="