summaryrefslogtreecommitdiff
path: root/.gitignore
diff options
context:
space:
mode:
authorYorick Peterse <yorickpeterse@gmail.com>2011-10-05 19:04:44 +0200
committerYorick Peterse <yorickpeterse@gmail.com>2011-10-05 19:04:44 +0200
commite9c2f383eb6a9e3a4134f51f60ddf9c29d6ce165 (patch)
tree09e61fa0e8e8e04f5d47ad9b621b022b46f34189 /.gitignore
parentddb51d5b382801e8046c8842bfaf8acadeb69dc1 (diff)
downloadpry-e9c2f383eb6a9e3a4134f51f60ddf9c29d6ce165.tar.gz
Pry now indents code similar to IRB.
Code is indented using the class Pry::Indent. This class uses an internal stack that contains the indentation levels for each line of code. Certain keywords such as "class" or "def" will add data to this stack so that the next line is indented, other keywords such as "end" or "}" will remove data from the stack, causing the next line to be un-indented. Pry::Indent is hooked into Pry#retrieve_line as well as Pry#readline. This means that both input strings as well as the ones displayed by "show-method" are indented. Sadly due to the way Readline works input strings are indented similar to IRB. This means that instead of the following: > class User > def initialize > end > end You'll get the following: > class User > def initialize > end > end While annoying there doesn't seem to be a way to work around this issue. Luckily the "show-method" command indents your code properly. By default indentation is turned on. This can be turned off (or back on) using the configuration item Pry.config.indent. However, if you turn this option off after a method is defined "show-method" will still show it with indentation as indentation happens on input rather than only when code is displayed. For more information see Pry::Indent#indent in lib/pry/indent.rb. Signed-off-by: Yorick Peterse <yorickpeterse@gmail.com>
Diffstat (limited to '.gitignore')
-rw-r--r--.gitignore5
1 files changed, 5 insertions, 0 deletions
diff --git a/.gitignore b/.gitignore
index d0b8649e..b4777dcf 100644
--- a/.gitignore
+++ b/.gitignore
@@ -8,3 +8,8 @@ pkg/
coverage/
.yardoc/
/tags
+
+# Not sure if Pry devs use RVM or want the Gemfile.lock in the repo, thus I'm
+# ignoring them for now.
+.rvmrc
+Gemfile.lock