diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2019-03-02 16:42:29 +0200 |
---|---|---|
committer | Kyrylo Silin <silin@kyrylo.org> | 2019-03-02 16:42:29 +0200 |
commit | 86605e5db9656b73acfd1d841ccc0eb364158031 (patch) | |
tree | b9f8c04b824627d49cd7d8b64c1625da7f2218ff /lib/pry/commands | |
parent | f83a26f621f30205c15f8a36856eb130650ae820 (diff) | |
download | pry-86605e5db9656b73acfd1d841ccc0eb364158031.tar.gz |
rubocop: fix offences of the Style/UnneededCondition cop
Diffstat (limited to 'lib/pry/commands')
-rw-r--r-- | lib/pry/commands/show_doc.rb | 4 | ||||
-rw-r--r-- | lib/pry/commands/show_source.rb | 4 | ||||
-rw-r--r-- | lib/pry/commands/stat.rb | 2 |
3 files changed, 3 insertions, 7 deletions
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} |