lazylead 0.5.1 → 0.5.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/Rakefile +4 -3
- data/bin/lazylead +6 -4
- data/lazylead.gemspec +3 -3
- data/lib/lazylead/cli/app.rb +5 -2
- data/lib/lazylead/exchange.rb +1 -1
- data/lib/lazylead/log.rb +2 -1
- data/lib/lazylead/postman.rb +9 -3
- data/lib/lazylead/smtp.rb +3 -1
- data/lib/lazylead/system/jira.rb +1 -0
- data/lib/lazylead/task/accuracy/records.rb +1 -1
- data/lib/lazylead/task/accuracy/testcase.rb +14 -4
- data/lib/lazylead/version.rb +1 -1
- data/test/lazylead/task/accuracy/testcase_test.rb +10 -0
- metadata +17 -17
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: aa4ef974cb7b4799fb96acf04912513098f53c9adbb7f2bff4ea5bd8b498fb7e
|
4
|
+
data.tar.gz: e9d8aea4a9fe5da7a63e35062cd7c0ff6c7670e1645d031dc27b6cf599d71608
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 897ee5e71b3eb970246cdeca00179b27d0d906e8e457dc384a2b79e25ed1a746f785ebb5981a7deb458aaef78428c6ae63025e42579daea160f3463eb611b455
|
7
|
+
data.tar.gz: 39850bcbb8e33239d8a5ab74a291f4ec4332067573ee3287775ad3c33c0210faf801358472ff9fc7b1dd531e6aedafc90e5393cf57ee04b32d5a6af120c02bc0
|
data/Rakefile
CHANGED
@@ -26,7 +26,7 @@ require "rubygems"
|
|
26
26
|
require "rake"
|
27
27
|
require "date"
|
28
28
|
require "rdoc"
|
29
|
-
require "
|
29
|
+
require "colorize"
|
30
30
|
require "rake/clean"
|
31
31
|
|
32
32
|
# @todo #/DEV Investigate the possibility of using migrations from active_record
|
@@ -112,9 +112,10 @@ task :sqlint do
|
|
112
112
|
total += violations.count { |lint| lint.type == :error }
|
113
113
|
end
|
114
114
|
if total.positive?
|
115
|
-
abort "#{
|
115
|
+
abort "#{total.colorize(:red)} SQL violations found."
|
116
116
|
else
|
117
|
-
puts "#{src.size} files inspected, #{
|
117
|
+
puts "#{src.size} files inspected, #{'no offenses'.colorize(:green)} " \
|
118
|
+
"detected"
|
118
119
|
end
|
119
120
|
end
|
120
121
|
|
data/bin/lazylead
CHANGED
@@ -29,7 +29,7 @@ STDOUT.sync = true
|
|
29
29
|
|
30
30
|
require "slop"
|
31
31
|
require "sqlite3"
|
32
|
-
require "
|
32
|
+
require "colorize"
|
33
33
|
require "logging"
|
34
34
|
require "backtrace"
|
35
35
|
require "memory_profiler"
|
@@ -77,8 +77,9 @@ Available options:"
|
|
77
77
|
exit
|
78
78
|
end
|
79
79
|
end
|
80
|
-
log.debug
|
81
|
-
log.debug
|
80
|
+
log.debug "Version: #{Lazylead::VERSION.colorize(:green)}"
|
81
|
+
log.debug "Memory footprint at start is " \
|
82
|
+
"#{Lazylead::Allocated.new.to_s.colorize(:light_blue)}."
|
82
83
|
cmd = lambda do
|
83
84
|
Lazylead::CLI::App.new(
|
84
85
|
log,
|
@@ -103,5 +104,6 @@ if opts["memory-dump"]
|
|
103
104
|
else
|
104
105
|
code = cmd.call
|
105
106
|
end
|
106
|
-
log.debug
|
107
|
+
log.debug "Memory footprint at the end is " \
|
108
|
+
"#{Lazylead::Allocated.new.to_s.colorize(:light_blue)}."
|
107
109
|
exit(code) unless code.zero?
|
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.5.
|
35
|
+
s.version = "0.5.2"
|
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.5.
|
48
|
+
s.post_install_message = "Thanks for installing Lazylead v0.5.2!
|
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
|
@@ -57,6 +57,7 @@ tasks instead of solving technical problems."
|
|
57
57
|
s.extra_rdoc_files = %w[readme.md license.txt]
|
58
58
|
s.add_runtime_dependency "activerecord", "6.0.3"
|
59
59
|
s.add_runtime_dependency "backtrace", "0.3"
|
60
|
+
s.add_runtime_dependency "colorize", "0.8.1"
|
60
61
|
s.add_runtime_dependency "faraday", "1.0.1"
|
61
62
|
s.add_runtime_dependency "get_process_mem", "0.2.5"
|
62
63
|
s.add_runtime_dependency "jira-ruby", "1.7.1"
|
@@ -65,7 +66,6 @@ tasks instead of solving technical problems."
|
|
65
66
|
s.add_runtime_dependency "mail", "2.7.1"
|
66
67
|
s.add_runtime_dependency "memory_profiler", "0.9.13"
|
67
68
|
s.add_runtime_dependency "openssl", "2.1.2"
|
68
|
-
s.add_runtime_dependency "rainbow", "3.0.0"
|
69
69
|
s.add_runtime_dependency "require_all", "3.0.0"
|
70
70
|
s.add_runtime_dependency "rufus-scheduler", "3.6.0"
|
71
71
|
s.add_runtime_dependency "slop", "4.4"
|
data/lib/lazylead/cli/app.rb
CHANGED
@@ -22,6 +22,7 @@
|
|
22
22
|
# ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE
|
23
23
|
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
|
25
|
+
require "colorize"
|
25
26
|
require "vcs4sql/sqlite/migration"
|
26
27
|
require_relative "../smtp"
|
27
28
|
require_relative "../schedule"
|
@@ -58,9 +59,11 @@ module Lazylead
|
|
58
59
|
def apply_vcs_migration(opts)
|
59
60
|
@db = File.expand_path(opts[:home]) + "/" + opts[:sqlite]
|
60
61
|
vcs = File.expand_path(opts[:home]) + "/" + opts[:vcs4sql]
|
61
|
-
@log.debug "Database: '#{@db}',
|
62
|
+
@log.debug "Database: '#{@db.colorize(:light_blue)}', "\
|
63
|
+
"sql migration dir: '#{vcs.colorize(:light_blue)}'"
|
62
64
|
Vcs4sql::Sqlite::Migration.new(@db).upgrade vcs, opts[:testdata]
|
63
|
-
@log.debug "Migration applied to #{@db} from
|
65
|
+
@log.debug "Migration applied to '#{@db.colorize(:light_blue)}' from " \
|
66
|
+
"'#{vcs.colorize(:light_blue)}'"
|
64
67
|
end
|
65
68
|
|
66
69
|
def enable_active_record(opts)
|
data/lib/lazylead/exchange.rb
CHANGED
data/lib/lazylead/log.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
|
25
25
|
require "logging"
|
26
|
+
require "colorize"
|
26
27
|
require "forwardable"
|
27
28
|
|
28
29
|
module Lazylead
|
@@ -68,7 +69,7 @@ module Lazylead
|
|
68
69
|
Logging.appenders.stdout(
|
69
70
|
"stdout",
|
70
71
|
layout: Logging.layouts.pattern(
|
71
|
-
pattern: "[%d] %-5l [%X{tid}] %m\n",
|
72
|
+
pattern: "[%d] %-5l #{'[%X{tid}]'.colorize(:light_green)} %m\n",
|
72
73
|
color_scheme: "bright"
|
73
74
|
)
|
74
75
|
)
|
data/lib/lazylead/postman.rb
CHANGED
@@ -53,19 +53,25 @@ module Lazylead
|
|
53
53
|
# Send an email.
|
54
54
|
# :opts :: the mail configuration like to, from, cc, subject, template.
|
55
55
|
def send(opts)
|
56
|
-
|
56
|
+
mail = make_email(opts)
|
57
|
+
mail.deliver
|
58
|
+
@log.debug "#{__FILE__} sent '#{mail.subject}' to '#{mail.to}'."
|
59
|
+
end
|
60
|
+
|
61
|
+
# Construct an email based on input arguments
|
62
|
+
def make_email(opts)
|
57
63
|
mail = Mail.new
|
58
64
|
mail.to opts[:to] || opts["to"]
|
59
65
|
mail.from opts["from"]
|
60
66
|
mail.cc opts["cc"] if opts.key? "cc"
|
61
67
|
mail.subject opts["subject"]
|
68
|
+
html = make_body(opts)
|
62
69
|
mail.html_part do
|
63
70
|
content_type "text/html; charset=UTF-8"
|
64
71
|
body html
|
65
72
|
end
|
66
73
|
add_attachments mail, opts
|
67
|
-
mail
|
68
|
-
@log.debug "#{__FILE__} sent email based on #{opts}."
|
74
|
+
mail
|
69
75
|
end
|
70
76
|
|
71
77
|
def add_attachments(mail, opts)
|
data/lib/lazylead/smtp.rb
CHANGED
@@ -23,6 +23,7 @@
|
|
23
23
|
# OR OTHER DEALINGS IN THE SOFTWARE.
|
24
24
|
|
25
25
|
require "mail"
|
26
|
+
require "colorize"
|
26
27
|
require_relative "log"
|
27
28
|
require_relative "salt"
|
28
29
|
|
@@ -45,7 +46,8 @@ module Lazylead
|
|
45
46
|
Mail.defaults do
|
46
47
|
delivery_method :test
|
47
48
|
end
|
48
|
-
@log.warn "SMTP connection enabled in
|
49
|
+
@log.warn "SMTP connection enabled in " \
|
50
|
+
"#{'test'.colorize(:light_yellow)} mode."
|
49
51
|
else
|
50
52
|
setup_smtp
|
51
53
|
end
|
data/lib/lazylead/system/jira.rb
CHANGED
@@ -34,7 +34,7 @@ module Lazylead
|
|
34
34
|
@ext = %w[.webm .mkv .flv .flv .vob .ogv .ogg .drc .gif .gifv .mng .avi
|
35
35
|
.mts .m2ts .ts .mov .qt .wmv .yuv .rm .rmvb .viv .asf .amv .mp4
|
36
36
|
.m4p .m4v .mpg .mp2 .mpeg .mpe .mpv .mpg .mpeg .m2v .m4v .svi
|
37
|
-
.3gp .3g2 .mxf .roq .nsv .flv .f4v .f4p .f4a .f4b]
|
37
|
+
.3gp .3g2 .mxf .roq .nsv .flv .f4v .f4p .f4a .f4b .gif]
|
38
38
|
end
|
39
39
|
|
40
40
|
# Ensure that ticket has an attachment with video-file extension
|
@@ -38,15 +38,25 @@ module Lazylead
|
|
38
38
|
return false if issue.description.nil?
|
39
39
|
@tc = @ar = @er = -1
|
40
40
|
issue.description.split("\n").reject(&:blank?).each_with_index do |l, i|
|
41
|
-
line = l.
|
42
|
-
detect_tc
|
43
|
-
detect_ar
|
44
|
-
detect_er
|
41
|
+
line = escape(l.strip.downcase)
|
42
|
+
detect_tc(line, i)
|
43
|
+
detect_ar(line, i)
|
44
|
+
detect_er(line, i)
|
45
45
|
break if with_tc_ar_er?
|
46
46
|
end
|
47
47
|
with_tc_ar_er?
|
48
48
|
end
|
49
49
|
|
50
|
+
def escape(line)
|
51
|
+
if line.include?("{color")
|
52
|
+
line.gsub(
|
53
|
+
/({color:(#([A-Fa-f0-9]{6}|[A-Fa-f0-9]{3})|[A-Za-z]+)})|{color}/, ""
|
54
|
+
)
|
55
|
+
else
|
56
|
+
line.gsub(/[^a-zA-Z(:|=)]/, "")
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
50
60
|
# @return true if description has test case, AR and ER
|
51
61
|
def with_tc_ar_er?
|
52
62
|
(@tc.zero? || @tc.positive?) && @ar.positive? && @er.positive?
|
data/lib/lazylead/version.rb
CHANGED
@@ -197,6 +197,16 @@ module Lazylead
|
|
197
197
|
[^screenshot-1.png]"
|
198
198
|
end
|
199
199
|
|
200
|
+
test "tc with colored ar er" do
|
201
|
+
assert testcase? "*TC:*
|
202
|
+
# Step 1
|
203
|
+
# Step 2
|
204
|
+
# Step ..
|
205
|
+
# Step N
|
206
|
+
{color:#00673A}ER{color}: XXXX
|
207
|
+
{color:#DE10AA}AR{color}: YYYY"
|
208
|
+
end
|
209
|
+
|
200
210
|
# ensure that issue description has a test case, AR and ER
|
201
211
|
def testcase?(desc)
|
202
212
|
Testcase.new.passed(OpenStruct.new(description: desc))
|
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.5.
|
4
|
+
version: 0.5.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Yurii Dubinka
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2020-10-
|
11
|
+
date: 2020-10-16 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: activerecord
|
@@ -38,6 +38,20 @@ dependencies:
|
|
38
38
|
- - '='
|
39
39
|
- !ruby/object:Gem::Version
|
40
40
|
version: '0.3'
|
41
|
+
- !ruby/object:Gem::Dependency
|
42
|
+
name: colorize
|
43
|
+
requirement: !ruby/object:Gem::Requirement
|
44
|
+
requirements:
|
45
|
+
- - '='
|
46
|
+
- !ruby/object:Gem::Version
|
47
|
+
version: 0.8.1
|
48
|
+
type: :runtime
|
49
|
+
prerelease: false
|
50
|
+
version_requirements: !ruby/object:Gem::Requirement
|
51
|
+
requirements:
|
52
|
+
- - '='
|
53
|
+
- !ruby/object:Gem::Version
|
54
|
+
version: 0.8.1
|
41
55
|
- !ruby/object:Gem::Dependency
|
42
56
|
name: faraday
|
43
57
|
requirement: !ruby/object:Gem::Requirement
|
@@ -150,20 +164,6 @@ dependencies:
|
|
150
164
|
- - '='
|
151
165
|
- !ruby/object:Gem::Version
|
152
166
|
version: 2.1.2
|
153
|
-
- !ruby/object:Gem::Dependency
|
154
|
-
name: rainbow
|
155
|
-
requirement: !ruby/object:Gem::Requirement
|
156
|
-
requirements:
|
157
|
-
- - '='
|
158
|
-
- !ruby/object:Gem::Version
|
159
|
-
version: 3.0.0
|
160
|
-
type: :runtime
|
161
|
-
prerelease: false
|
162
|
-
version_requirements: !ruby/object:Gem::Requirement
|
163
|
-
requirements:
|
164
|
-
- - '='
|
165
|
-
- !ruby/object:Gem::Version
|
166
|
-
version: 3.0.0
|
167
167
|
- !ruby/object:Gem::Dependency
|
168
168
|
name: require_all
|
169
169
|
requirement: !ruby/object:Gem::Requirement
|
@@ -675,7 +675,7 @@ licenses:
|
|
675
675
|
- MIT
|
676
676
|
metadata: {}
|
677
677
|
post_install_message: |-
|
678
|
-
Thanks for installing Lazylead v0.5.
|
678
|
+
Thanks for installing Lazylead v0.5.2!
|
679
679
|
Read our blog posts: https://lazylead.org
|
680
680
|
Stay in touch with the community in Telegram: https://t.me/lazylead
|
681
681
|
Follow us on Twitter: https://twitter.com/lazylead
|