Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

Ruby 1.9.3 の新機能と変更点

16,320 views

Published on

Ruby 1.9.3 の新機能と変更点について、2011年7月2日時点での NEWS をベースに解説しました。

Published in: Technology, Education
  • 35枚目
    diagonal?の間違いかな、diagnoal?になってる
       Reply 
    Are you sure you want to  Yes  No
    Your message goes here

Ruby 1.9.3 の新機能と変更点

  1. 1. Ruby 1.9.3 Kenta Murata2011 7 3 1
  2. 2. 2011 7 3 2
  3. 3. 20112010 7 3 3 1 3
  4. 4. Ruby 1.9.3 Kenta Murata2011 7 3 4
  5. 5. • ruby NEWS ( )2011 7 3 5
  6. 6. • NEWS • ruby_1_9_3 NEWS2011 7 3 6
  7. 7. ! WNE ARGF.read_nonblock • ARGF.read_nonblock(maxlen) • ARGF.read_nonblock(maxlen, outbuf)2011 7 3 7
  8. 8. ! WNE ARGF.to_write_io • IO • IOError2011 7 3 8
  9. 9. ! WNE ARGF.write • ARGF.write(str) • str ARGF.to_write_io.write(str)2011 7 3 9
  10. 10. ! WNE ARGF • ARGF.print • ARGF.printf • ARGF.putc • ARGF.puts • IO ARGF.write2011 7 3 10
  11. 11. ! Array#pack, WNE String#unpack • ‘<’ ‘>’ S>, L>, Q>, s>, l>, q>, ‘>’ S!>, L!>, Q!>, s!>, l!>, q!> S<, L<, Q<, s<, l<, q<, ‘<’ S!<, L!<, Q!<, s!<, l!<, q!<2011 7 3 11
  12. 12. ! ed ov pr BignumIm • 1,500 ( 150 ) (Toom-3)2011 7 3 12
  13. 13. ! WNE • CP950 (Big5) • CP951 (BIg5HKSCS) • UTF-16 • UTF-322011 7 3 13
  14. 14. ! ed ng aCh • SJIS Windows-31J • 1.9.2 Shift_JIS2011 7 3 14
  15. 15. ! WNE File::NULL • NULL • UNIX “/dev/null” • Windows “NUL”2011 7 3 15
  16. 16. ! ed ov pr IO#putcIm • • putc “ ” !2011 7 3 16
  17. 17. ! WNE IO#advise • IO#advise(advise, offset=0, len=0) • posix_fadvise(2) OS • posix_fadvise(2)2011 7 3 17
  18. 18. ! WNE IO.write • IO.write(name, string, offset=0, opts={}) • name string offset opts • IO.read2011 7 3 18
  19. 19. ! WNE IO.binwrite • IO.binwrite(name, string, offset=0, opts={}) • IO.write • “wb:ASCII-8BIT”2011 7 3 19
  20. 20. ! ed ng BasicObject#__id__ aCh • Object BasicObject • [ruby-dev:42778]2011 7 3 20
  21. 21. ! ed Kernel#rand, ov prIm Random.rand • Kernel#rand(range) • Random.rand(range) • OK • [ruby-dev:43427], #46052011 7 3 21
  22. 22. ! W Module#private_constant,NE Module#public_constant • •2011 7 3 22
  23. 23. ! WNE String#prepend • String#prepend(str) • str • recv[0,0] = str ( )2011 7 3 23
  24. 24. ! WNE String#byteslice • String#byteslice(n) • String#byteslice(beg, end) • String#slice •2011 7 3 24
  25. 25. ! ed ov pr Time#strftimeIm • • %:z %H:%M • %::z %H:%M:%S2011 7 3 25
  26. 26. ! Process#maxgroups, WNE Process#maxgroups •2011 7 3 26
  27. 27. ! ed ov BigDecimal.new, prIm Kernel#BigDecimal • Integer Rational Float • Rational Float 22011 7 3 27
  28. 28. ! ed ov pr BigDecimal#coerceIm • Rational BigDecimal coerce BigDecimal • 1.9.2 Rational Float2011 7 3 28
  29. 29. ! ed BigMath.exp, ng aCh BigMath.log • bigdecimal/math bigdecimal •C2011 7 3 29
  30. 30. ! ed ov pr BigDecimal#**Im • BigDecimal ( )2011 7 3 30
  31. 31. ! ed ov pr DateTimeIm • DateTime.new Float Rational •2011 7 3 31
  32. 32. ! ed ov DateTime#+, prIm DateTime#- • DateTime Float • Float2011 7 3 32
  33. 33. date • • strftime (Time#strftime ) • inspect • marshal2011 7 3 33
  34. 34. ! WNE io/console • IO#noecho {|io} ... } • IO#echo= • IO#echo? • IO#raw {|io| ... } • IO#raw! • IO#getch • IO#winsize • IO.console2011 7 3 34
  35. 35. ! WNE Matrix • Matrix#diagnoal? -- • Matrix#hermitian? -- • Matrix#normal? -- • Matrix#orthogonal? -- • Matrix#permutation? -- • Matrix#symmetric? -- • Matrix#unitary? -- • Matrix#zero? --2011 7 3 35
  36. 36. ! Matrix#eigen, WNE Matrix#eigensystem • • v, d, v_inv = matrix.eigen • v, v_inv : • d: • (v * d * v_inv).round(5) == matrix2011 7 3 36
  37. 37. ! W Matrix#lupNE Matrix#lup_decomposition • LUP • l, u, p = matrix.lup2011 7 3 37
  38. 38. ! WNE Matrix#round • Matrix#round(n=0) • n2011 7 3 38
  39. 39. ! WNE Vector#magnitude •2011 7 3 39
  40. 40. Matrix#each, Matrix#each_with_index • Matrix#each(mode=:all) • each :all :diagonal :off_diagonal :lower :strict_lower :strict_upper :upper2011 7 3 40
  41. 41. :all   0 0 0 0 0 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 02011 7 3 41
  42. 42. :diagonal   0 0 0 0 0 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 02011 7 3 42
  43. 43. :off_diagonal   0 0 0 0 0 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 02011 7 3 43
  44. 44. :lower   0 0 0 0 0 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 02011 7 3 44
  45. 45. :strict_lower   0 0 0 0 0 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 02011 7 3 45
  46. 46. :strict_upper   0 0 0 0 0 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 02011 7 3 46
  47. 47. :upper   0 0 0 0 0 0 0 0 0 0  0 0 0 0 0  0 0 0 0 0 0 0 0 0 02011 7 3 47
  48. 48. ! ed Matrix#find_index, ov prIm Matrix#index • Matrix#index(val, selector=:all) • val [row, column] • Matrix#index(selector=:all) {|val| ... } • • Matrix#index(selector=:all) • Enumerator2011 7 3 48
  49. 49. ! ed ov pr Matrix.zeroIm • Matrix.zero(row_size, col_size=row_size) •2011 7 3 49
  50. 50. ! ed ov pr net/httpIm • Server Name Indication ( ) • 100 continue ( ) • Net::HTTPRequest#set_form application/x-www-form-urlencoded multipart/form-data2011 7 3 50
  51. 51. ! ed ov pr webrickIm • WEBrick::HTTPRequest#continue 100 continue • “%{remote}p”2011 7 3 51
  52. 52. ! ed ov pr opensslIm •2011 7 3 52
  53. 53. ! ed ov pr optparseIm • bash zsh l2011 7 3 53
  54. 54. ! ed ov pr RakeIm • 0.9.2.1 • 1.9.2 0.8.72011 7 3 54
  55. 55. ! ed ov pr RDocIm • 3.8 • 1.9.2 2.5.82011 7 3 55
  56. 56. ! ed ov pr rexmlIm • iconv Ruby • Document#encoding XMLDecl#encoding Output#encoding Source#encoding Encoding2011 7 3 56
  57. 57. ! ed ov pr RubygemsIm • 1.5.02011 7 3 57
  58. 58. ! ed ov pr stringioIm • StringIO#set_encoding (IO#set_encoding ) •2011 7 3 58
  59. 59. ! ed ov pr test/unitIm • •2011 7 3 59
  60. 60. ! ed ov pr uriIm • URI::Generic#hostname URI::Generic#hostname=2011 7 3 60
  61. 61. ! ed ng yaml aCh • YAML Psych • syck : YAML::ENGINE.yamler = ‘syck’2011 7 3 61
  62. 62. ! ed ov pr zlibIm • Zlib::Deflate.deflate Zlib.deflate • Zlib::Inflate.inflate Zlib.inflate2011 7 3 62
  63. 63. ! ed ov pr fileutilsIm • FileUtils.chmod chmod(1) • : FileUtils.chmod “u=wrx,go=rx”, filename2011 7 3 63
  64. 64. ! ed ov prIm • Regexp Unicode 6.0 • Regexp Unicode Age • warn-indent: true ) -*- warn-indent: true -*- ) -*- warn-indent: false -*-2011 7 3 64
  65. 65. • NEWS • Ruby 1.9.32011 7 3 65

×