lazylead 0.11.4 → 0.13.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (126) hide show
  1. checksums.yaml +4 -4
  2. data/.0pdd.yml +3 -0
  3. data/.circleci/config.yml +0 -12
  4. data/.docs/accuracy.sql +35 -0
  5. data/.github/workflows/build.yml +39 -0
  6. data/.github/workflows/release.yml +15 -0
  7. data/.rubocop.yml +11 -2
  8. data/.rultor.yml +2 -2
  9. data/Gemfile +1 -1
  10. data/Rakefile +17 -9
  11. data/bin/lazylead +5 -5
  12. data/lazylead.gemspec +22 -25
  13. data/lib/lazylead/allocated.rb +1 -1
  14. data/lib/lazylead/cc.rb +1 -1
  15. data/lib/lazylead/cli/app.rb +3 -3
  16. data/lib/lazylead/confluence.rb +4 -3
  17. data/lib/lazylead/email.rb +1 -1
  18. data/lib/lazylead/exchange.rb +3 -3
  19. data/lib/lazylead/home.rb +2 -2
  20. data/lib/lazylead/log.rb +1 -1
  21. data/lib/lazylead/model.rb +4 -3
  22. data/lib/lazylead/opts.rb +1 -1
  23. data/lib/lazylead/os.rb +2 -1
  24. data/lib/lazylead/postman.rb +8 -7
  25. data/lib/lazylead/requires.rb +1 -1
  26. data/lib/lazylead/salt.rb +1 -1
  27. data/lib/lazylead/schedule.rb +5 -9
  28. data/lib/lazylead/smtp.rb +1 -1
  29. data/lib/lazylead/system/empty.rb +1 -1
  30. data/lib/lazylead/system/fake.rb +1 -1
  31. data/lib/lazylead/system/jira.rb +5 -3
  32. data/lib/lazylead/system/synced.rb +1 -1
  33. data/lib/lazylead/task/accuracy/accuracy.rb +3 -3
  34. data/lib/lazylead/task/accuracy/affected_build.rb +1 -1
  35. data/lib/lazylead/task/accuracy/attachment.rb +1 -1
  36. data/lib/lazylead/task/accuracy/environment.rb +1 -1
  37. data/lib/lazylead/task/accuracy/has_label.rb +1 -1
  38. data/lib/lazylead/task/accuracy/logs.rb +1 -1
  39. data/lib/lazylead/task/accuracy/logs_link.rb +1 -1
  40. data/lib/lazylead/task/accuracy/memes.rb +1 -1
  41. data/lib/lazylead/task/accuracy/onlyll.rb +1 -1
  42. data/lib/lazylead/task/accuracy/records.rb +9 -2
  43. data/lib/lazylead/task/accuracy/records_link.rb +1 -1
  44. data/lib/lazylead/task/accuracy/required.rb +1 -1
  45. data/lib/lazylead/task/accuracy/requirement.rb +1 -1
  46. data/lib/lazylead/task/accuracy/screenshots.rb +1 -1
  47. data/lib/lazylead/task/accuracy/servers.rb +1 -1
  48. data/lib/lazylead/task/accuracy/stacktrace.rb +2 -2
  49. data/lib/lazylead/task/accuracy/testcase.rb +1 -1
  50. data/lib/lazylead/task/accuracy/wiki.rb +1 -1
  51. data/lib/lazylead/task/accuracy/wiki_url.rb +1 -1
  52. data/lib/lazylead/task/alert/alert.rb +1 -1
  53. data/lib/lazylead/task/alert/alertif.rb +1 -1
  54. data/lib/lazylead/task/alert/changed_to.rb +1 -1
  55. data/lib/lazylead/task/assignment.rb +1 -1
  56. data/lib/lazylead/task/confluence_ref.rb +1 -1
  57. data/lib/lazylead/task/echo.rb +2 -2
  58. data/lib/lazylead/task/fix_version.rb +1 -1
  59. data/lib/lazylead/task/git/git.rb +82 -0
  60. data/lib/lazylead/task/loading.rb +2 -3
  61. data/lib/lazylead/task/micromanager.rb +1 -1
  62. data/lib/lazylead/task/missing_comment.rb +1 -1
  63. data/lib/lazylead/task/propagate_down.rb +3 -3
  64. data/lib/lazylead/task/savepoint.rb +1 -1
  65. data/lib/lazylead/task/svn/diff.rb +1 -1
  66. data/lib/lazylead/task/svn/grep.rb +1 -1
  67. data/lib/lazylead/task/svn/svn.rb +1 -1
  68. data/lib/lazylead/task/svn/touch.rb +42 -14
  69. data/lib/lazylead/version.rb +2 -2
  70. data/lib/lazylead.rb +1 -1
  71. data/license.txt +1 -1
  72. data/readme.md +20 -15
  73. data/test/lazylead/allocated_test.rb +1 -1
  74. data/test/lazylead/cc_test.rb +7 -7
  75. data/test/lazylead/cli/app_test.rb +1 -1
  76. data/test/lazylead/confluence_test.rb +1 -1
  77. data/test/lazylead/exchange_test.rb +10 -10
  78. data/test/lazylead/file_postman_test.rb +47 -0
  79. data/test/lazylead/model_test.rb +2 -2
  80. data/test/lazylead/opts_test.rb +1 -1
  81. data/test/lazylead/postman_test.rb +7 -39
  82. data/test/lazylead/retry_test.rb +12 -1
  83. data/test/lazylead/salt_test.rb +1 -1
  84. data/test/lazylead/smoke_test.rb +2 -2
  85. data/test/lazylead/smtp_test.rb +7 -7
  86. data/test/lazylead/stdout_postman_test.rb +48 -0
  87. data/test/lazylead/system/jira_test.rb +53 -54
  88. data/test/lazylead/task/accuracy/accuracy_test.rb +11 -11
  89. data/test/lazylead/task/accuracy/affected_build_test.rb +1 -1
  90. data/test/lazylead/task/accuracy/attachment_test.rb +4 -4
  91. data/test/lazylead/task/accuracy/environment_test.rb +1 -1
  92. data/test/lazylead/task/accuracy/has_label_test.rb +1 -1
  93. data/test/lazylead/task/accuracy/logs_link_test.rb +1 -1
  94. data/test/lazylead/task/accuracy/logs_test.rb +1 -1
  95. data/test/lazylead/task/accuracy/memes_test.rb +1 -1
  96. data/test/lazylead/task/accuracy/onlyll_test.rb +21 -21
  97. data/test/lazylead/task/accuracy/records_llink_test.rb +1 -1
  98. data/test/lazylead/task/accuracy/records_test.rb +35 -12
  99. data/test/lazylead/task/accuracy/score_test.rb +4 -4
  100. data/test/lazylead/task/accuracy/screenshots_test.rb +3 -3
  101. data/test/lazylead/task/accuracy/servers_test.rb +1 -1
  102. data/test/lazylead/task/accuracy/stacktrace_test.rb +1 -1
  103. data/test/lazylead/task/accuracy/testcase_test.rb +1 -1
  104. data/test/lazylead/task/accuracy/wiki_test.rb +1 -1
  105. data/test/lazylead/task/accuracy/wiki_url_test.rb +1 -1
  106. data/test/lazylead/task/alert/alertif_test.rb +5 -5
  107. data/test/lazylead/task/alert/assignee_alert_test.rb +1 -1
  108. data/test/lazylead/task/alert/changed_to_test.rb +5 -5
  109. data/test/lazylead/task/assignment_test.rb +5 -5
  110. data/test/lazylead/task/confluence_ref_test.rb +8 -8
  111. data/test/lazylead/task/created_recently_test.rb +4 -4
  112. data/test/lazylead/task/duedate_test.rb +14 -14
  113. data/test/lazylead/task/echo_test.rb +1 -1
  114. data/test/lazylead/task/fix_version_test.rb +6 -5
  115. data/test/lazylead/task/loading_test.rb +7 -7
  116. data/test/lazylead/task/micromanager_test.rb +5 -5
  117. data/test/lazylead/task/missing_comment_test.rb +4 -4
  118. data/test/lazylead/task/propagate_down_test.rb +1 -1
  119. data/test/lazylead/task/savepoint_test.rb +1 -1
  120. data/test/lazylead/task/svn/diff_test.rb +14 -15
  121. data/test/lazylead/task/svn/grep_test.rb +4 -3
  122. data/test/lazylead/task/svn/touch_test.rb +74 -6
  123. data/test/lazylead/version_test.rb +1 -1
  124. data/test/sqlite_test.rb +1 -1
  125. data/test/test.rb +10 -3
  126. metadata +49 -107
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -47,14 +47,10 @@ module Lazylead
47
47
  raise "ll-002: task can't be a null" if task.nil?
48
48
  @trigger.method(task.type).call(task.unit) do
49
49
  ActiveRecord::Base.connection_pool.with_connection do
50
- if task.props.key? "no_logs"
51
- ORM::Retry.new(task, @log).exec
52
- else
53
- ORM::Retry.new(
54
- ORM::Verbose.new(task, @log),
55
- @log
56
- ).exec
57
- end
50
+ t = task
51
+ t = ORM::Verbose.new(t, @log) unless t.props.key? "no_logs"
52
+ t = ORM::Retry.new(t, @log)
53
+ t.exec
58
54
  end
59
55
  end
60
56
  @log.debug "Task scheduled: #{task}"
data/lib/lazylead/smtp.rb CHANGED
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -47,8 +47,8 @@ module Lazylead
47
47
  @salt = salt
48
48
  @log = log
49
49
  @log.debug "Initiate a Jira client using following opts: " \
50
- "#{@opts.except 'password', :password} " \
51
- " and salt #{@salt.id} (found=#{@salt.specified?})"
50
+ "#{@opts.except 'password', :password} " \
51
+ "and salt #{@salt.id} (found=#{@salt.specified?})"
52
52
  end
53
53
 
54
54
  # Find the jira issues by 'JQL'
@@ -132,6 +132,8 @@ module Lazylead
132
132
  end
133
133
 
134
134
  def email
135
+ return @usr["emailAddress"] unless @usr["emailAddress"].nil?
136
+ return id if id.include?("@")
135
137
  @usr["emailAddress"]
136
138
  end
137
139
 
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -98,8 +98,8 @@ module Lazylead
98
98
  comment = [
99
99
  "Hi [~#{reporter}],",
100
100
  "",
101
- "The triage accuracy is '{color:#{color}}#{@score}{color}'" \
102
- " (~{color:#{color}}#{@accuracy}%{color}), here are the reasons why:",
101
+ "The triage accuracy is '{color:#{color}}#{@score}{color}' " \
102
+ "(~{color:#{color}}#{@accuracy}%{color}), here are the reasons why:",
103
103
  "|| Ticket requirement || Status || Field ||"
104
104
  ]
105
105
  @opts[:rules].each do |r|
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -27,9 +27,15 @@ require_relative "attachment"
27
27
  module Lazylead
28
28
  # Check that ticket has video record(s) with reproducing results.
29
29
  class Records < Lazylead::Attachment
30
- def initialize(ext = [])
30
+ # @param ext
31
+ # The list of video records file extensions.
32
+ # @param size
33
+ # The minimum size of video records in bytes.
34
+ # Default value is 5KB.
35
+ def initialize(ext = [], size = 5 * 1024)
31
36
  super("Internal reproducing results (video)", 5, "Attachments")
32
37
  @ext = ext
38
+ @size = size
33
39
  return unless @ext.empty?
34
40
  @ext = %w[.webm .mkv .flv .flv .vob .ogv .ogg .drc .gif .gifv .mng .avi
35
41
  .mts .m2ts .ts .mov .qt .wmv .yuv .rm .rmvb .viv .asf .amv .mp4
@@ -39,6 +45,7 @@ module Lazylead
39
45
 
40
46
  # Ensure that ticket has an attachment with video-file extension
41
47
  def matches?(attach)
48
+ return false if attach.attrs["size"].to_i < @size
42
49
  return true if @ext.any? { |e| e.eql? File.extname(attach.attrs["filename"]).downcase }
43
50
  return false if attach.attrs["mimeType"].nil?
44
51
  @ext.any? { |e| attach.attrs["mimeType"].end_with? "/#{e[1..]}" }
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -78,7 +78,7 @@ module Lazylead
78
78
  words.each_with_index do |e, i|
79
79
  next unless e.start_with? text
80
80
  pair = snippets.last
81
- pair << i if pair.size.zero? || pair.size == 1
81
+ pair << i if pair.empty? || pair.size == 1
82
82
  snippets[-1] = pair
83
83
  snippets << [] if pair.size == 2
84
84
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -53,7 +53,7 @@ module Lazylead
53
53
  end
54
54
 
55
55
  def run(_, _, _)
56
- File.open(@path, "w") { |f| f.write Time.now }
56
+ File.write(@path, Time.now)
57
57
  end
58
58
  end
59
59
  end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -0,0 +1,82 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
+ #
7
+ # Permission is hereby granted, free of charge, to any person obtaining a copy
8
+ # of this software and associated documentation files (the "Software"),
9
+ # to deal in the Software without restriction, including without limitation
10
+ # the rights to use, copy, modify, merge, publish, distribute, sublicense,
11
+ # and/or sell copies of the Software, and to permit persons to whom
12
+ # the Software is furnished to do so, subject to the following conditions:
13
+ #
14
+ # The above copyright notice and this permission notice shall be included
15
+ # in all copies or substantial portions of the Software.
16
+ #
17
+ # THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
18
+ # IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
19
+ # FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE
20
+ # AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
21
+ # LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
22
+ # ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
23
+ # OR OTHER DEALINGS IN THE SOFTWARE.
24
+
25
+ require "forwardable"
26
+
27
+ module Lazylead
28
+ # @todo #533/DEV Git `grep` command is required like Lazylead::SVN::Grep
29
+ #
30
+ # @todo #533/DEV Git `touch` command is required like Lazylead::SVN::Touch
31
+ #
32
+ # @todo #533/DEV Git `diff` command is required like Lazylead::SVN::Diff
33
+ module Git
34
+ #
35
+ # SVN commit built from command-line stdout (OS#run).
36
+ #
37
+ class Commit
38
+ def initialize(raw)
39
+ @raw = raw
40
+ end
41
+
42
+ def to_s
43
+ "#{id} #{msg}"
44
+ end
45
+
46
+ # @todo #/DEV Git Commit#id implementation is required based on `git` ruby gem
47
+ def id; end
48
+
49
+ # @todo #/DEV Git Commit#author implementation is required based on `git` ruby gem
50
+ def author; end
51
+
52
+ # @todo #/DEV Git Commit#time implementation is required based on `git` ruby gem
53
+ def time; end
54
+
55
+ # @todo #/DEV Git Commit#msg implementation is required based on `git` ruby gem
56
+ def msg; end
57
+
58
+ # @todo #/DEV Git Commit#lines implementation is required based on `git` ruby gem
59
+ def lines; end
60
+
61
+ # @todo #/DEV Git Commit#header implementation is required based on `git` ruby gem
62
+ def header; end
63
+
64
+ # The modified lines contains expected text
65
+ # @todo #/DEV Git Commit#includes? implementation is required based on `git` ruby gem
66
+ def includes?(text); end
67
+ end
68
+
69
+ #
70
+ # Git commits built from command-line stdout (OS#run).
71
+ #
72
+ # @todo #/DEV Git Commits implementation is required based on `git` ruby gem
73
+ class Commits
74
+ extend Forwardable
75
+ def_delegators :@all, :each, :map, :select, :empty?
76
+
77
+ def initialize(stdout)
78
+ @stdout = stdout
79
+ end
80
+ end
81
+ end
82
+ end
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -38,8 +38,7 @@ module Lazylead
38
38
  def run(sys, postman, opts)
39
39
  assignments = sys.issues(opts["jql"], opts.jira_defaults)
40
40
  .group_by(&:assignee)
41
- .map { |user, tasks| [user.id, Teammate.new(user, tasks)] }
42
- .to_h
41
+ .to_h { |user, tasks| [user.id, Teammate.new(user, tasks)] }
43
42
  opts.slice("team", ",")
44
43
  .map { |m| m.split(":") }
45
44
  .each { |id, name| assignments[id] = Free.new(id, name) unless assignments.key? id }
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -87,9 +87,9 @@ module Lazylead
87
87
  # Fill pre-defined fields for sub-tasks from parent ticket
88
88
  # and post comment to ticket with clarification.
89
89
  def propagate
90
- expected = @fields.collect { |f| [f, @issue.fields[f]] }.to_h
90
+ expected = @fields.to_h { |f| [f, @issue.fields[f]] }
91
91
  @subtasks.each do |subtask|
92
- actual = @fields.collect { |f| [f, subtask.fields[f]] }.to_h
92
+ actual = @fields.to_h { |f| [f, subtask.fields[f]] }
93
93
  diff = diff(expected, actual)
94
94
  next if diff.empty?
95
95
  subtask.save(fields: diff)
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),
@@ -2,7 +2,7 @@
2
2
 
3
3
  # The MIT License
4
4
  #
5
- # Copyright (c) 2019-2021 Yurii Dubinka
5
+ # Copyright (c) 2019-2022 Yurii Dubinka
6
6
  #
7
7
  # Permission is hereby granted, free of charge, to any person obtaining a copy
8
8
  # of this software and associated documentation files (the "Software"),