Giter VIP home page Giter VIP logo

Comments (9)

azumakuniyuki avatar azumakuniyuki commented on June 12, 2024 1

I thought I would use Array#append because I planned to use Ruby 2.6 or later in the early development of Sisimai 5, but after many years, I forgot everything and wrote 2.4...
Therefore, I will try to replace Array#append with Array#push today.

from rb-sisimai.

hiroyuki-sato avatar hiroyuki-sato commented on June 12, 2024 1

JFYI: And Ruby 2.7 already EOL
https://www.ruby-lang.org/ja/downloads/branches/

from rb-sisimai.

hiroyuki-sato avatar hiroyuki-sato commented on June 12, 2024

JRuby itself supports append method.

java -jar jruby-complete-9.4.6.0.jar -S irb
irb(main):001:0> a = []
=> []
irb(main):002:0> a.append("a")
=> ["a"]

from rb-sisimai.

azumakuniyuki avatar azumakuniyuki commented on June 12, 2024

@hiroyuki-sato Thank you for checking. However, at least JRuby 9.1 does not have Array#append as follows:

jruby 9.1.17.0 (2.3.3) 2018-04-20 d8b1ff9 Java HotSpot(TM) 64-Bit Server VM 11.0.5+10-LTS on 11.0.5+10-LTS +jit [darwin-x86_64]

irb(main):001:0> v = []
=> []
irb(main):002:0> v.append("neko")
NoMethodError: undefined method `append' for []:Array
	from (irb):2:in `<eval>'
	from org/jruby/RubyKernel.java:995:in `eval'
	from org/jruby/RubyKernel.java:1316:in `loop'
	from org/jruby/RubyKernel.java:1138:in `catch'
	from org/jruby/RubyKernel.java:1138:in `catch'
	from /usr/local/jr/bin/irb:13:in `<main>'

from rb-sisimai.

hiroyuki-sato avatar hiroyuki-sato commented on June 12, 2024

@azumakuniyuki

JRuby 9.1.x.x is compatible with Ruby 2.3. Array#append was introduced in MRI 2.5
https://docs.ruby-lang.org/en/3.2/NEWS/NEWS-2_5_0.html
https://bugs.ruby-lang.org/issues/12746

You can use push instead.

java -jar ~/.embulk/jars/jruby-complete-9.1.15.0.jar -S irb --readline
irb(main):001:0> JRUBY_VERSION
=> "9.1.15.0"
irb(main):002:0> RUBY_VERSION
=> "2.3.3"
irb(main):003:0> a = []
=> []
irb(main):004:0> a.push("a")
=> ["a"]

from rb-sisimai.

azumakuniyuki avatar azumakuniyuki commented on June 12, 2024

@hiroyuki-sato Thank you for the announce of push method. I've decided that Sisimai 5 requires JRuby 9.2 or later because Sisimai 5 requires Ruby 2.4 or later.

irb(main):004:0> JRUBY_VERSION
=> "9.2.21.0"
irb(main):005:0> RUBY_VERSION
=> "2.5.8"
irb(main):006:0> p=[]; p.append("neko")
=> ["neko"]

from rb-sisimai.

hiroyuki-sato avatar hiroyuki-sato commented on June 12, 2024

I've decided that Sisimai 5 requires JRuby 9.2 or later because Sisimai 5 requires Ruby 2.4 or later.

Off topic. It seems that append was introduced in Ruby 2.5. Sisimai supports Ruby 2.4? (Maybe there is no Array#append method in Ruby 2.4)

from rb-sisimai.

azumakuniyuki avatar azumakuniyuki commented on June 12, 2024

!

from rb-sisimai.

azumakuniyuki avatar azumakuniyuki commented on June 12, 2024

This issue resolved at v5.0.2

from rb-sisimai.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.