mirror of
https://github.com/ruby/ruby.git
synced 2025-08-15 13:39:04 +02:00
merge revision(s) 57530: [Backport #13191]
sample/pty/shl.rb: update sample * Specify frozen_string_literal: true. * Fix TypeError of raise. * Use a character literal instead of Integer. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_4@59404 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
873c37ce4f
commit
fffc133db1
2 changed files with 5 additions and 4 deletions
|
@ -1,3 +1,4 @@
|
|||
# frozen_string_literal: true
|
||||
#
|
||||
# old-fashioned 'shl' like program
|
||||
# by A. Ito
|
||||
|
@ -22,15 +23,15 @@ def writer
|
|||
begin
|
||||
while true
|
||||
c = STDIN.getc
|
||||
if c == 26 then # C-z
|
||||
$reader.raise(nil)
|
||||
if c == ?\C-z then
|
||||
$reader.raise('Suspend')
|
||||
return 'Suspend'
|
||||
end
|
||||
$w_pty.print c.chr
|
||||
$w_pty.flush
|
||||
end
|
||||
rescue
|
||||
$reader.raise(nil)
|
||||
$reader.raise('Exit')
|
||||
return 'Exit'
|
||||
ensure
|
||||
STDIN.cooked!
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
#define RUBY_VERSION "2.4.2"
|
||||
#define RUBY_RELEASE_DATE "2017-07-23"
|
||||
#define RUBY_PATCHLEVEL 155
|
||||
#define RUBY_PATCHLEVEL 156
|
||||
|
||||
#define RUBY_RELEASE_YEAR 2017
|
||||
#define RUBY_RELEASE_MONTH 7
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue