diff options
author | Kyrylo Silin <silin@kyrylo.org> | 2019-03-10 01:35:36 +0200 |
---|---|---|
committer | Kyrylo Silin <silin@kyrylo.org> | 2019-03-10 13:20:03 +0200 |
commit | edaa1383f2b27acee54b058f501527a0b1b941c0 (patch) | |
tree | e081a0296da9da1f1079b43bd23ffcd64d2bb60c /lib/pry/code | |
parent | 03b7446d01a22bf95e462575f463eda082769141 (diff) | |
download | pry-edaa1383f2b27acee54b058f501527a0b1b941c0.tar.gz |
Require files from pry.rb; deps from each file that uses them
This change brings some order to how we require files. Previously, we required
app files from everywhere, including pry.rb. Now we require app files only from
pry.rb.
External and stdlib dependencies are required at places where they're used, not
globally.
Diffstat (limited to 'lib/pry/code')
-rw-r--r-- | lib/pry/code/code_file.rb | 2 | ||||
-rw-r--r-- | lib/pry/code/code_range.rb | 2 | ||||
-rw-r--r-- | lib/pry/code/loc.rb | 2 |
3 files changed, 6 insertions, 0 deletions
diff --git a/lib/pry/code/code_file.rb b/lib/pry/code/code_file.rb index 5464183a..7ac6ef0e 100644 --- a/lib/pry/code/code_file.rb +++ b/lib/pry/code/code_file.rb @@ -1,3 +1,5 @@ +require 'method_source' + class Pry class CodeFile DEFAULT_EXT = '.rb'.freeze diff --git a/lib/pry/code/code_range.rb b/lib/pry/code/code_range.rb index a28bdedb..51d32a2e 100644 --- a/lib/pry/code/code_range.rb +++ b/lib/pry/code/code_range.rb @@ -1,3 +1,5 @@ +require 'coderay' + class Pry class Code # Represents a range of lines in a code listing. diff --git a/lib/pry/code/loc.rb b/lib/pry/code/loc.rb index 4cc07063..5ec4ed87 100644 --- a/lib/pry/code/loc.rb +++ b/lib/pry/code/loc.rb @@ -1,3 +1,5 @@ +require 'coderay' + class Pry class Code # Represents a line of code (which may, in fact, contain multiple lines if |