Skip to content

Commit

Permalink
#355: Update rubocop requirement from = 1.11.0 to = 1.12.0
Browse files Browse the repository at this point in the history
Fixed #355
  • Loading branch information
dgroup committed Mar 25, 2021
1 parent 4ea70a9 commit 19491ce
Show file tree
Hide file tree
Showing 5 changed files with 32 additions and 43 deletions.
1 change: 1 addition & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ require:
- rubocop-performance

AllCops:
NewCops: enable
DisplayCopNames: true
DisplayStyleGuide: true
TargetRubyVersion: 2.6
Expand Down
38 changes: 16 additions & 22 deletions lib/lazylead/cc.rb
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,11 @@ def initialize(text, regxp = /[^\s]@[^\s]/)
end

def cc
@cc ||= begin
if @text.include? ","
@text.split(",").map(&:strip).select { |e| e[@regxp] }
elsif @text[@regxp]
[@text.strip]
end
end
@cc ||= if @text.include? ","
@text.split(",").map(&:strip).select { |e| e[@regxp] }
elsif @text[@regxp]
[@text.strip]
end
end

def each(&block)
Expand Down Expand Up @@ -125,15 +123,13 @@ def cc(*names)
end

def to_h
@to_h ||= begin
if @orig.is_a? Hash
@orig.each_with_object({}) do |i, o|
o[i.first] = Lazylead::PlainCC.new(i.last).cc
end
else
{}
end
end
@to_h ||= if @orig.is_a? Hash
@orig.each_with_object({}) do |i, o|
o[i.first] = Lazylead::PlainCC.new(i.last).cc
end
else
{}
end
end
end

Expand All @@ -151,12 +147,10 @@ def initialize(prj, jira)
end

def to_h
@to_h ||= begin
components.each_with_object({}) do |c, h|
email = lead(c.attrs["id"])
next if email.nil? || email.blank?
h[c.attrs["name"]] = email
end
@to_h ||= components.each_with_object({}) do |c, h|
email = lead(c.attrs["id"])
next if email.nil? || email.blank?
h[c.attrs["name"]] = email
end
end

Expand Down
12 changes: 5 additions & 7 deletions lib/lazylead/model.rb
Original file line number Diff line number Diff line change
Expand Up @@ -135,13 +135,11 @@ def detect_cc(sys)
end

def props
@props ||= begin
if team.nil?
Opts.new(env(to_hash))
else
Opts.new(env(team.to_hash.merge(to_hash)))
end
end
@props ||= if team.nil?
Opts.new(env(to_hash))
else
Opts.new(env(team.to_hash.merge(to_hash)))
end
end

def postman
Expand Down
12 changes: 5 additions & 7 deletions lib/lazylead/task/accuracy/accuracy.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,13 +118,11 @@ def color
end

def colors
@colors ||= begin
JSON.parse(@opts["colors"])
.to_h
.to_a
.each { |e| e[0] = e[0].to_i }
.sort_by { |e| e[0] }
end
@colors ||= JSON.parse(@opts["colors"])
.to_h
.to_a
.each { |e| e[0] = e[0].to_i }
.sort_by { |e| e[0] }
end

# Calculate grade for accuracy
Expand Down
12 changes: 5 additions & 7 deletions lib/lazylead/task/accuracy/onlyll.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,13 +94,11 @@ def to_l(history)

# Detect the percentage grid for tickets, by default its 0%, 10%, 20%, etc.
def grid
@grid ||= begin
if @opts.key? "grid"
@opts.slice("grid", ",")
else
%w[0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%]
end
end
@grid ||= if @opts.key? "grid"
@opts.slice("grid", ",")
else
%w[0% 10% 20% 30% 40% 50% 60% 70% 80% 90% 100%]
end
end

# Remove score labels from the ticket.
Expand Down

0 comments on commit 19491ce

Please sign in to comment.