Commit Graph

3 Commits

Author SHA1 Message Date
☈king 9d20a96613 Add Pry::Terminal.height! (only used once) 2013-02-07 21:30:20 -06:00
Kyrylo Silin d331ded410 Terminal: don't let Readline return [0, 0]
Some of the tests from "spec/commands/ls_spec.rb" were failing on
Rubinius and 1.9.2. The problems was introduced by this commit:

  (Tweak and Refactor Pry::Terminal)
  fc522f837a

The problem is that `Readline.get_screen_size` can return `[0, 0]`.
That's not good, because it breaks a couple of our tests (table output
stuff). But now...

          .o( ...it is fixed. Twit-twoo! )
    \{0,0}/
2013-02-04 17:29:09 +02:00
☈king fc522f837a Tweak and Refactor Pry::Terminal
The biggest behavior change is to favor `io/console` (but still not when
on jruby). The previous favorite was `Readline.get_screen_size`, but
that thing is stale just like the env. The only reason it gets updated
is if you put `Pry.auto_resize!` in your `~/.pryrc`

The next change is more error handling in `Pry.auto_resize!`

Otherwise I renamed `TerminalInfo` to `Terminal`, which is something
andrewvos and I discussed way back when `TerminalInfo` first came about.

The rest was a little Extract Method stuff, no biggie.
2013-01-30 21:48:12 -06:00