mirror of
https://github.com/ruby/ruby.git
synced 2025-09-15 16:44:01 +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
|
# old-fashioned 'shl' like program
|
||||||
# by A. Ito
|
# by A. Ito
|
||||||
|
@ -22,15 +23,15 @@ def writer
|
||||||
begin
|
begin
|
||||||
while true
|
while true
|
||||||
c = STDIN.getc
|
c = STDIN.getc
|
||||||
if c == 26 then # C-z
|
if c == ?\C-z then
|
||||||
$reader.raise(nil)
|
$reader.raise('Suspend')
|
||||||
return 'Suspend'
|
return 'Suspend'
|
||||||
end
|
end
|
||||||
$w_pty.print c.chr
|
$w_pty.print c.chr
|
||||||
$w_pty.flush
|
$w_pty.flush
|
||||||
end
|
end
|
||||||
rescue
|
rescue
|
||||||
$reader.raise(nil)
|
$reader.raise('Exit')
|
||||||
return 'Exit'
|
return 'Exit'
|
||||||
ensure
|
ensure
|
||||||
STDIN.cooked!
|
STDIN.cooked!
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#define RUBY_VERSION "2.4.2"
|
#define RUBY_VERSION "2.4.2"
|
||||||
#define RUBY_RELEASE_DATE "2017-07-23"
|
#define RUBY_RELEASE_DATE "2017-07-23"
|
||||||
#define RUBY_PATCHLEVEL 155
|
#define RUBY_PATCHLEVEL 156
|
||||||
|
|
||||||
#define RUBY_RELEASE_YEAR 2017
|
#define RUBY_RELEASE_YEAR 2017
|
||||||
#define RUBY_RELEASE_MONTH 7
|
#define RUBY_RELEASE_MONTH 7
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue