<lopex> headius: are there any tests against grapheme clusters failing ?
<lopex> skimming through name2ctype.h
<lopex> headius: also, I guess we dont need gperf they use
https_GK1wmSU has joined #jruby
https_GK1wmSU has left #jruby [#jruby]
prasun has joined #jruby
hays_ has joined #jruby
hays_ has joined #jruby
hays has quit [Ping timeout: 260 seconds]
swills has quit [Ping timeout: 260 seconds]
swills has joined #jruby
prasun has quit [Ping timeout: 268 seconds]
https_GK1wmSU has joined #jruby
https_GK1wmSU has left #jruby [#jruby]
drbobbeaty has joined #jruby
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
vtunka has joined #jruby
drbobbeaty has joined #jruby
bbrowning_away is now known as bbrowning
vtunka has quit [Quit: Leaving]
vtunka has joined #jruby
rdubya has joined #jruby
<rdubya> Is there a way to check if an IRubyObject is an instance of a certain Ruby class? I have it working using `callMethod` to call `is_a?` but wondered if there was a cleaner way to do it. Here's a gist with an example: https://gist.github.com/rdubya/3dfabdc73605a0e693a97a8f2d1ca8d9
lance|afk is now known as lanceball
<rdubya> just found the isInstance method on RubyModule, is that the best way to do it? Updated the gist
vtunka has quit [Quit: Leaving]
vtunka has joined #jruby
<GitHub85> [jruby] RobertFischer opened issue #4732: Error executing `elm-install` from `elm_install` gem https://git.io/v7uwG
joast has quit [Ping timeout: 246 seconds]
<kares> rdubya: if its a user class than isIntance otherwise for core classes you could a `obj instanceof RubyArray`
joast has joined #jruby
ratnikov_ has quit [Ping timeout: 246 seconds]
vtunka has quit [Quit: Leaving]
ratnikov_ has joined #jruby
<rdubya> kares: cool thanks
<enebo> rdubya: you can also safely use TypeConverter methods if you want it to be the actual type as well or die trying (e.g. many will raise TypeError if it is not what you expect it to be). Although that is usually for check + optional coercion + actual casting
<rdubya> enenbo: thanks for the info, I'll keep that in mind for those situations. In this case I'm just checking to see if it is that type so I think the isInstance is probably the right way to go
<rdubya> actually, since you are both here, the reason I'm doing this is to update the prepared statement binding to work with activerecord's newer way of passing in Attribute objects instead of the columns
<rdubya> it looks like it currently supports passing in different formats of bind parameters, do you think we need to keep that around?
<enebo> rdubya: as an extension of what kares says you really only want isInstance if something is extending an Array if it is expected to be a literal Array than obj instanceof RubyArray is much cheaper
<enebo> oh heh...sorry it is OID::Array
<rdubya> I need to keep a reference to the Attribute object because for some instances we'll want the original value (in the case of a postgres array) where others we'll want the typecasted value
<rdubya> enebo: yeah lol
<enebo> rdubya: you mean our Java code accepts multiple types of binding right?
<rdubya> currently it's converting the array to the string representation and when we call "connection.createArrayOf" it errors out because it is expecting an array instead of a string
<rdubya> multiple formats for the binding array
<enebo> rdubya: honestly I recall sqlite only using a single form from Rails but I do not remember if Rails is only capable of one format now
<enebo> rdubya: but we do not plan on pre-5 support at all so if Rails only has one format then we do not need multiple formats
<enebo> rdubya: although it may cause additional breakage on other adapters but at this point I assume all other adapters are broken and sqlite did not overlap javawise with postgresql at all from what I could see
<rdubya> enebo: sounds good, I'll verify that there is only one way that it comes in
<rdubya> enebo: yeah, i think all the adapters other than SQLite break if you turn on prepared statements
<enebo> rdubya: another idea I was discussing with kares the other day was to make annotations for each adapter type and marking up the java methods in the core class which was used by which adapter
<rdubya> enebo: unfortunately, activerecords new statement caching implementation only seems to work if prepared statements are enabled and there are tests that assume it is on :(
<enebo> rdubya: yeah I guess I ran into that with sqlite
<enebo> we could run many local tests but rails itself was totally borked
<enebo> The annotation idea was more around knowing if changing the java method would affect other adapters since enough impl is in Ruby and we have no easy way to trace which adapters use what
<enebo> It has the downside that it requires keeping the annos up to date...but documenting things are like that
<rdubya> that makes sense, I was also wondering about moving more of the adapter specific stuff to the adapter specific java classes
<enebo> rdubya: ah yeah you hit on something else kares and I chatted about
<enebo> rdubya: originally a goal of ar-jdbc was to sort of just work if you specified jdbc as the adapter name
<enebo> rdubya: so this generic support jammed a bunch of stuff to the common class
<enebo> rdubya: we decided this generic support is not worth supporting so if only one adapter uses a method I say put it into the specific class for that adapter
<enebo> My main disappointment when I went through sqlite was how different the postgresql adapter was (on AR side).
<rdubya> enebo: cool, is the goal going forward to make it so that ar-jdbc releases line up with rails releases? So for example ar-jdbc 2.0 is compatible with ActiveRecord 5.0 (or whatever versioning scheme makes sense)?
<enebo> rdubya: that is my personal hope but I am not sure if I have concensus or not
<rdubya> yeah seems like every adapter has some big differences in it
<enebo> It means having multiple branches for releases but if it is only for security patching maybe just cp'ing those across a few release branches is not a big maintenance concern
<enebo> At this point for sure we can eliminate pre-5 and push out something which works for current Rails 5 and then maybe have a better idea in how realistic that is
<enebo> I personally would say each Rails release is a new branch on ar-jdbc and we only ever go back for security or a massive plea that a bug needs a release
<rdubya> yeah it seems like that would help clean up the code quite a bit and allow us to target specific test suites to run against for each branch
<enebo> rdubya: then we just follow what rails does on those branches sans any internal mess ups we make
<rdubya> part of my struggle at the beginning when trying to get into it was figuring out how the tests were run and what tests should even be running since there were so many conditional things
<enebo> I guess the other part of this would be a one button release process since it might mean rolling out a number of releases
<enebo> rdubya: oh yeah I was wondering did you use that rake task I added?
<enebo> jrake rails:test:sqlite3:base_test
<enebo> I guess for you it would be rails:test:postgresl:base_test
<enebo> it only runs that one main AR test in a parallel checked out Rails
<rdubya> enebo: I've been running rake postgres_test for local tests and rake rails:test:postgres RAILS=~/repos/rails for the activerecord tests
<enebo> ah ok yeah that is the same set of tasks
<enebo> you are beyond just running the base one at this point no doubt
<rdubya> enebo: it's been a bit of a pain though because for some reason if I try to use pry when running the activerecord suite, it locks up my terminal
<enebo> rdubya: hmm
<rdubya> enebo: when running the ar-jdbc tests it works fine
<enebo> weird maybe ctrl-\ to dump java stacks
<rdubya> i have to ctrl-c the process but the terminal stops responding to keyboard input after that and i have to restart the terminal
<rdubya> i'll give that a shot
<rdubya> what tools do you usually use to debug the java code in the adapter? I've been resorting to debugMessage or throwing exceptions since I wasn't sure how to get a debugger at that level, at least not when running through the rake tasks
rawra has joined #jruby
<enebo> rdubya: I generally do just use puts/println but with idea/intellij or netbeans you can attach to a process and step through
<enebo> ah crud I see no directions on our wiki for this
<enebo> This shows how you can do debugging of JRuby itself as an application but this is complicated when you use stuff which respawns new runtimes
<rdubya> ok, at least I wasn't missing something obvious :) thanks for the reference I'll take a look at that
<enebo> rdubya: in the debug windows there is usually a wait for a port option
<enebo> rdubya: I do not remember the mojo on the command-line but you can set up a debug port on any java process and then you just need to have a break point set that gets hit once the connection is made
<rdubya> enebo: cool, that would definitely speed things up if I can get it working
<enebo> rdubya: when I go this route and cannot get it to start from where I want I usually just throw a gets somewhere early
<enebo> then it connects while blocked there and I hit return to move on
<rdubya> enebo: cool, thanks for all the info
<enebo> rdubya: thanks for working on this stuff too! :)
shellac has quit [Quit: Leaving]
rawra has quit [Ping timeout: 260 seconds]
subbu is now known as subbu|lunch
subbu|lunch is now known as subbu
<GitHub2> [jruby] headius pushed 5 new commits to ruby-2.4: https://git.io/v7z8e
<GitHub2> jruby/ruby-2.4 ba2c11b Charles Oliver Nutter: Fix passing fd => fd options to spawn and friends....
<GitHub2> jruby/ruby-2.4 0fcea87 Charles Oliver Nutter: Tag StringIO specs we won't try to fix now....
<GitHub2> jruby/ruby-2.4 d5e67cb Charles Oliver Nutter: Guard against too-large offsets here....
rawra has joined #jruby
rawra has quit [Quit: Leaving...]
bbrowning is now known as bbrowning_away
zacts has joined #jruby
knu has quit [Ping timeout: 240 seconds]
https_GK1wmSU has joined #jruby
robin_ has joined #jruby
robin_ has quit [Client Quit]
https_GK1wmSU has left #jruby [#jruby]
knu has joined #jruby
drbobbeaty has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rdubya has quit [Quit: Leaving.]
bbrowning_away is now known as bbrowning
https_GK1wmSU has joined #jruby
https_GK1wmSU has left #jruby [#jruby]