From 86605e5db9656b73acfd1d841ccc0eb364158031 Mon Sep 17 00:00:00 2001 From: Kyrylo Silin Date: Sat, 2 Mar 2019 16:42:29 +0200 Subject: rubocop: fix offences of the Style/UnneededCondition cop --- lib/pry/commands/show_doc.rb | 4 +--- lib/pry/commands/show_source.rb | 4 +--- lib/pry/commands/stat.rb | 2 +- 3 files changed, 3 insertions(+), 7 deletions(-) (limited to 'lib/pry/commands') diff --git a/lib/pry/commands/show_doc.rb b/lib/pry/commands/show_doc.rb index 8fa97024..05251bb4 100644 --- a/lib/pry/commands/show_doc.rb +++ b/lib/pry/commands/show_doc.rb @@ -48,9 +48,7 @@ class Pry # command '--help' shouldn't use markup highlighting docs else - if docs.empty? - raise CommandError, "No docs found for: #{obj_name ? obj_name : 'current context'}" - end + raise CommandError, "No docs found for: #{obj_name || 'current context'}" if docs.empty? process_comment_markup(docs) end diff --git a/lib/pry/commands/show_source.rb b/lib/pry/commands/show_source.rb index 6317535a..56bfb9f1 100644 --- a/lib/pry/commands/show_source.rb +++ b/lib/pry/commands/show_source.rb @@ -69,9 +69,7 @@ class Pry # command '--help' shouldn't use markup highlighting docs else - if docs.empty? - raise CommandError, "No docs found for: #{obj_name ? obj_name : 'current context'}" - end + raise CommandError, "No docs found for: #{obj_name || 'current context'}" if docs.empty? process_comment_markup(docs) end diff --git a/lib/pry/commands/stat.rb b/lib/pry/commands/stat.rb index 7892cace..cfdfabd2 100644 --- a/lib/pry/commands/stat.rb +++ b/lib/pry/commands/stat.rb @@ -27,7 +27,7 @@ class Pry -- Name: #{meth.name} Alias#{'es' if aliases.length > 1}: #{aliases.any? ? aliases.join(', ') : 'None.'} - Owner: #{meth.owner ? meth.owner : 'Unknown'} + Owner: #{meth.owner || 'Unknown'} Visibility: #{meth.visibility} Type: #{meth.is_a?(::Method) ? 'Bound' : 'Unbound'} Arity: #{meth.arity} -- cgit v1.2.1