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:
nagachika 2017-07-23 07:50:10 +00:00
parent 873c37ce4f
commit fffc133db1
2 changed files with 5 additions and 4 deletions

View file

@ -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!

View file

@ -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