File: compatibility.rb

package info (click to toggle)
ruby-highline 3.1.2-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 800 kB
  • sloc: ruby: 5,789; sh: 7; makefile: 4
file content (23 lines) | stat: -rw-r--r-- 609 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
# coding: utf-8

unless STDIN.respond_to? :getbyte
  # HighLine adds #getbyte alias to #getc when #getbyte is not available.
  class IO
    # alias to #getc when #getbyte is not available
    alias getbyte getc
  end

  # HighLine adds #getbyte alias to #getc when #getbyte is not available.
  class StringIO
    # alias to #getc when #getbyte is not available
    alias getbyte getc
  end
end

unless "".respond_to? :each_line
  # HighLine adds #each_line alias to #each when each_line is not available.
  class String
    # alias to #each when each_line is not available.
    alias each_line each
  end
end