summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/pry/basic_object.rb2
-rw-r--r--lib/pry/commands/ls/constants.rb4
-rw-r--r--lib/pry/commands/watch_expression.rb2
-rw-r--r--lib/pry/indent.rb12
-rw-r--r--lib/pry/input_completer.rb2
-rw-r--r--lib/pry/wrapped_module/candidate.rb6
6 files changed, 14 insertions, 14 deletions
diff --git a/lib/pry/basic_object.rb b/lib/pry/basic_object.rb
index 73e58eba..fca81d86 100644
--- a/lib/pry/basic_object.rb
+++ b/lib/pry/basic_object.rb
@@ -2,7 +2,7 @@
class Pry
class BasicObject < BasicObject
- [:Kernel, :File, :Dir, :LoadError, :ENV, :Pry].each do |constant|
+ %i[Kernel File Dir LoadError ENV Pry].each do |constant|
const_set constant, ::Object.const_get(constant)
end
include Kernel
diff --git a/lib/pry/commands/ls/constants.rb b/lib/pry/commands/ls/constants.rb
index c0f50458..b70a12df 100644
--- a/lib/pry/commands/ls/constants.rb
+++ b/lib/pry/commands/ls/constants.rb
@@ -4,8 +4,8 @@ class Pry
class Command
class Ls < Pry::ClassCommand
class Constants < Pry::Command::Ls::Formatter
- DEPRECATED_CONSTANTS = [
- :Data, :Fixnum, :Bignum, :TimeoutError, :NIL, :FALSE, :TRUE
+ DEPRECATED_CONSTANTS = %i[
+ Data Fixnum Bignum TimeoutError NIL FALSE TRUE
].tap do |constants|
constants << :JavaPackageModuleTemplate if Helpers::Platform.jruby?
end
diff --git a/lib/pry/commands/watch_expression.rb b/lib/pry/commands/watch_expression.rb
index f732a53f..3bdb3998 100644
--- a/lib/pry/commands/watch_expression.rb
+++ b/lib/pry/commands/watch_expression.rb
@@ -96,7 +96,7 @@ class Pry
end
def add_hook
- hook = [:after_eval, :watch_expression]
+ hook = %i[after_eval watch_expression]
return if pry_instance.hooks.hook_exists?(*hook)
pry_instance.hooks.add_hook(*hook) do |_, pry_instance|
diff --git a/lib/pry/indent.rb b/lib/pry/indent.rb
index 2d19d87e..7ef284a7 100644
--- a/lib/pry/indent.rb
+++ b/lib/pry/indent.rb
@@ -57,8 +57,8 @@ class Pry
#
# :pre_constant and :preserved_constant are the CodeRay 0.9.8 and 1.0.0
# classifications of "true", "false", and "nil".
- IGNORE_TOKENS = [:space, :content, :string, :method, :ident,
- :constant, :pre_constant, :predefined_constant].freeze
+ IGNORE_TOKENS = %i[space content string method ident
+ constant pre_constant predefined_constant].freeze
# Tokens that indicate the end of a statement (i.e. that, if they appear
# directly before an "if" indicates that that if applies to the same line,
@@ -66,10 +66,10 @@ class Pry
#
# :reserved and :keywords are the CodeRay 0.9.8 and 1.0.0 respectively
# classifications of "super", "next", "return", etc.
- STATEMENT_END_TOKENS = IGNORE_TOKENS + [:regexp, :integer, :float,
- :keyword, :delimiter, :reserved,
- :instance_variable,
- :class_variable, :global_variable]
+ STATEMENT_END_TOKENS = IGNORE_TOKENS + %i[regexp integer float
+ keyword delimiter reserved
+ instance_variable
+ class_variable global_variable]
# Collection of tokens that should appear dedented even though they
# don't affect the surrounding code.
diff --git a/lib/pry/input_completer.rb b/lib/pry/input_completer.rb
index 9566b32d..3059d4b6 100644
--- a/lib/pry/input_completer.rb
+++ b/lib/pry/input_completer.rb
@@ -270,7 +270,7 @@ class Pry
end
# FIXME: Add Pry here as well?
- [:IRB, :SLex, :RubyLex, :RubyToken].each do |module_name|
+ %i[IRB SLex RubyLex RubyToken].each do |module_name|
next unless Object.const_defined?(module_name)
scanner.call(Object.const_get(module_name))
diff --git a/lib/pry/wrapped_module/candidate.rb b/lib/pry/wrapped_module/candidate.rb
index 7a0c3d66..c333e8e6 100644
--- a/lib/pry/wrapped_module/candidate.rb
+++ b/lib/pry/wrapped_module/candidate.rb
@@ -20,9 +20,9 @@ class Pry
# Methods to delegate to associated `Pry::WrappedModule
# instance`.
- private_delegates = [:lines_for_file, :method_candidates, :yard_docs?, :name]
- public_delegates = [:wrapped, :module?, :class?, :nonblank_name,
- :number_of_candidates]
+ private_delegates = %i[lines_for_file method_candidates yard_docs? name]
+ public_delegates = %i[wrapped module? class? nonblank_name
+ number_of_candidates]
def_delegators :@wrapper, *public_delegates
def_private_delegators :@wrapper, *private_delegates