summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKyrylo Silin <silin@kyrylo.org>2018-10-28 04:53:05 +0800
committerKyrylo Silin <silin@kyrylo.org>2018-10-28 04:58:09 +0800
commit69090ca349bad0b7713372a771dac256e677aa57 (patch)
treec511cdc1dde0abd9f65187c0667b1a7a9ae0e54f
parenteb9246d5330a9bb6b04d93c90099d95dd6f21106 (diff)
downloadpry-69090ca349bad0b7713372a771dac256e677aa57.tar.gz
pry: move INITIAL_PWD to code/code_file
This constant is not used anywhere else but this file so it makes sense to keep it there.
-rw-r--r--lib/pry.rb4
-rw-r--r--lib/pry/code/code_file.rb6
2 files changed, 5 insertions, 5 deletions
diff --git a/lib/pry.rb b/lib/pry.rb
index 89a456a5..284a6679 100644
--- a/lib/pry.rb
+++ b/lib/pry.rb
@@ -122,10 +122,6 @@ class Pry
end
end
- # Store the current working directory. This allows show-source etc. to work if
- # your process has changed directory since boot. [Issue #675]
- INITIAL_PWD = Dir.pwd
-
# This is to keep from breaking under Rails 3.2 for people who are doing that
# IRB = Pry thing.
module ExtendCommandBundle; end
diff --git a/lib/pry/code/code_file.rb b/lib/pry/code/code_file.rb
index 5a306a3b..ae701c31 100644
--- a/lib/pry/code/code_file.rb
+++ b/lib/pry/code/code_file.rb
@@ -25,6 +25,10 @@ class Pry
%w(Gemfile Rakefile Guardfile Capfile) => :ruby
}
+ # Store the current working directory. This allows show-source etc. to work if
+ # your process has changed directory since boot. [Issue #675]
+ INITIAL_PWD = Dir.pwd
+
# @return [Symbol] The type of code stored in this wrapper.
attr_reader :code_type
@@ -95,7 +99,7 @@ class Pry
# @return [String]
def from_pry_init_pwd
- File.expand_path(@filename, Pry::INITIAL_PWD)
+ File.expand_path(@filename, INITIAL_PWD)
end
# @return [String]