Skip to content

Commit

Permalink
Add Style/RedundantSelf
Browse files Browse the repository at this point in the history
  • Loading branch information
winebarrel committed Jun 10, 2018
1 parent 65cfc3b commit 4045385
Show file tree
Hide file tree
Showing 5 changed files with 8 additions and 10 deletions.
2 changes: 0 additions & 2 deletions .rubocop.yml
Original file line number Diff line number Diff line change
Expand Up @@ -89,8 +89,6 @@ Style/PerlBackrefs:
Enabled: false
Style/RedundantParentheses:
Enabled: false
Style/RedundantSelf:
Enabled: false
Style/RescueStandardError:
Enabled: false
Style/Semicolon:
Expand Down
2 changes: 1 addition & 1 deletion lib/ridgepole/client.rb
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ def diff(dsl_or_config1, dsl_or_config2, options = {})
end

def dump(conn_spec, options = {}, &block)
client = self.new(conn_spec, options)
client = new(conn_spec, options)
client.dump(&block)
end

Expand Down
2 changes: 1 addition & 1 deletion lib/ridgepole/dsl_parser/context.rb
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ def initialize(opts = {})
end

def self.eval(dsl, opts = {})
ctx = self.new(opts)
ctx = new(opts)

if opts[:path]
ctx.instance_eval(dsl, opts[:path])
Expand Down
2 changes: 1 addition & 1 deletion lib/ridgepole/ext/pp_sort_hash.rb
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ module Ext
module PpSortHash
def pretty_print(q)
q.group(1, '{', '}') do
q.seplist(self.sort_by { |k, _| k.to_s } , nil, :each) do |k, v|
q.seplist(sort_by { |k, _| k.to_s } , nil, :each) do |k, v|
v = PpSortHash.extend_if_hash(v)

q.group do
Expand Down
10 changes: 5 additions & 5 deletions lib/ridgepole/migration_ext.rb
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ def self.record_time
begin
self.time_recorder = TimeRecorder.new
yield
result = self.time_recorder.result
result = time_recorder.result
ensure
self.time_recorder = nil
end
Expand All @@ -25,18 +25,18 @@ def self.record_time

def write(text = '')
logger = Ridgepole::Logger.instance
logger.info(text) unless self.disable_logging
logger.info(text) unless disable_logging
parse_text(text)
end

def parse_text(text)
return unless self.time_recorder
return unless time_recorder

case text
when /\A--\s+(.+)\Z/
self.time_recorder.add_key($1)
time_recorder.add_key($1)
when /\A\s+->\s+(\d+\.\d+)s\Z/
self.time_recorder.add_value($1.to_f)
time_recorder.add_value($1.to_f)
end
end

Expand Down

0 comments on commit 4045385

Please sign in to comment.