lazylead 0.9.2 → 0.9.3

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
  SHA256:
3
- metadata.gz: a2bb060ea62241a94384885e9d05b876f451e60051a89bc4ee7d8e3f84680d4a
4
- data.tar.gz: 9c5906d631101d1bff071934fe0c52a0b9e1d1c9f655fdb8c3f958ba168639f0
3
+ metadata.gz: d79bc577cc5d288972a0e76fd800bf2b34ff7ab24ae9c26440c733222fb2fd08
4
+ data.tar.gz: b627e3f6e109bd0d9e33d8a3c7e388027ec299d8482cb771883f223c874ea093
5
5
  SHA512:
6
- metadata.gz: 3a09897c26cffbce936e449973c6ddd115374a37fde1d5d8892832615b03410cdff4b6bc642923d373b15402ad29283719b90f34899b91a769d07994df20f7cb
7
- data.tar.gz: 782c925452d6664542d3951bbf7ddde8e278211386c39b9593c94d2e54087789fc972db5f38ee8aaa0e6c4545732e6f36739b821ccaef20fe3b2f396a475c96f
6
+ metadata.gz: da3d31eb92822381047ea2cd8c3ab363765e4d7e644bfe8921644a8998eac5e4ee58f4b3000e2a46ddc0098f9c9176f563aa4c0f084f1a456fa95a905f26b3f4
7
+ data.tar.gz: 206b8e56cbbb7807b4c92c291a7d2b03a8ec3bb05f7f75d60b31601ab925ec3768d0f24b84d4a124c6c0c3e99f7e39f8ea6851110144d9202237460b0d0fedfa
data/lazylead.gemspec CHANGED
@@ -32,7 +32,7 @@ Gem::Specification.new do |s|
32
32
  s.rubygems_version = "2.2"
33
33
  s.required_ruby_version = ">=2.6.5"
34
34
  s.name = "lazylead"
35
- s.version = "0.9.2"
35
+ s.version = "0.9.3"
36
36
  s.license = "MIT"
37
37
  s.summary = "Eliminate the annoying work within bug-trackers."
38
38
  s.description = "Ticketing systems (Github, Jira, etc.) are strongly
@@ -45,7 +45,7 @@ tasks instead of solving technical problems."
45
45
  s.authors = ["Yurii Dubinka"]
46
46
  s.email = "yurii.dubinka@gmail.com"
47
47
  s.homepage = "http://github.com/dgroup/lazylead"
48
- s.post_install_message = "Thanks for installing Lazylead v0.9.2!
48
+ s.post_install_message = "Thanks for installing Lazylead v0.9.3!
49
49
  Read our blog posts: https://lazylead.org
50
50
  Stay in touch with the community in Telegram: https://t.me/lazylead
51
51
  Follow us on Twitter: https://twitter.com/lazylead
@@ -58,7 +58,7 @@ tasks instead of solving technical problems."
58
58
  s.add_runtime_dependency "activerecord", "6.1.3"
59
59
  s.add_runtime_dependency "backtrace", "0.3"
60
60
  s.add_runtime_dependency "colorize", "0.8.1"
61
- s.add_runtime_dependency "faraday", "1.4.1"
61
+ s.add_runtime_dependency "faraday", "1.4.2"
62
62
  s.add_runtime_dependency "get_process_mem", "0.2.7"
63
63
  s.add_runtime_dependency "inifile", "3.0.0"
64
64
  s.add_runtime_dependency "jira-ruby", "2.1.5"
@@ -71,7 +71,7 @@ tasks instead of solving technical problems."
71
71
  s.add_runtime_dependency "require_all", "3.0.0"
72
72
  s.add_runtime_dependency "rubyzip", "2.3.0"
73
73
  s.add_runtime_dependency "rufus-scheduler", "3.7.0"
74
- s.add_runtime_dependency "slop", "4.8.2"
74
+ s.add_runtime_dependency "slop", "4.9.0"
75
75
  s.add_runtime_dependency "sqlite3", "1.4.2"
76
76
  s.add_runtime_dependency "tempfile", "0.1.1"
77
77
  s.add_runtime_dependency "tilt", "2.0.10"
@@ -80,7 +80,7 @@ tasks instead of solving technical problems."
80
80
  s.add_runtime_dependency "vcs4sql", "0.1.1"
81
81
  s.add_runtime_dependency "viewpoint", "1.1.1"
82
82
  s.add_development_dependency "codecov", "0.5.2"
83
- s.add_development_dependency "guard", "2.16.2"
83
+ s.add_development_dependency "guard", "2.17.0"
84
84
  s.add_development_dependency "guard-minitest", "2.4.6"
85
85
  s.add_development_dependency "minitest", "5.14.4"
86
86
  s.add_development_dependency "minitest-fail-fast", "0.1.0"
@@ -90,9 +90,9 @@ tasks instead of solving technical problems."
90
90
  s.add_development_dependency "rake", "13.0.3"
91
91
  s.add_development_dependency "random-port", "0.5.1"
92
92
  s.add_development_dependency "rdoc", "6.3.1"
93
- s.add_development_dependency "rubocop", "1.13.0"
93
+ s.add_development_dependency "rubocop", "1.15.0"
94
94
  s.add_development_dependency "rubocop-minitest", "0.12.1"
95
- s.add_development_dependency "rubocop-performance", "1.11.1"
95
+ s.add_development_dependency "rubocop-performance", "1.11.3"
96
96
  s.add_development_dependency "rubocop-rake", "0.5.1"
97
97
  s.add_development_dependency "rubocop-rspec", "2.3.0"
98
98
  s.add_development_dependency "sqlint", "0.2.0"
@@ -0,0 +1,55 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2021 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
+ module Lazylead
26
+ #
27
+ # Represents a native, operation system.
28
+ #
29
+ # Author:: Yurii Dubinka (yurii.dubinka@gmail.com)
30
+ # Copyright:: Copyright (c) 2019-2020 Yurii Dubinka
31
+ # License:: MIT
32
+ class OS
33
+ #
34
+ # Run OS-oriented command
35
+ # @param cmd
36
+ # The command could be a single string or array of strings.
37
+ # Examples Final command to OS
38
+ # run("ls") "ls" => stdout
39
+ # run("ls", "-lah") "ls -lah" => stdout
40
+ # run() N/A => ""
41
+ # run("ls", nil, "-lah") N/A => ""
42
+ # run("ls", "", "-lah") "ls -lah" => stdout
43
+ #
44
+ # @return stdout
45
+ # Please note, that this is not a raw stdout.
46
+ # The output will be modified by String#scrub! in order to avoid invalid byte sequence
47
+ # in UTF-8 (https://stackoverflow.com/a/24037885/6916890).
48
+ def run(*cmd)
49
+ return "" if cmd.empty? || cmd.any?(&:nil?)
50
+ todo = cmd
51
+ todo = [cmd.first] if cmd.size == 1
52
+ `#{todo.join(" ")}`.scrub!
53
+ end
54
+ end
55
+ end
@@ -42,8 +42,7 @@ module Lazylead
42
42
 
43
43
  def passed(issue)
44
44
  return false if issue.attachments.nil? || blank?(issue, "description")
45
- ref = references(issue)
46
- ref.size < @minimum ? false : ref.all? { |r| pictures(issue).any? { |file| r.include? file } }
45
+ references(issue).count { |r| pictures(issue).any? { |file| r.include? file } } >= @minimum
47
46
  end
48
47
 
49
48
  # Detect all references in ticket description to attachments (including web links).
@@ -39,15 +39,12 @@ module Lazylead
39
39
  def run(sys, postman, opts)
40
40
  allowed = opts.slice("allowed", ",")
41
41
  silent = opts.key? "silent"
42
- issues = sys.issues(
43
- opts["jql"], opts.jira_defaults.merge(expand: "changelog")
44
- )
42
+ issues = sys.issues(opts["jql"], opts.jira_defaults.merge(expand: "changelog"))
43
+ .map { |i| Version.new(i, allowed, silent) }
44
+ .select(&:changed?)
45
+ .each(&:add_label)
45
46
  return if issues.empty?
46
- postman.send opts.merge(
47
- versions: issues.map { |i| Version.new(i, allowed, silent) }
48
- .select(&:changed?)
49
- .each(&:add_label)
50
- )
47
+ postman.send opts.merge(versions: issues)
51
48
  end
52
49
  end
53
50
 
@@ -72,8 +72,8 @@ module Lazylead
72
72
  "#{id} has #{total} tasks"
73
73
  end
74
74
 
75
- def sprints(*label)
76
- return @tasks.group_by(&:sprint).sort if label.empty? || label.nil?
75
+ def sprints(label)
76
+ return @tasks.group_by(&:sprint).sort if label.nil? || label.blank?
77
77
  @tasks.group_by { |t| t.sprint(label) }.sort
78
78
  end
79
79
  end
@@ -27,8 +27,10 @@ require "tempfile"
27
27
  require "nokogiri"
28
28
  require "backtrace"
29
29
  require "active_support/core_ext/hash/conversions"
30
+ require_relative "../../os"
30
31
  require_relative "../../salt"
31
32
  require_relative "../../opts"
33
+ require_relative "svn"
32
34
 
33
35
  module Lazylead
34
36
  module Task
@@ -43,15 +45,13 @@ module Lazylead
43
45
  end
44
46
 
45
47
  def run(_, postman, opts)
46
- cmd = [
47
- "svn log --diff --no-auth-cache",
48
- "--username #{opts.decrypt('svn_user', 'svn_salt')}",
49
- "--password #{opts.decrypt('svn_password', 'svn_salt')}",
50
- "-r#{opts['since_rev']}:HEAD #{opts['svn_url']}"
51
- ]
52
- stdout = `#{cmd.join(" ")}`
53
- stdout.scrub!
54
- send_email postman, opts.merge(stdout: stdout) unless stdout.blank?
48
+ stdout = OS.new.run "svn log --diff --no-auth-cache",
49
+ "--username #{opts.decrypt('svn_user', 'svn_salt')}",
50
+ "--password #{opts.decrypt('svn_password', 'svn_salt')}",
51
+ "-r#{opts['since_rev']}:HEAD #{opts['svn_url']}"
52
+ return if stdout.blank?
53
+ commits = Lazylead::Svn::Commits.new(stdout)
54
+ send_email postman, opts.merge(commits: commits) unless commits.empty?
55
55
  end
56
56
 
57
57
  # Send email with svn log as an attachment.
@@ -25,8 +25,10 @@
25
25
  require "tmpdir"
26
26
  require "nokogiri"
27
27
  require "active_support/core_ext/hash/conversions"
28
+ require_relative "../../os"
28
29
  require_relative "../../salt"
29
30
  require_relative "../../opts"
31
+ require_relative "svn"
30
32
 
31
33
  module Lazylead
32
34
  module Task
@@ -47,14 +49,12 @@ module Lazylead
47
49
 
48
50
  # Return all svn commits for particular date range in repo
49
51
  def svn_log(opts)
50
- cmd = [
51
- "svn log --diff --no-auth-cache",
52
- "--username #{opts.decrypt('svn_user', 'svn_salt')}",
53
- "--password #{opts.decrypt('svn_password', 'svn_salt')}",
54
- "-r {#{from(opts)}}:{#{now(opts)}} #{opts['svn_url']}"
55
- ]
56
- stdout = `#{cmd.join(" ")}`
57
- stdout.split("-" * 72).reject(&:blank?).reverse.map { |e| Entry.new(e) }
52
+ stdout = OS.new.run "svn log --diff --no-auth-cache",
53
+ "--username #{opts.decrypt('svn_user', 'svn_salt')}",
54
+ "--password #{opts.decrypt('svn_password', 'svn_salt')}",
55
+ "-r {#{from(opts)}}:{#{now(opts)}} #{opts['svn_url']}"
56
+ return [] if stdout.blank?
57
+ Lazylead::Svn::Commits.new(stdout)
58
58
  end
59
59
 
60
60
  # The start date & time for search range
@@ -73,67 +73,4 @@ module Lazylead
73
73
  end
74
74
  end
75
75
  end
76
-
77
- # Single SVN commit details
78
- class Entry
79
- def initialize(commit)
80
- @commit = commit
81
- end
82
-
83
- def to_s
84
- "#{rev} #{msg}"
85
- end
86
-
87
- def rev
88
- header.first[1..]
89
- end
90
-
91
- def author
92
- header[1]
93
- end
94
-
95
- def time
96
- header[2]
97
- end
98
-
99
- def msg
100
- lines[1]
101
- end
102
-
103
- # The modified lines contains expected text
104
- def includes?(text)
105
- text = [text] unless text.respond_to? :each
106
- lines[4..].select { |l| l.start_with? "+" }
107
- .any? { |l| text.any? { |t| l.include? t } }
108
- end
109
-
110
- def lines
111
- @lines ||= @commit.split("\n").reject(&:blank?)
112
- end
113
-
114
- def header
115
- @header ||= lines.first.split(" | ").reject(&:blank?)
116
- end
117
-
118
- # Detect SVN diff lines with particular text
119
- def diff(text)
120
- @diff ||= begin
121
- files = affected(text).uniq
122
- @commit.split("Index: ")
123
- .select { |i| files.any? { |f| i.start_with? f } }
124
- .map { |i| i.split "\n" }
125
- .flatten
126
- end
127
- end
128
-
129
- # Detect affected files with particular text
130
- def affected(text)
131
- occurrences = lines.each_index.select do |i|
132
- lines[i].start_with?("+") && text.any? { |t| lines[i].include? t }
133
- end
134
- occurrences.map do |occ|
135
- lines[2..occ].reverse.find { |l| l.start_with? "Index: " }[7..]
136
- end
137
- end
138
- end
139
76
  end
@@ -0,0 +1,107 @@
1
+ # frozen_string_literal: true
2
+
3
+ # The MIT License
4
+ #
5
+ # Copyright (c) 2019-2021 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
+ module Svn
29
+ #
30
+ # SVN commit built from command-line stdout (OS#run).
31
+ #
32
+ class Commit
33
+ def initialize(raw)
34
+ @raw = raw
35
+ end
36
+
37
+ def to_s
38
+ "#{rev} #{msg}"
39
+ end
40
+
41
+ def rev
42
+ header.first[1..]
43
+ end
44
+
45
+ def author
46
+ header[1]
47
+ end
48
+
49
+ def time
50
+ header[2]
51
+ end
52
+
53
+ def msg
54
+ lines[1]
55
+ end
56
+
57
+ def lines
58
+ @lines ||= @raw.split("\n").reject(&:blank?)
59
+ end
60
+
61
+ def header
62
+ @header ||= lines.first.split(" | ").reject(&:blank?)
63
+ end
64
+
65
+ # The modified lines contains expected text
66
+ def includes?(text)
67
+ text = [text] unless text.respond_to? :each
68
+ lines[4..].select { |l| l.start_with? "+" }.any? { |l| text.any? { |t| l.include? t } }
69
+ end
70
+
71
+ # Detect SVN diff lines with particular text
72
+ def diff(text)
73
+ @diff ||= begin
74
+ files = affected(text).uniq
75
+ @raw.split("Index: ")
76
+ .select { |i| files.any? { |f| i.start_with? f } }
77
+ .map { |i| i.split "\n" }
78
+ .flatten
79
+ end
80
+ end
81
+
82
+ # Detect affected files with particular text
83
+ def affected(text)
84
+ occurrences = lines.each_index.select do |i|
85
+ lines[i].start_with?("+") && text.any? { |t| lines[i].include? t }
86
+ end
87
+ occurrences.map do |occ|
88
+ lines[2..occ].reverse.find { |l| l.start_with? "Index: " }[7..]
89
+ end
90
+ end
91
+ end
92
+
93
+ #
94
+ # SVN commits built from command-line stdout (OS#run).
95
+ #
96
+ class Commits
97
+ extend Forwardable
98
+ def_delegators :@all, :each, :map, :select, :empty?
99
+
100
+ # @todo #/DEV Find a way how to avoid @all initialization directly in constructor.
101
+ # There should be a way how to make lazy initialization of @all with 'forwardable'.
102
+ def initialize(stdout)
103
+ @all = stdout.split("-" * 72).reject(&:blank?).reverse.map { |e| Commit.new(e) }
104
+ end
105
+ end
106
+ end
107
+ end
@@ -25,6 +25,7 @@
25
25
  require "tmpdir"
26
26
  require "nokogiri"
27
27
  require "active_support/core_ext/hash/conversions"
28
+ require_relative "../../os"
28
29
  require_relative "../../salt"
29
30
  require_relative "../../opts"
30
31
 
@@ -64,13 +65,10 @@ module Lazylead
64
65
  DateTime.now
65
66
  end
66
67
  start = (now.to_time - opts["period"].to_i).to_datetime
67
- cmd = [
68
- "svn log --no-auth-cache",
69
- "--username #{opts.decrypt('svn_user', 'svn_salt')}",
70
- "--password #{opts.decrypt('svn_password', 'svn_salt')}",
71
- "--xml -v -r {#{start}}:{#{now}} #{opts['svn_url']}"
72
- ]
73
- raw = `#{cmd.join(" ")}`
68
+ raw = OS.new.run "svn log --no-auth-cache",
69
+ "--username #{opts.decrypt('svn_user', 'svn_salt')}",
70
+ "--password #{opts.decrypt('svn_password', 'svn_salt')}",
71
+ "--xml -v -r {#{start}}:{#{now}} #{opts['svn_url']}"
74
72
  Nokogiri.XML(raw, nil, "UTF-8")
75
73
  end
76
74
 
@@ -23,5 +23,5 @@
23
23
  # OR OTHER DEALINGS IN THE SOFTWARE.
24
24
 
25
25
  module Lazylead
26
- VERSION = "0.9.2"
26
+ VERSION = "0.9.3"
27
27
  end
@@ -102,8 +102,7 @@
102
102
  <tr>
103
103
  <td><a href='<%= a.issue.url %>'><%= a.issue.key %></a></td>
104
104
  <td><%= a.issue.priority %></td>
105
- <td><%= DateTime.parse(a.last["created"])
106
- .strftime('%d-%b-%Y %I:%M:%S %p') %></td>
105
+ <td><%= DateTime.parse(a.last["created"]).strftime('%d-%b') %></td>
107
106
  <td><span style='color: red'><%= a.last["author"]["displayName"] %></span>
108
107
  (<%= a.last["author"]["name"] %>)
109
108
  </td>
@@ -73,7 +73,7 @@
73
73
  <th id="total">
74
74
  <a href="<%= search_link %><%= CGI.escape(jql) %>">Assigned From</a>
75
75
  </th>
76
- <th id="duedate">Next Due date</th>
76
+ <th id="duedate">Next due date</th>
77
77
  </tr>
78
78
  <% assignments.each do |teammate, assignment| %>
79
79
  <% if assignment.free? %>
@@ -64,20 +64,13 @@
64
64
  padding: 36px
65
65
  }
66
66
 
67
- .commit {
68
- min-width: 100%;
69
- border-radius: 3.5px;
70
- overflow: hidden;
71
- display: inline-block;
72
- line-height: 15px;
73
- font-family: Menlo, Monaco, Consolas, "Courier New", monospace;
74
- border: 1px solid #BCC6CC;
67
+ th, td {
68
+ padding-left: 3px;
69
+ padding-right: 3px;
75
70
  }
76
71
 
77
- .commit * {
78
- padding-left: 4px;
79
- font-size: 8px;
80
- line-height: 12px;
72
+ th {
73
+ font-weight: bold;
81
74
  }
82
75
  </style>
83
76
  <title>SVN log</title>
@@ -86,23 +79,30 @@
86
79
  <p>Hi,</p>
87
80
  <p>The following file(s) changed since <code><%= since_rev %></code> rev in
88
81
  <a href="<%= svn_url %>"><%= svn_url %></a>:</p>
89
- <% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
90
- <div class="commit">
91
- <% commit.split("\n").reject(&:blank?).each_with_index do |line, index| %>
92
- <p style="background: gainsboro;">
93
- <% if index.zero? %>
94
- <% details = line.split("|").map(&:strip).reject(&:blank?) %>
95
- <a href="<%= commit_url %><%= details[0][1..-1] %>"><%= details[0] %></a>
96
- by <a href="<%= user %><%= details[1] %>"><%= details[1] %></a>
97
- at <span style="color: #275a90;"><%= details[2] %></span>
98
- <% end %>
99
- <% if index == 1 %>
100
- <span style="padding-left: 4px"><%= line %></span>
101
- <% end %>
102
- </p>
103
- <% end %>
104
- </div>
105
- <% end %>
82
+ <table summary="diff">
83
+ <tr>
84
+ <th id="rev">rev</th>
85
+ <th id="author">Author</th>
86
+ <th id="time">When</th>
87
+ <th id="msg">Message</th>
88
+ </tr>
89
+ <% commits.each do |commit| %>
90
+ <tr>
91
+ <td>
92
+ <div class="auto">
93
+ <a href="<%= commit_url %><%= commit.rev %>"><%= commit.rev %></a>
94
+ </div>
95
+ </td>
96
+ <td>
97
+ <div class="auto">
98
+ <a href="<%= user %><%= commit.author %>"><%= commit.author %></a>
99
+ </div>
100
+ </td>
101
+ <td><%= DateTime.parse(commit.time).strftime("%d-%m-%Y %H:%M:%S") %></td>
102
+ <td><%= commit.lines[1] %></td>
103
+ </tr>
104
+ <% end %>
105
+ </table>
106
106
  <p>Posted by
107
107
  <a href="https://github.com/dgroup/lazylead">lazylead v<%= version %></a>.
108
108
  </p>
@@ -91,18 +91,16 @@
91
91
  <p>Commit(s) since <code><%= since_rev %></code> revision in <a href="<%= svn_url %>"><%= svn_url %></a>:</p>
92
92
  <div id="table-of-contents" class="table-of-contents">
93
93
  <ul>
94
- <% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
95
- <% details = commit.split("\n").reject(&:blank?).first.split("|").map(&:strip).reject(&:blank?) %>
96
- <li><a href="#<%= details[0] %>"><%= details[0] %></a> by <%= details[1] %> at <%= details[2] %></li>
94
+ <% commits.each do |commit| %>
95
+ <li><a href="#<%= commit.rev %>"><%= commit.rev %></a> by <%= commit.author %> at <%= commit.time %></li>
97
96
  <% end %>
98
97
  </ul>
99
98
  </div>
100
- <% stdout.split("------------------------------------------------------------------------").reject(&:blank?).reverse.each do |commit| %>
99
+ <% commits.each do |commit| %>
101
100
  <div class="commit">
102
- <% commit.split("\n").reject(&:blank?).each_with_index do |line, index| %>
101
+ <% commit.lines.each_with_index do |line, index| %>
103
102
  <% if index.zero? %>
104
- <% details = line.split("|").map(&:strip).reject(&:blank?) %>
105
- <p style="background: gainsboro;" id="<%= details[0] %>"><a href="<%= commit_url %><%= details[0][1..-1] %>"><%= details[0] %></a> by <a href="<%= user %><%= details[1] %>"><%= details[1] %></a> at <span style="color: #275a90;"><%= details[2] %></span>
103
+ <p style="background: gainsboro;" id="<%= commit.rev %>"><a href="<%= commit_url %><%= commit.rev %>"><%= commit.rev %></a> by <a href="<%= user %><%= commit.author %>"><%= commit.author %></a> at <span style="color: #275a90;"><%= commit.time %></span>
106
104
  <a href="#table-of-contents">&#8593;</a>
107
105
  </p>
108
106
  <% else %>
data/readme.md CHANGED
@@ -175,11 +175,13 @@ For simplicity, we are using [docker-compose](https://docs.docker.com/compose/):
175
175
  ```
176
176
 
177
177
  ### How to contribute?
178
- [![EO badge](http://www.elegantobjects.org/badge.svg)](http://www.elegantobjects.org/#principles)
179
178
 
180
- Pull requests are welcome! Don't forget to add your name to contribution section and run this, beforehand:
179
+ <a href="https://www.buymeacoffee.com/lazylead" target="_blank"><img src="https://www.buymeacoffee.com/assets/img/custom_images/orange_img.png" alt="Buy Me A Coffee" style="height: 41px !important;width: 174px !important;box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;-webkit-box-shadow: 0px 3px 2px 0px rgba(190, 190, 190, 0.5) !important;" ></a>
180
+ [![paypal](https://www.paypalobjects.com/en_US/i/btn/btn_donate_SM.gif)](https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YLV7Z9UUM3AJL)
181
+
182
+ [Pull requests](http://www.elegantobjects.org/#principles) are welcome! Don't forget to add your name to contribution section and run this, beforehand:
181
183
  ```ruby
182
- bundle exec rake
184
+ rake -A
183
185
  ```
184
186
  Everyone interacting in this project’s codebases, issue trackers, chat rooms is expected to follow the [code of conduct](.github/CODE_OF_CONDUCT.md).
185
187
 
@@ -194,5 +194,13 @@ module Lazylead
194
194
  "context_path" => ""
195
195
  ).issues("key=DATAJDBC-480")
196
196
  end
197
+
198
+ test "sprint is found" do
199
+ assert_equal "Sprint 68",
200
+ NoAuthJira.new("https://jira.spring.io")
201
+ .issues("key=XD-3744", fields: ["customfield_10480"])
202
+ .first
203
+ .sprint("customfield_10480")
204
+ end
197
205
  end
198
206
  end
@@ -56,7 +56,7 @@ module Lazylead
56
56
  )
57
57
  )
58
58
  assert_email "[LL] Raised tickets",
59
- %w[DATAJDBC-493 0.5 100% MyeongHyeonLee Deadlock\ occurs]
59
+ "DATAJDBC-493", "0.5", "100%", "MyeongHyeonLee", "Deadlock occurs"
60
60
  end
61
61
 
62
62
  test "construct accuracy from orm" do
@@ -69,7 +69,7 @@ module Lazylead
69
69
  )
70
70
  )
71
71
  assert_email "[LL] Only",
72
- %w[XD-3725 Blocker EmbeddedHeadersMessageConverter]
72
+ "XD-3725", "Blocker", "EmbeddedHeadersMessageConverter"
73
73
  end
74
74
 
75
75
  test "detect score" do
@@ -65,12 +65,10 @@ module Lazylead
65
65
  end
66
66
 
67
67
  test "issue has two .png files with reference in description but with extension mismatch" do
68
- refute Screenshots.new.passed(
68
+ refute Screenshots.new(minimum: 2).passed(
69
69
  OpenStruct.new(
70
70
  description: "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n",
71
- fields: {
72
- "description" => "Hi,\n here are snapshots !img1.jpg|thumbnail!\n!img2.jpg|thumbnail!\n"
73
- },
71
+ fields: { "description" => "-" },
74
72
  attachments: [
75
73
  OpenStruct.new("filename" => "img1.JPG"),
76
74
  OpenStruct.new("filename" => "img2.jpg")
@@ -48,7 +48,8 @@ module Lazylead
48
48
  "template" => "lib/messages/alertif.erb"
49
49
  )
50
50
  )
51
- assert_email "[LL] alert if", %w[XD-3064 Critical Done Glenn Risberg HdfsMongoDB]
51
+ assert_email "[LL] alert if",
52
+ "XD-3064", "Critical", "Done", "Glenn Renfro", "Thomas Risberg", "HdfsMongoDB"
52
53
  end
53
54
  end
54
55
  end
@@ -47,7 +47,8 @@ module Lazylead
47
47
  )
48
48
  )
49
49
  assert_email "Assignment: How dare you?",
50
- %w[DATAJDBC-480 01-Apr-2020 Minor Mark\ Paluch tom,mike,bob EntityInstantiators]
50
+ "DATAJDBC-480", "01-Apr", "Minor", "Mark Paluch", "tom,mike,bob",
51
+ "EntityInstantiators"
51
52
  end
52
53
  end
53
54
  end
@@ -47,7 +47,8 @@ module Lazylead
47
47
  "template" => "lib/messages/created_recently.erb"
48
48
  )
49
49
  )
50
- assert_email "[CR] 20min ago!", %w[XD-3766 SGF-726]
50
+ assert_email "[CR] 20min ago!",
51
+ "XD-3766", "SGF-726"
51
52
  end
52
53
  end
53
54
  end
@@ -82,7 +82,7 @@ module Lazylead
82
82
  )
83
83
  )
84
84
  assert_email "[DD] HMCHT!",
85
- %w[STS-3599 2013-11-08 Major Miles\ Parker Use JavaFX WebView]
85
+ "STS-3599", "2013-11-08", "Major", "Miles Parker", "Use JavaFX WebView"
86
86
  end
87
87
 
88
88
  test "send notification about bunch of tickets" do
@@ -100,7 +100,7 @@ module Lazylead
100
100
  )
101
101
  )
102
102
  assert_email "ALRT: Frozen",
103
- %w[Hi Boss STS-3599 2013-11-08 Major Miles\ Parker Use JavaFX WebView]
103
+ "Hi Boss", "STS-3599", "2013-11-08", "Major", "Miles Parker", "Use JavaFX WebView"
104
104
  end
105
105
 
106
106
  test "cc got notification" do
@@ -48,7 +48,8 @@ module Lazylead
48
48
  )
49
49
  )
50
50
  assert_email "FixVersion: How dare you?",
51
- %w[DATAJDBC-480 01-Apr-2020 Minor Mark\ Paluch tom,mike,bob EntityInstantiators]
51
+ "DATAJDBC-480", "01-Apr-2020", "Minor", "Mark Paluch", "tom,mike,bob",
52
+ "EntityInstantiators"
52
53
  end
53
54
  end
54
55
  end
@@ -41,7 +41,7 @@ module Lazylead
41
41
  "to" => "lead@company.com",
42
42
  "from" => "ll@company.com",
43
43
  "jql" => "key in (STS-3599, XD-3739, XD-3744)",
44
- "team" => "mclaren:Tom McLaren,milesparker:Mi Pa",
44
+ "team" => "mclaren:Tom McLaren,milesparker:Mi Pa,grussell:Gary Ru",
45
45
  "user_link" => "https://user.com?id=",
46
46
  "search_link" => "https://jira.spring.io/issues/?jql=",
47
47
  "fields" => "assignee,duedate,customfield_10480",
@@ -50,7 +50,10 @@ module Lazylead
50
50
  "template" => "lib/messages/loading.erb"
51
51
  )
52
52
  )
53
- assert_email "[LL] Team loading", %w[mclaren Tom McLaren 0]
53
+ assert_email "[LL] Team loading",
54
+ "grussell", "Gary Ru", "Sprint 68", "1",
55
+ "Miles Parker", "No sprint: 1", "2013-11-08",
56
+ "Tom McLaren", "0"
54
57
  end
55
58
  end
56
59
  end
@@ -50,7 +50,7 @@ module Lazylead
50
50
  )
51
51
  )
52
52
  assert_email "DD: How dare you?",
53
- %w[SPR-6541 Major (kdonald) 2009-12-10 Spring's\ Maven\ Central tom,mike,bob]
53
+ "SPR-6541", "Major", "(kdonald)", "2009-12-10", "Spring's Maven Central", "tom,mike,bob"
54
54
  end
55
55
 
56
56
  test "since for past 1 min" do
@@ -50,7 +50,7 @@ module Lazylead
50
50
  )
51
51
  )
52
52
  assert_email "Expected ftp link is missing",
53
- %w[DATAJDBC-523 Major Mark\ Paluch https://github.com/spring-projects/spring-data-jdbc/commit/aadbb667ed1d61139d5ac51a06eb3dd1b39316db#diff-510a5041bb8a0575e97fedf105606b83R130]
53
+ "DATAJDBC-523", "Major", "Mark Paluch", "https://github.com/spring-projects/spring-data-jdbc/commit/aadbb667ed1d61139d5ac51a06eb3dd1b39316db#diff-510a5041bb8a0575e97fedf105606b83R130"
54
54
  end
55
55
  end
56
56
  end
@@ -57,7 +57,7 @@ module Lazylead
57
57
  "template-attachment" => "lib/messages/svn_diff_attachment.erb"
58
58
  )
59
59
  )
60
- assert_email_line "[SVN] Changed since rev1", %w[r2 by dgroup at 2020-08-16]
60
+ assert_email_line "[SVN] Changed since rev1", %w[r2 by dgroup at 16-08-2020]
61
61
  # assert_attachment "[SVN] Changed since rev1", /^.*svn-log-.*.html.zip$/
62
62
  end
63
63
 
@@ -28,6 +28,7 @@ require_relative "../../../../lib/lazylead/smtp"
28
28
  require_relative "../../../../lib/lazylead/opts"
29
29
  require_relative "../../../../lib/lazylead/postman"
30
30
  require_relative "../../../../lib/lazylead/task/svn/grep"
31
+ require_relative "../../../../lib/lazylead/task/svn/svn"
31
32
 
32
33
  module Lazylead
33
34
  class GrepTest < Lazylead::Test
@@ -96,7 +97,7 @@ module Lazylead
96
97
 
97
98
 
98
99
  MSG
99
- assert_equal 15, Entry.new(diff).diff(%w[ping]).size,
100
+ assert_equal 15, Lazylead::Svn::Commit.new(diff).diff(%w[ping]).size,
100
101
  "There is one commit with 'ping' word where diff has 14 lines"
101
102
  end
102
103
  end
data/test/test.rb CHANGED
@@ -79,9 +79,9 @@ module Lazylead
79
79
  end
80
80
 
81
81
  # Assert that text contains expected words
82
- def assert_words(words, text)
82
+ def assert_words(*words, text)
83
83
  words = [words] unless words.respond_to? :each
84
- words.each do |w|
84
+ words.first.each do |w|
85
85
  assert_includes text, w
86
86
  end
87
87
  end
@@ -103,7 +103,8 @@ module Lazylead
103
103
 
104
104
  # Assert that email sent using 'mail' gem in test mode
105
105
  # has expected subject and words
106
- def assert_email(subject, words)
106
+ def assert_email(subject, *words)
107
+ refute_empty words, "No words provided to match"
107
108
  email = Mail::TestMailer.deliveries
108
109
  .find { |m| m.subject.eql? subject }
109
110
  refute_nil email, "No email found with subject: #{subject}"
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: lazylead
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.9.2
4
+ version: 0.9.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Yurii Dubinka
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2021-05-04 00:00:00.000000000 Z
11
+ date: 2021-05-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: activerecord
@@ -58,14 +58,14 @@ dependencies:
58
58
  requirements:
59
59
  - - '='
60
60
  - !ruby/object:Gem::Version
61
- version: 1.4.1
61
+ version: 1.4.2
62
62
  type: :runtime
63
63
  prerelease: false
64
64
  version_requirements: !ruby/object:Gem::Requirement
65
65
  requirements:
66
66
  - - '='
67
67
  - !ruby/object:Gem::Version
68
- version: 1.4.1
68
+ version: 1.4.2
69
69
  - !ruby/object:Gem::Dependency
70
70
  name: get_process_mem
71
71
  requirement: !ruby/object:Gem::Requirement
@@ -240,14 +240,14 @@ dependencies:
240
240
  requirements:
241
241
  - - '='
242
242
  - !ruby/object:Gem::Version
243
- version: 4.8.2
243
+ version: 4.9.0
244
244
  type: :runtime
245
245
  prerelease: false
246
246
  version_requirements: !ruby/object:Gem::Requirement
247
247
  requirements:
248
248
  - - '='
249
249
  - !ruby/object:Gem::Version
250
- version: 4.8.2
250
+ version: 4.9.0
251
251
  - !ruby/object:Gem::Dependency
252
252
  name: sqlite3
253
253
  requirement: !ruby/object:Gem::Requirement
@@ -366,14 +366,14 @@ dependencies:
366
366
  requirements:
367
367
  - - '='
368
368
  - !ruby/object:Gem::Version
369
- version: 2.16.2
369
+ version: 2.17.0
370
370
  type: :development
371
371
  prerelease: false
372
372
  version_requirements: !ruby/object:Gem::Requirement
373
373
  requirements:
374
374
  - - '='
375
375
  - !ruby/object:Gem::Version
376
- version: 2.16.2
376
+ version: 2.17.0
377
377
  - !ruby/object:Gem::Dependency
378
378
  name: guard-minitest
379
379
  requirement: !ruby/object:Gem::Requirement
@@ -506,14 +506,14 @@ dependencies:
506
506
  requirements:
507
507
  - - '='
508
508
  - !ruby/object:Gem::Version
509
- version: 1.13.0
509
+ version: 1.15.0
510
510
  type: :development
511
511
  prerelease: false
512
512
  version_requirements: !ruby/object:Gem::Requirement
513
513
  requirements:
514
514
  - - '='
515
515
  - !ruby/object:Gem::Version
516
- version: 1.13.0
516
+ version: 1.15.0
517
517
  - !ruby/object:Gem::Dependency
518
518
  name: rubocop-minitest
519
519
  requirement: !ruby/object:Gem::Requirement
@@ -534,14 +534,14 @@ dependencies:
534
534
  requirements:
535
535
  - - '='
536
536
  - !ruby/object:Gem::Version
537
- version: 1.11.1
537
+ version: 1.11.3
538
538
  type: :development
539
539
  prerelease: false
540
540
  version_requirements: !ruby/object:Gem::Requirement
541
541
  requirements:
542
542
  - - '='
543
543
  - !ruby/object:Gem::Version
544
- version: 1.11.1
544
+ version: 1.11.3
545
545
  - !ruby/object:Gem::Dependency
546
546
  name: rubocop-rake
547
547
  requirement: !ruby/object:Gem::Requirement
@@ -679,6 +679,7 @@ files:
679
679
  - lib/lazylead/log.rb
680
680
  - lib/lazylead/model.rb
681
681
  - lib/lazylead/opts.rb
682
+ - lib/lazylead/os.rb
682
683
  - lib/lazylead/postman.rb
683
684
  - lib/lazylead/requires.rb
684
685
  - lib/lazylead/salt.rb
@@ -715,6 +716,7 @@ files:
715
716
  - lib/lazylead/task/savepoint.rb
716
717
  - lib/lazylead/task/svn/diff.rb
717
718
  - lib/lazylead/task/svn/grep.rb
719
+ - lib/lazylead/task/svn/svn.rb
718
720
  - lib/lazylead/task/svn/touch.rb
719
721
  - lib/lazylead/version.rb
720
722
  - lib/messages/accuracy.erb
@@ -786,7 +788,7 @@ licenses:
786
788
  - MIT
787
789
  metadata: {}
788
790
  post_install_message: |-
789
- Thanks for installing Lazylead v0.9.2!
791
+ Thanks for installing Lazylead v0.9.3!
790
792
  Read our blog posts: https://lazylead.org
791
793
  Stay in touch with the community in Telegram: https://t.me/lazylead
792
794
  Follow us on Twitter: https://twitter.com/lazylead