kazlock has quit [Quit: This computer has gone to sleep]
AndBobsYourUncle has joined #ruby
nankyokusei has quit [Ping timeout: 276 seconds]
skweek has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
bennofs has quit [Ping timeout: 240 seconds]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
msmith has joined #ruby
JeanCarloMachado has joined #ruby
minimalism has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
unshadow has joined #ruby
istrasci has joined #ruby
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<istrasci>
If I have a property 'a' for a Class, and then I create an alias 'b' with alias_attribute :b, :a , is there any way to find the original property name 'a' given 'b'?
<RickHull>
note, you should use the term attr/attribute/ivar instead of property
<istrasci>
Sorry
boombox_ has joined #ruby
<RickHull>
no worries, just helps for clarity
<RickHull>
i'm not familiar with alias_attribute, but almost certainly there is a way to introspect the alias resolution
JeanCarloMachado has quit [Ping timeout: 255 seconds]
<felltir>
istrasci: in rails, I don't think so. Source code doesn't show anything that'll let you do it after the fact
JeanCarloMachado has joined #ruby
<RickHull>
i can't even begin to imagine how exactly, but I'm pretty sure it's possible based on what e.g. pry is able to do
minimalism has quit [Quit: WeeChat 1.8-dev]
AndBobsYourUncle has joined #ruby
<istrasci>
Well, you can do MyClass.methods. Seems like there should be something similar for attributes.
<Technodrome>
but what i'm saying is, are we apply methods to the eigenclass of Foo or the actual class for Foo ?
<Technodrome>
class Foo def self.speak return self end end
ReK2 has quit [Quit: Konversation terminated!]
<Technodrome>
is self.speak on the actual Foo class? or is it on the Eigenclass of Foo ?
ReK2 has joined #ruby
jenrzzz has quit [Ping timeout: 252 seconds]
kazlock has quit [Quit: This computer has gone to sleep]
<Technodrome>
Foo.new , when this happens, i always thought that instance was spawned, and an eigenclass is created and set as the first thing in the chain of inheritance
<Technodrome>
but from some reading, i think i might be noticing that, Foo.new is not calling the Foo class, but calling Foo's Eigenclass , that then spawns Foo and gets our instance of Foo ?
jshjsh has joined #ruby
Channel6 has quit [Quit: Leaving]
<Technodrome>
any idea there pragmatism ? :)
JoshS has quit [Ping timeout: 240 seconds]
AndBobsYourUncle has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
nankyokusei has joined #ruby
nankyokusei has quit [Ping timeout: 258 seconds]
gix has quit [Ping timeout: 255 seconds]
kht has quit [Ping timeout: 256 seconds]
naprimer_2 has quit [Quit: Leaving]
arescorpio has quit [Quit: Leaving.]
gix has joined #ruby
<RickHull>
is there a gem that will add Hash#dig and other neat stuff to pre ruby 2.3 ?
<RickHull>
yes, i am trying to avoid adding my own compat lib impl for every gem I want to use #dig in
<Nilium>
Though it looks like dig might actually do arrays?
<RickHull>
i think it will do multi dim arrays
<Nilium>
It's definitely implemented for arrays.
<Technodrome>
pragmatism so when you do Foo.new, who is giving us that instance , the singleton class of Foo ? or does Foo make the singleton class of the instance, and then that spawns the instance of the new object we have created ?
<Technodrome>
man, you can get lost in the sauce with the terminology if you are not careful
<RickHull>
also, WTB better idea on handling backwards compat
<Technodrome>
any clue here pragmatism ?
<RickHull>
Technodrome, what are you reading?
<Technodrome>
just trying to figure out the inheritance chain of eigenclasses properly here
<RickHull>
there's a fair amount of good reading material
<Technodrome>
i've read alot, well everything but ruby under a microscope
<Technodrome>
but, i still yet to know the answer to this
<RickHull>
i've understood it at times, but don't put that knowledge into practice enough to keep it from being evicted
<Technodrome>
i understand them pretty well, and all the different ways of accesing them, and what self is , in pretty much every context I see , even some of the less popular ways of accessing it
<Technodrome>
but these last little few details are annoying me RickHull
<RickHull>
write an essay
<RickHull>
for real
<RickHull>
it will clear it up for you
<RickHull>
put it on your blog :)
Coldblackice has joined #ruby
<Technodrome>
RickHull i don't fully understand the tiny details enough to do that yet
<RickHull>
lay out the problem, the ambiguity you're having
<RickHull>
that could take 20 paragraphs
<RickHull>
then in the next post, you can solve it :)
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
weez17_ has joined #ruby
skweek has joined #ruby
<Technodrome>
RickHull how long you been doing ruby ?
<RickHull>
11 years or so
<RickHull>
i remember the 1.8.5 days, and I've used 1.8.3 in anger
Xentil has quit [Ping timeout: 264 seconds]
duckpupp1 has quit [Ping timeout: 248 seconds]
<Nilium>
If I was on pre-2.3 but still 2 I'd just update
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<Nilium>
If I was on 1.8 I'd scream
<Nilium>
1.9 I'd upgrade again
<RickHull>
i had a large 1.8 codebase that did a lot of binary messaging. it relied on the old behavior of string[x] giving an integer code
<Nilium>
I had parsers doing that. Still updated.
weez17_ has quit [Client Quit]
<RickHull>
and many other nits. carried that on 1.8 for a few years to the brink of EOL
<Technodrome>
RickHull ruby is like smalltalk a bit, you can easily use it for 20 years without really knowing it :)
<RickHull>
you mean like, time flies? or ?
tristanp has quit [Remote host closed the connection]
<RickHull>
I've enjoyed ruby's smalltalk heritage, but I haven't given smalltalk much thought in the last 5 years
<adam12>
I wonder how much really changed over the 2.x series.
<RickHull>
remember strongtalk, self, io
<adam12>
(other than dig)
tristanp has joined #ruby
<RickHull>
dig is a nice one. 2.3 also brought RbConfig::SIZEOF
<adam12>
I was just writing some ops stuff for openSUSE Leap, which has 2.1 out of box (with pkgs for 2.2 and 2.3)
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<adam12>
but those packages have suffixed bin names (ruby2.3, etc). Wondering if it's even worth the update.
<RickHull>
with debian at least, i tend to leave the system ruby for the system to use
<RickHull>
and just go with chruby/rbenv/rvm
<adam12>
Yeah - this isn't an app server more so a generic server, so I doubt I'll be using any type of non-distro versioning.
duckpupp1 has joined #ruby
<RickHull>
so in terms of developing your stuff, use a version manager
<RickHull>
and what you pump out should have no trouble running on opensuse ruby 2.1
<RickHull>
(assuming you're testing against 2.1)
<adam12>
Yeah - but I'm more curious about any gains from 2.1 to 2.3. I guess I'll have to look
<adam12>
ie. better GC, lower memory, whatever.
<RickHull>
which is why i'm interested in compatibility library for projects that use newer features
tristanp has quit [Ping timeout: 256 seconds]
weez17_ has joined #ruby
<RickHull>
yeah, code level features are just the tip of the iceberg
<Technodrome>
RickHull do you mostly do rails dev?
<RickHull>
my schedule has opened up, looking for interesting opportunities, remote work is a plus :)
<RickHull>
Technodrome, what's your background?
<Technodrome>
RickHull been programming for a while , started a consulting firm, sold it 2 months ago
<Technodrome>
one sentence for a long story : 0
marcdel has joined #ruby
<RickHull>
heh, right
<RickHull>
what was the impetus to start a firm and how terrifying was it? also #ruby-offtopic
matp has joined #ruby
<adam12>
frozen string literal, safe navigation operator, symbol gc, all post-2.1 ruby. hmm
CloCkWeRX has quit [Ping timeout: 256 seconds]
pilne has quit [Quit: Quitting!]
surfr1 has joined #ruby
matp has quit [Quit: ZZzzzZz...]
naprimer has joined #ruby
pskosinski has quit [Ping timeout: 240 seconds]
duckpupp1 has quit [Ping timeout: 240 seconds]
weez17_ has quit [Quit: Leaving]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
Guest21041 has joined #ruby
skweek has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 240 seconds]
tlahtoani has quit [Quit: Connection closed for inactivity]
Guest21041 has quit [Ping timeout: 260 seconds]
jshjsh is now known as JoshS
hutch34 has joined #ruby
nankyokusei has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
dc4 has joined #ruby
raul782 has joined #ruby
raul782 has quit [Client Quit]
nankyokusei has quit [Ping timeout: 245 seconds]
b0nn has quit [Remote host closed the connection]
b0nn has joined #ruby
sameerynho has quit [Ping timeout: 260 seconds]
govg has quit [Ping timeout: 276 seconds]
ReK2 has quit [Quit: Konversation terminated!]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
acalycine has quit [Quit: bye]
endemic has joined #ruby
browndawg has quit [Quit: Leaving]
ReK2 has joined #ruby
ReK2 has joined #ruby
ReK2 has quit [Changing host]
Lucky_ABA has quit [Read error: Connection reset by peer]
Guest21368 has joined #ruby
ur5us has joined #ruby
ifctj has joined #ruby
Guest21368 has quit [Ping timeout: 240 seconds]
acalycine has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
acalycine has quit [Client Quit]
ur5us has quit [Remote host closed the connection]
slappy161 has quit [Quit: Leaving.]
nofxxxx has joined #ruby
acalycine has joined #ruby
JoshS has quit [Quit: Leaving]
acalycine has quit [Client Quit]
nofxxx has quit [Ping timeout: 258 seconds]
pskosinski_ has joined #ruby
unshadow has quit [Quit: leaving]
saneax-_-|AFK is now known as saneax
pskosinski_ has quit [Ping timeout: 252 seconds]
hahuang65 has quit [Remote host closed the connection]
blackwind_123 has joined #ruby
govg has joined #ruby
Gayathri_ has joined #ruby
djuber` has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
Julianee has joined #ruby
xall has joined #ruby
youch has joined #ruby
pskosinski_ has joined #ruby
Julianee has quit [Remote host closed the connection]
youch has quit [Ping timeout: 256 seconds]
pskosinski_ has quit [Ping timeout: 260 seconds]
Cohedrin_ has quit [Read error: Connection reset by peer]
Cohedrin_ has joined #ruby
ifctj has quit [Ping timeout: 240 seconds]
hogetaro has quit [Quit: Leaving...]
Derperperd has joined #ruby
Derperperd has quit [Ping timeout: 258 seconds]
pskosinski has joined #ruby
pskosinski is now known as Guest65004
hogetaro has joined #ruby
renchan has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
JoshS has joined #ruby
nankyokusei has joined #ruby
ifctj has joined #ruby
Derperperd has joined #ruby
bungoman has joined #ruby
duckpupp1 has joined #ruby
renchan has quit [Remote host closed the connection]
bungoman has quit [Client Quit]
bungoman has joined #ruby
nankyokusei has quit [Ping timeout: 248 seconds]
renchan has joined #ruby
duckpupp1 has quit [Ping timeout: 258 seconds]
ledestin has joined #ruby
renchan has quit [Remote host closed the connection]
ifctj has quit [Ping timeout: 245 seconds]
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
renchan has joined #ruby
matp has joined #ruby
UnknownSoldier has joined #ruby
lxsameer has joined #ruby
saneax is now known as saneax-_-|AFK
Cohedrin_ has joined #ruby
rippa has joined #ruby
Julianee has joined #ruby
vuoto has joined #ruby
hutch34 has joined #ruby
tdy has quit [Read error: Connection reset by peer]
tdy has joined #ruby
Julianee has quit [Ping timeout: 255 seconds]
vuoto has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
saneax-_-|AFK is now known as saneax
renchan has quit [Remote host closed the connection]
renchan has joined #ruby
Devalo has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
harfangk has quit [Ping timeout: 245 seconds]
Devalo has quit [Ping timeout: 252 seconds]
harfangk has joined #ruby
TronSolo has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
BackEndCoder has quit [Excess Flood]
harai_ has quit [Ping timeout: 276 seconds]
TronSolo has left #ruby ["Quit"]
djuber` has quit [Remote host closed the connection]
djuber` has joined #ruby
BackEndCoder has joined #ruby
govg has quit [Ping timeout: 255 seconds]
antgel has joined #ruby
araujo has joined #ruby
davezd has joined #ruby
renchan has quit [Remote host closed the connection]
renchan has joined #ruby
xall has quit [Ping timeout: 252 seconds]
elementaru has joined #ruby
ddffg has joined #ruby
Ishido has joined #ruby
saneax is now known as saneax-_-|AFK
browndawg has joined #ruby
nofxxx has joined #ruby
djuber` has quit [Ping timeout: 252 seconds]
dionysus69 has joined #ruby
CloCkWeRX has joined #ruby
nofxxxx has quit [Ping timeout: 276 seconds]
tockitj has quit [Remote host closed the connection]
toretore has joined #ruby
<dionysus69>
how do I constantly check time? so I am setting a 30 second timeout lets say. I need to know when that 30 seconds is up.
<dionysus69>
I need to check it in a way that I will have multiple timers per application
unshadow has joined #ruby
_main_ has joined #ruby
_main_ has quit [Read error: Connection reset by peer]
__main__ has quit [Read error: Connection reset by peer]
nankyokusei has joined #ruby
_main_ has joined #ruby
harai_ has joined #ruby
_main_ has quit [Max SendQ exceeded]
xall has joined #ruby
hutch34 has joined #ruby
nankyokusei has quit [Ping timeout: 276 seconds]
<RickHull>
check the value of Time.now
<RickHull>
it's quite useful in many contexts
<RickHull>
probably prefer Time.utc (or similar?) to Time.now if you don't want time to backwards (Generally a bad thing) when politicians decide on daylight savings stuffs
<RickHull>
dionysus69, ^^
xall has quit [Ping timeout: 260 seconds]
dasher00 has quit [Ping timeout: 240 seconds]
hutch34 has quit [Ping timeout: 256 seconds]
<apeiros>
sleep(30); puts "Time's up!"
<apeiros>
multiple: Thread.new do sleep(30); … end
AnoHito has quit [Quit: Leaving]
__main__ has joined #ruby
<dionysus69>
wait I dont get that
<dionysus69>
why do i make it sleep 30?
<dionysus69>
is that a conventional way to keep track of time?
ur5us has quit [Remote host closed the connection]
edwinvdg_ has quit [Remote host closed the connection]
RickHull has quit [Quit: Leaving]
ResidentBiscuit has joined #ruby
dasher00 has joined #ruby
<dionysus69>
apeiros ?
<dminuoso>
dionysus69: It uses the native implementation of sleep, so it's the best way to wait for 30s without consuming CPU time.
<dionysus69>
ok thank you dminuoso :) I guess I ll use that along with threads
<dminuoso>
dionysus69: Though generally it's not a good idea, often you want a proper synchronization mechanism.
unshadow has quit [Quit: leaving]
<dionysus69>
and what would that mechanism be? without looping and sleeping for 1 second and checking time each second ? :D
ResidentBiscuit has quit [Ping timeout: 255 seconds]
<dminuoso>
dionysus69: That depends on what you are doing.
ur5us has joined #ruby
xen0fon1 has joined #ruby
<dionysus69>
hmm ok I guess loop do might be sufficient in my scenario.
<dionysus69>
I just want to time n seconds and then send a request to front end
<dminuoso>
Why exactly do you have to wait?
<dionysus69>
well, I am timing a quiz. if professor sets like 300 seconds for the quiz to go on, then student quiz form has to auto submit
<ruby[bot]>
dminuoso: # => "== disasm: #<ISeq:<compiled>@<compiled>>================================\n0000 trace 1 ...check link for more (https://eval.in/726262)
<dminuoso>
Wait, so you go into #ruby and ask whether ruby is worth learning?
* dminuoso
wonders what answer they expected
<elomatreb>
acalycine: gsub doesn't modify its receiver, is that your issue?
Guest65004 has joined #ruby
Guest65004 has quit [Changing host]
Guest65004 has joined #ruby
Guest65004 has quit [Changing host]
<acalycine>
Yes, I think.
<acalycine>
The second output should be the same as the first
<elomatreb>
IIRC there is `gsub!` which does modify its receiver, or you can just assign the result again
<acalycine>
Ah, cool.
xall has joined #ruby
renchan has quit [Remote host closed the connection]
Fernando-Basso has quit [Ping timeout: 240 seconds]
gnufied has quit [Ping timeout: 255 seconds]
renchan has joined #ruby
youch has quit [Ping timeout: 276 seconds]
jessiepuls has quit [Remote host closed the connection]
Guest65004 is now known as pskosinski
gix has quit [Ping timeout: 260 seconds]
alex0ptr has left #ruby [#ruby]
Julianee has joined #ruby
ecuanaso has joined #ruby
marsjaninzmarsa has joined #ruby
lxsameer has joined #ruby
nankyokusei has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gix has joined #ruby
<Technodrome>
Good day
Julianee has quit [Ping timeout: 255 seconds]
JeanCarloMachado has quit [Ping timeout: 255 seconds]
nankyokusei has quit [Ping timeout: 258 seconds]
pskosinski has quit [Remote host closed the connection]
<Technodrome>
I still have to read the C source code, i really want to see how these eigenclasses are generated
dviola has joined #ruby
bmurt has joined #ruby
JeanCarloMachado has joined #ruby
dionysus69 has quit [Remote host closed the connection]
Xentil has joined #ruby
dionysus69 has joined #ruby
<tlahtoani>
Read the Java version :P
browndawg has quit [Quit: Leaving]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
<Technodrome>
tlahtoani Jruby?
<Technodrome>
do you have experience with that?
<ljarvis>
better yet, just accept it as dark magic
<tlahtoani>
I only use JRuby
pskosinski has joined #ruby
pskosinski is now known as Guest6291
ecuanaso has joined #ruby
JeanCarloMachado has quit [Ping timeout: 260 seconds]
bkxd has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
blackmesa has quit [Ping timeout: 255 seconds]
<tlahtoani>
It's nice to be able to drop a jar file into Ruby and use it to speed things up a bit
Guest6291 has quit [Changing host]
Guest6291 has joined #ruby
Guest6291 has joined #ruby
<Technodrome>
tlahtoani so do you have experience with reading the source code for it ?
<Technodrome>
ljarvis do you know how any of that works internally?
<tlahtoani>
Only a bit
<tlahtoani>
A lot of JRuby is written in Ruby
<ljarvis>
Technodrome: I used to, but it's not important to me anymore so I doubt I'd remember much
JeanCarloMachado has quit [Ping timeout: 240 seconds]
<Technodrome>
do you know about how eigenclasses work behind the scenes in C ruby ljarvis ?
JeanCarloMachado has joined #ruby
<dminuoso>
Technodrome: There's nothing magical to them, you can observe their behavior in Ruby directly
<Technodrome>
sure
<Technodrome>
for instance, 'asdfasdf' , this is an instance of the eigenclass for that string object correct?
* ljarvis
throws magic at dminuoso
<Technodrome>
every object is just an instance of its eigenclass
<Technodrome>
i had that reversed i think
<dminuoso>
Technodrome: Let's replace the term eigenclass with singleton class, since that's what Ruby uses internally anyway
<dminuoso>
And no.
<dminuoso>
Technodrome: Singleton classes dont get generated unless needed last I checked.
<dminuoso>
On a theoretical level you are right though.
OTORelic has joined #ruby
<dminuoso>
Though mmm no
<Technodrome>
but usability wise, its the first thing in the inheritance chain, even before the actual object itself ?
<dminuoso>
It's a bit messed to think in terms of "instance of" here
<dminuoso>
Technodrome: No
<dminuoso>
Technodrome: Objects do not belong into inheritance chains
<Technodrome>
inheritance chain is the wrong word
<dminuoso>
Technodrome: only classes can have methods, since a string object itself is not a class, it cannot be in the inheritance chain (we call this ancestory in ruby)
<Technodrome>
call chain or what not , Object.method , the eigenclass is called first, before the instance methods defined on that class
<dminuoso>
its called "ancestors"
<dminuoso>
and the object is not part of it
<dminuoso>
please stop using eigenclass and use singleton class like the rest and ruby :PO
<Technodrome>
i've read a few things on this now, and a few of them says the singleton class is called before the actual object instance from the defined class
<ljarvis>
no no, metaclass
<dminuoso>
that's a shitty way of phrasing it
<Technodrome>
yes i know
despai has quit [Ping timeout: 264 seconds]
<dminuoso>
Technodrome: method dispatch goes like this: take the receiver, and determine its ancestors, and then see if any ancestor responds to that method. conceptually the order is: singleton class, the real class, the real classes parent, etc.
<Technodrome>
but if there is a singleton, thats the first thing that gets called
<dminuoso>
right.
<Technodrome>
yep, for some reason i thought the singleton was after the real class
<dminuoso>
Technodrome: ^- that is a trivial example
mikolaj9 has joined #ruby
OTORelic has joined #ruby
<dminuoso>
(And why it's so useful)
<mikolaj9>
hello, anybody know what is in mrb file?
<Technodrome>
dminuoso i guess the runtime only creates it when it needs it, but its always "there" so to speak
<ljarvis>
mikolaj9: mruby code?
<mikolaj9>
i thinking mrb have header and opcodes
<mikolaj9>
but what is opcodes?
<dminuoso>
Technodrome: Yes
<dminuoso>
mikolaj9: Both CRuby and MRuby use a virtual machine to run code. Ruby code gets compiled to bytecode, which has an opcode representation.
<mikolaj9>
…hm. What is YARV bytecode and what is differents from opcodes?
<dminuoso>
or rather you can use "opcode" and "bytecode" synonymously for this.
<Technodrome>
class Foo class << self , is that the same thing as class << Foo def etc etc
<dminuoso>
Technodrome: class << something; end opens up the singleton class of "something"
<dminuoso>
whatever "something" is
<mikolaj9>
bytecode = opcodes?
<dminuoso>
Technodrome: inside a class self happens to be the class itself, which is why you are opening the singleton class of the class object itself.
<Technodrome>
so are those both the same dminuoso ?
<dminuoso>
Technodrome: Yes.
BackEndCoder has quit [Excess Flood]
<mikolaj9>
ok, what i can read bytecode from mrb file in human readable format?
<Technodrome>
like even internally they are the same right? like its not just acting the same, it actually is the same?
<dminuoso>
Technodrome: Right.
<mikolaj9>
i would like to use codedump_recur()
<dminuoso>
Technodrome: Well, it's possible there may be optimizations that I dont know of
<mikolaj9>
but I dont know what it compiling
<dminuoso>
Technodrome: But it's the same effectively.
BackEndCoder has joined #ruby
<dminuoso>
There should be no observable difference between the two.
<dminuoso>
;-)
johnny56 has quit [Quit: WeeChat 1.4-dev]
<dminuoso>
That is the phrase I should have use.d
<Technodrome>
yeah, in a weird way the more i understand it, ruby doesn't even have class methods, you sorta just hack methods on Foo's singleton class
<dminuoso>
Exactly.
<Technodrome>
so it appears that way
<dminuoso>
Technodrome: Weren't you the guy I recommended Ruby under a Microscope?
Ishido has quit [Ping timeout: 264 seconds]
<Technodrome>
i am dminuoso , and i read some of it, but i got busy, i am going to finish it , i promise
<Technodrome>
but i understand this part decently well now
despai has quit [Ping timeout: 240 seconds]
<mikolaj9>
microscope it too old
JeanCarloMachado has quit [Ping timeout: 248 seconds]
<ljarvis>
mikolaj9: you won't get an answer quicker by spamming the channel. If someone can help then they will, but note that mruby is less known than Ruby so you might be better asking the mruby folks (on the mailing list or github)
<mikolaj9>
ljarvis: I ask this question 4 days ago in github ;-)
<ljarvis>
also there's #mruby apparently
<dminuoso>
Technodrome: An RClass has a klass pointer and a super pointer
<Technodrome>
dminuoso so who is the singletons superclass ?
Ishido has joined #ruby
<dminuoso>
both of which point at RClass objects
<ljarvis>
ok, well that doesn't change the fact that spamming here won't help, mikolaj9
<mikolaj9>
on mruby no answerend me from 2 days (nobody answered about anything)
<mikolaj9>
ljarvis: I'm not spaming
<mikolaj9>
I ask and wayting for good people
despai has quit [Ping timeout: 240 seconds]
<ljarvis>
you waited 2 minutes before asking again, thus spamming. Please wait longer :)
<dminuoso>
Technodrome: look at page 130 of your copy of ruby under a microscope
<dminuoso>
Technodrome: it's very important to not confuse klass with superclass
hutch34 has joined #ruby
<Technodrome>
i read somewhere that a singletons super class is the next superclass's singleton in the inheritance chain
<Technodrome>
but that didn't sound right
<dminuoso>
Technodrome: so each RBasic has a klass pointer, right?
xlegoman has joined #ruby
<Technodrome>
yes
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
a klass pointer must always point at an RClass object, which in turn has a m_tbl filled with methods
<dminuoso>
now even an RClass has such a klass pointer, which would point at its singleton class
<Technodrome>
If we call A’s eigen-class AA, and B’s eigen-class BB. Then we will found that BB.superclass == AA
<Technodrome>
how can a singleton class be the superclass of another singleton?
TomyLobo has quit [Ping timeout: 255 seconds]
<Technodrome>
dminuoso or maybe i'm just reading that line wrong over and over?
dimasg has joined #ruby
Julianee has joined #ruby
<dminuoso>
No, well yes.
<dminuoso>
Man I should make a proper diagram for this.
Lord_of_Life has joined #ruby
<dminuoso>
Ideally even displaying how refined classes play into this
OTORelic has joined #ruby
<Technodrome>
how can a singletons superclass be another singleton
<Technodrome>
see how i'm confused? :(
ta has joined #ruby
grh has joined #ruby
kht has joined #ruby
<Technodrome>
dminuoso help
<Technodrome>
i have this whole concepts down pretty good, except for these last few small details
Julianee has quit [Ping timeout: 255 seconds]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
<dminuoso>
Technodrome: Alright, I did some checking in the Ruby source code.
<Technodrome>
+ 10 skill points
<dminuoso>
Technodrome: So when you add a singleton method on any RObject or RClass, Ruby will then rake your RSomething, and modify its klass pointer to no longer point at its real class, but insert a singleton class instead.
<dminuoso>
That singleton class will then have its superclass set to the original class that was the RSomethings klass
<dminuoso>
And because of this, singleton methods are sort of inheritable
<Technodrome>
yes , i understand that
<dminuoso>
Because they get mixed into the proper inheritance chain
<dminuoso>
Technodrome: So what I said was wrong
ifctj has joined #ruby
<Technodrome>
but in that article he says that, one singleton's superclass is == to another singletons superclass
<Technodrome>
If we call A’s eigen-class AA, and B’s eigen-class BB. Then we will found that BB.superclass == AA
chouhoulis has quit [Remote host closed the connection]
<Technodrome>
how is BB.superclass AA ?
<dminuoso>
uhh that sounds wrong.
<Technodrome>
it would be the real class right?
<dminuoso>
There was a good video with pretty shoot sheets actually
JeanCarloMachado has joined #ruby
<dminuoso>
but I can draw them real quic
<Technodrome>
that one line in that article has made me want to pull my hair out
_aeris_ has joined #ruby
blackmesa has joined #ruby
bkxd has joined #ruby
TomyLobo has joined #ruby
UnknownSoldier has joined #ruby
xall has quit [Read error: Connection reset by peer]
<_aeris_>
hello #ruby !
<_aeris_>
is there any way to mock time for unit test with C extension like openssl ?
frozengeek__ has quit [Quit: frozengeek__]
<Technodrome>
dminuoso because that one line goes against the philosophy that the singleton is inserted , and then going onto the real class
<_aeris_>
I use timecop, but for example, openssl verify cert validity with system time :'(
ohcibi has quit [Read error: Connection reset by peer]
ohcibi has joined #ruby
gix has quit [Ping timeout: 255 seconds]
JeanCarloMachado has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 260 seconds]
<dminuoso>
Technodrome: So assume a code like this:
<dminuoso>
You will get an internal (theoretical model due to the fact that singleton classes are lazily generated) model: http://i.imgur.com/QD5qIIe.png
<dminuoso>
(I simplified greatly and ignored that RClass has further superclasses
<dminuoso>
)
<dminuoso>
In particular because things get a little circular at that point
gix has joined #ruby
agent_white has joined #ruby
nankyokusei has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
No actually this works right there.
grh has quit [Ping timeout: 240 seconds]
<dminuoso>
If we ignore Object/BasicObject for a second.
kazlock has joined #ruby
vnzvg has joined #ruby
<dminuoso>
and kernel, and so on
ecuanaso has joined #ruby
<dminuoso>
Technodrome: In reality the ancestors will first place all singleton classes in the superclass chain
<dminuoso>
I think? Or Im not sure.
<Technodrome>
i still don't get how a singleton superclass 's ancestor is another singleton
<dminuoso>
Technodrome: Then I shall continue drawing this
<Technodrome>
so is that true though?
vnzvg has quit [Client Quit]
nankyokusei has quit [Ping timeout: 252 seconds]
JeanCarloMachado has quit [Ping timeout: 255 seconds]
<Technodrome>
then again, we go up another level, and its still point to a singleton class
kappy has joined #ruby
ferr1 has joined #ruby
<Technodrome>
it almost seems like the superclass of a singleton class, will always be another singleton (by using the superclass method) that is
kht has quit [Changing host]
kht has joined #ruby
JeanCarloMachado has joined #ruby
<Technodrome>
as you said, it might be doing something different than what is actually being done
<dminuoso>
Technodrome: I think Ill map out the exact details of a) method dispatch, and b) how singleton classes fit in so I can make an accurate diagram
<Technodrome>
dminuoso i just got laid off my django / python job , i should be working on that right now :)
<Technodrome>
stupid company hired too many people
grh has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
<dminuoso>
Technodrome: Be glad.
<dminuoso>
Now pick up a real job.
<Technodrome>
i'm going to go for a rails job, rather work in ruby anyways
<dminuoso>
A lot of my work has recently shifted into JavaScript
<dminuoso>
That's not too shabby either.
<dminuoso>
First class functions are fun!
<Technodrome>
yeah i know JS pretty well too , i can do some pretty large node projects and just dive right in
<Technodrome>
but ruby, its so beautiful
<Technodrome>
and its been 5 or 6 years since i've used it for work
<dminuoso>
Think I should get started on elixir
<dminuoso>
Seems like thats how Ruby should have been done.
<Technodrome>
ruby will still have the best employement prospects for me probably
<Technodrome>
but i dread the technical intervies where some ruby guy is going to try and trick me, but he doesn't really know crap about it heh
JeanCarloMachado has quit [Ping timeout: 252 seconds]
JeanCarloMachado has joined #ruby
<dminuoso>
Technodrome: Last guy didn't even pass basic git fu-ery. He displayed a fancy git log on his project with thousands of commits. A while later I had him fix some serious mistake, and he kept staring at the screen for 20s after he typed "git commit" and got a "no changes added to commit"
jonjoe has joined #ruby
<dminuoso>
The following 20 minutes were quite hilarious from where I was sitting.
<dminuoso>
After which he just closed the terminal and the conversation went on.
<Technodrome>
lol
<Technodrome>
what did you have him fix?
s2013 has joined #ruby
<dminuoso>
Technodrome: Oh he had document ready handlers in a turbolinks enabled application.
<dminuoso>
Rails stuff
brybeecher has joined #ruby
<Technodrome>
was the file already added? wouodn't a git commit -m "something" and a git push be all he needed?
<Technodrome>
did he at least fix the rails thing?
<dminuoso>
Technodrome: It was not added to the index.
Channel6 has joined #ruby
<dminuoso>
That was the point.
<Technodrome>
so he didn't know to do a git add . ?
* dminuoso
shoots Technodrome
<dminuoso>
Technodrome: Don't git add .
<dminuoso>
use git add -p
harai_ has joined #ruby
<Technodrome>
sure , or git-add
<Technodrome>
but still
<Technodrome>
to get the commit going lol
<dminuoso>
well
<dminuoso>
I didn't dare to ask who was making the commits for him
<dminuoso>
or where he stole the project from
<Technodrome>
did he fix the rails issue?
<dminuoso>
Yeah
<Technodrome>
was it hard at all?
<dminuoso>
no
<Technodrome>
he may had just never used git much, maybe a SVN guy or something
<dminuoso>
18:54 < dminuoso> Technodrome: Last guy didn't even pass basic git fu-ery. He displayed a fancy git log on his project with thousands of commits. [...]
<dminuoso>
read that last sentence again
<Technodrome>
ah
<Technodrome>
win some, you lose some dminuoso
<dminuoso>
I mean basic git knowledge should be clear. If you dont know how to rebase, rebase interactive, or what git reset does with --soft, --mixed and --hard...
<dminuoso>
You know, the really rudimentary basics.
<Technodrome>
yep, i read a git book when it first came out, and if anything comes up weird, i just google
JeanCarloMachado has quit [Ping timeout: 240 seconds]
<Technodrome>
had a few SSL issues , keys, that bs before
<Technodrome>
but the api is simple
<dminuoso>
Technodrome: see, if his instant reaction had have been to alt tab and google -> perhaps I might have overlooked it :P
<Technodrome>
yeah exactly, go find what you dont know, don't sit there for 20 mins
<dminuoso>
well, he sat there for like 20s
<dminuoso>
but still
JeanCarloMachado has joined #ruby
<Technodrome>
well, i'm going to have to fake it till I make it this next week too
<Technodrome>
my rails knowledge is not how it was 5 years ago
<dminuoso>
since i dont know how your rails knowledge was 5 years ago, I dont know whether thats a good or a bad thing.
<Technodrome>
but i understand pretty well how rails works internally, and doing CRUD stuff is always fairly simple for me
<dminuoso>
;)
<Technodrome>
i always go fairly in depth, i know how django works internally like the back of my hand, with rails, i know a great deal, read source code etc
<SerialDev>
"fake it till ya make it" <-- haven't heard that meme in years! :-D
<dminuoso>
See, I stopped with this CRUD nonsense. Ive now spent 2 months reworking our rails applications into react applications.
kht has quit [Ping timeout: 255 seconds]
<Technodrome>
i'm not going back to J2EE
<dminuoso>
Now these apps have come to life.
<Technodrome>
sure, i'm ok with headless rails too
<Technodrome>
but still most things i work on are probably going to be crud
blackmesa has joined #ruby
helpa has quit [Remote host closed the connection]
<dminuoso>
Oh boy, the scare.
helpa has joined #ruby
<dminuoso>
Just opened a source file and was wondering where the 500 lines of code went that I wrote.
<dminuoso>
Took me a second to realize I git stashed it. :)
<Technodrome>
lol
<Technodrome>
i got a Drupal job lined up, but i dont want to do that
<Technodrome>
but if i have too i will, i hate the drupal api
Ishido has joined #ruby
rippa has joined #ruby
Julianee has joined #ruby
blackmesa has quit [Client Quit]
govg has quit [Ping timeout: 258 seconds]
danguita has joined #ruby
<Technodrome>
new employment sucks
slappy161 has quit [Quit: Leaving.]
helpa has quit [Remote host closed the connection]
<Technodrome>
the hiring process is fairly intense because of all the idiots that sign up for these jobs these days
helpa has joined #ruby
JeanCarloMachado has quit [Ping timeout: 245 seconds]
<dminuoso>
Technodrome: Well if you're as good as you think you are, it shouldn't be too terribly difficult.
JeanCarloMachado has joined #ruby
<Technodrome>
good as I think I am? ha
<dminuoso>
if you imply that the problem is that there's too many other idiots
<dminuoso>
you must think highly of yourself.
<Technodrome>
i bet half of ruby dev's at companies dont even know what an eigenclass is
jonjoe has quit [Remote host closed the connection]
Trynemjoel has joined #ruby
Julianee has quit [Ping timeout: 255 seconds]
<Technodrome>
ruby is just so easy to use, its like smalltalk, people used that for 15 years and didn't have a clue how it worked internally
<dminuoso>
its fairly close to smalltalk internally too :P
<dminuoso>
(in particular how method calls are implemented)
<dminuoso>
asm>> receiver.method
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/726444
<dminuoso>
asm>> receiver.method(argument)
<ruby[bot]>
dminuoso: I have disassembled your code, the result is at https://eval.in/726445
<Technodrome>
sure
<Technodrome>
you are more skiled than me at that stuff, i haven't used C in some time, and i am not good with GDB etc
anotherpi has joined #ruby
<anotherpi>
hi rubyists!
<dminuoso>
o/
machinewar has quit []
<anotherpi>
i'm defining an error, and i want to redefined the error message
last_staff has joined #ruby
<anotherpi>
i redefined the message method
blackmesa has joined #ruby
<anotherpi>
but i does not work :(
<anotherpi>
i have to redefined the to_s method instead
<anotherpi>
now it works
<anotherpi>
but did i do something wrong?
<anotherpi>
cause it's a bit ugly for me
<Technodrome>
dminuoso now i'm feeling under skilled :( oh i'm too old for this
<dminuoso>
anotherpi: Show us what you have tried so far
Devalo has joined #ruby
<anotherpi>
i will not copy paste here :p
blackbombay has quit [Ping timeout: 240 seconds]
<anotherpi>
i will search for an online service…
<havenwood>
anotherpi: Pasting a link to a gist of your code is best: gist.github.com
JeanCarloMachado has quit [Ping timeout: 256 seconds]
<anotherpi>
yep you're right
<anotherpi>
but i never used it before, so…
JeanCarloMachado has joined #ruby
<anotherpi>
let's try with a framapad! :D
<anotherpi>
the code in red is the code i have to add to make it works (see the framapad)
<anotherpi>
i found on the internet an example without the to_s redefinition
<anotherpi>
i try to refind it
bkxd has quit [Ping timeout: 256 seconds]
mikolaj9 has left #ruby [#ruby]
Xiti has joined #ruby
<Technodrome>
dminuoso you in the US? just curious
govg has joined #ruby
brybeecher has quit [Ping timeout: 255 seconds]
OTORelic has quit [Ping timeout: 260 seconds]
JeanCarloMachado has quit [Ping timeout: 255 seconds]
agent_white has quit [Ping timeout: 255 seconds]
BackEndCoder has quit [Excess Flood]
JeanCarloMachado has joined #ruby
BackEndCoder has joined #ruby
psychicist__ has joined #ruby
unshadow has joined #ruby
<anotherpi>
damn, it's like ruby wasn't running the same with the others :o
<anotherpi>
nevermind, i will commit my workaround
dopamean_ has quit [Quit: WeeChat 1.3]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
antgel has quit [Ping timeout: 252 seconds]
JeanCarloMachado has quit [Ping timeout: 245 seconds]
JeanCarloMachado has joined #ruby
ta has joined #ruby
jonjoe has joined #ruby
blackmesa has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
conta has joined #ruby
Channel6 has quit [Quit: Leaving]
kristofferR has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
conta has quit [Ping timeout: 264 seconds]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
mikeiniowa has quit [Remote host closed the connection]
JeanCarloMachado has joined #ruby
<Technodrome>
dminuoso its almost like virtual classes are parallel in relation to the superclass method, singletons superclass are always just the next inheritance chains up singletons etc , never the real class, but when it does method look up , the singleton -real - singleton - real is being used
mikeiniowa has joined #ruby
<Technodrome>
i could be wrong here , but thats what it seems like its doing
ruby292 has joined #ruby
<ruby292>
hi
<ruby292>
i'm trying to combine a couple of where clauses in ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 276 seconds]
<ruby292>
this works on a seperate line @products = @category.products.where('enddate > ?', todaydate )
<ruby292>
but when i try to combine it with my other elements, it says it's looking for a =>
weerasak has joined #ruby
ta has quit [Ping timeout: 255 seconds]
<ruby292>
hello
zeroDi has joined #ruby
gix has joined #ruby
<ruby292>
booyah
nowhere_man has joined #ruby
ifctj has quit [Ping timeout: 255 seconds]
<canton7>
ruby292, 1) that's not a question about ruby, it's a question about whatever library you're using (and you haven't told us what that is), and 2) you haven't told us *how* you're trying to combine it with other elements, so we can't see what's wrong anyway
Mon_Ouie has quit [Ping timeout: 240 seconds]
<canton7>
ruby292, ... that (along with the fact that it's Sunday) is probably the reason you're not getting a response within 5 mins
Mon_Ouie has joined #ruby
rob_ has quit [Quit: rob_]
weerasak has left #ruby ["Using Circe, the loveliest of all IRC clients"]
ruby292 has quit [Ping timeout: 260 seconds]
ResidentBiscuit has joined #ruby
dopamean_ has joined #ruby
UnknownSoldier has quit [Remote host closed the connection]
blackmesa has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Julianee has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
jonjoe has quit []
psychicist__ has quit [Quit: Lost terminal]
Julianee has quit [Ping timeout: 255 seconds]
xall has quit [Read error: Connection reset by peer]
ifctj has joined #ruby
GodFather has joined #ruby
JeanCarloMachado has joined #ruby
nicolai86 has quit [Remote host closed the connection]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Technodrome>
i discussed this a bit earlier, but if anyone else knows why class A; end ; AA = class << A; self; end and when you do AA.superclass it returns Class:Object instead of A , please let me know
<Technodrome>
its irking me
bkxd has joined #ruby
vuoto has quit [Read error: Connection reset by peer]
JeanCarloMachado has quit [Ping timeout: 248 seconds]
blackmesa has quit [Ping timeout: 260 seconds]
JeanCarloMachado has joined #ruby
Cohedrin_ has joined #ruby
agent_white has quit [Read error: Connection reset by peer]
bkxd has quit [Ping timeout: 240 seconds]
<Technodrome>
actually i think i've learned it now
<al2o3-cr>
>> class A end; AA = class << A; self end; A.singleton_class.superclass == AA.superclass
JeanCarloMachado has quit [Ping timeout: 240 seconds]
<Technodrome>
yes al2o3-cr i understand that
<al2o3-cr>
oh
<Technodrome>
the method lookup chain i guess goes something like , if method is called look in singleton class first , then the real class
<Technodrome>
right?
<Technodrome>
or should I say, we both agree to that ?
<al2o3-cr>
sure
<Technodrome>
then it goes the next level up, to the superclass, first to the singleton class, then to the real class (method) look wise
<Technodrome>
right?
<Technodrome>
so it makes logical sense, in a way to think that, the virtual class (eigen) that is getting injected at the start of the method invocation process for that object, would inherit from the *real* class
<Technodrome>
so AA's superclass would be A , and then it would go up to say BB then B
<Technodrome>
because i guess that just makes logical sense
<Technodrome>
which i think it is, objects are always created by the eigen class
<dminuoso>
Technodrome: I just checked, superclass returns the raw superclass RClass
<Technodrome>
but from ancestors or superclass on the class, you would never know
<dminuoso>
No magic shenanigans.
<Technodrome>
i think i figured it out dminuoso
<Technodrome>
look at that image someone made
<Technodrome>
Eigenclasses always inherit from other Eigenclasses
<Technodrome>
never is the *real* class in their inheritance chain
<Technodrome>
but of course the *method* invocation process, follows the X.ancestors etc
<dminuoso>
No the diagram is definitely wrong.
<dminuoso>
Or rather internally wrong
<Technodrome>
well, its matching whats happening in irb here
<dminuoso>
mmm
<Technodrome>
try to get a real class, as a superclass of any Eigenclass you create
conta has joined #ruby
<Technodrome>
it seems like Eigenclasses instantiate, the class, and then that the instance, but is not in the inheritance chain from the aspect of superclass and ancestors
Devalo has quit [Remote host closed the connection]
<Technodrome>
but seems to be in the method lookup process in one way or another
crazyphil has joined #ruby
Devalo has joined #ruby
<Technodrome>
dminuoso i would love for you to prove it wrong though, because that diagram is the only thing matching my terminal
<dminuoso>
Technodrome: Will you be around tomorrow?
<Technodrome>
yes
<dminuoso>
Or actually we can do this now
<Technodrome>
do you know for sure that this theory is wrong?
Devalo has quit [Ping timeout: 258 seconds]
blackmesa has joined #ruby
conta has quit [Ping timeout: 264 seconds]
mhenrixon has joined #ruby
dopamean1 has joined #ruby
griffindy has joined #ruby
vuoto has joined #ruby
scootaloo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duckpupp1 has joined #ruby
dopamean_ has quit [Ping timeout: 264 seconds]
blackmesa has quit [Ping timeout: 258 seconds]
dimasg has quit [Ping timeout: 255 seconds]
duckpupp1 has quit [Ping timeout: 245 seconds]
Kug3lis is now known as Kug3lis_off
tolerablyjake has quit [Ping timeout: 255 seconds]
Technodrome has quit [Ping timeout: 255 seconds]
msmith has joined #ruby
youch has joined #ruby
aryaching has joined #ruby
nankyokusei has joined #ruby
harai_ has quit [Ping timeout: 264 seconds]
ecuanaso has joined #ruby
youch has quit [Ping timeout: 264 seconds]
marcdel has quit [Ping timeout: 255 seconds]
AndBobsYourUncle has joined #ruby
danguita has quit [Remote host closed the connection]
OTORelic has joined #ruby
mikecmpbll has quit [Ping timeout: 259 seconds]
nankyokusei has quit [Ping timeout: 255 seconds]
dimasg has joined #ruby
baweaver is now known as baweaver_away
baweaver_away is now known as baweaver
KnownSyntax has quit [Remote host closed the connection]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
marcdel has joined #ruby
ifctj has quit [Remote host closed the connection]
ResidentBiscuit has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
mas8899 has joined #ruby
ifctj has joined #ruby
<mas8899>
Is this the right place to ask a bit of help about rexml ?
frozengeek__ has joined #ruby
<dminuoso>
After having reverse engineered CRuby, I think this diagram accurately depicts how singleton classes exist in the world of Ruby:
<dminuoso>
Can the powers that be please take a look, and tell me if its a) clear and b) correct?
<Nilium>
Reverse engineered? O_o
<anotherpi>
mas8899: i don't think you could find and active rexml irc channel, so may be it's the best irc channel for a rexml question :p
<mas8899>
Okay :)
<dminuoso>
Nilium: Well, try to dig through this japanese codebase with -20 comments.
<Nilium>
Been there, done that.
_geoff has joined #ruby
ResidentBiscuit has quit [Ping timeout: 255 seconds]
kazlock has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
OMSQ has joined #ruby
marcdel has quit [Remote host closed the connection]
ifctj has quit [Ping timeout: 260 seconds]
<mas8899>
The thing is, I found this guide about how to read XML http://www.tutorialspoint.com/ruby/ruby_xml_xslt.htm I want to go for the DOM like way. The example there works pretty well, if you want to read a concrete thing from the top to bottom. But how do I access the elements on a recursive way? Like printing a parent node then some node inside, then another parent and then inside again, etc?
msmith has quit [Remote host closed the connection]
lxsameer has quit [Quit: WeeChat 1.6]
<anotherpi>
dminuoso: Technodrome said: i discussed this a bit earlier, but if anyone else knows why
<anotherpi>
AA.superclass it returns Class:Object instead of *A*
<anotherpi>
class A; end ; AA = class << A; self; end and when you do
<anotherpi>
oups
<anotherpi>
I think he would say Object instead of *A*
dionysus70 has joined #ruby
<anotherpi>
if true, i don't understand why too
dionysus69 has quit [Ping timeout: 260 seconds]
dionysus70 is now known as dionysus69
<dminuoso>
anotherpi: I dont care about how Ruby behaves.
<dminuoso>
Or well actually I do >D
<dminuoso>
:D
<dminuoso>
but he was right with one bit, singleton classes form an inheritance chain
<anotherpi>
yep
bkxd has joined #ruby
<dminuoso>
anotherpi: and his findings were particularly valid because .superclass() actually directly returns the actual class behind "super" internally
<anotherpi>
everytime i think i understand all of this, i find one behavior i don't understand
<dminuoso>
with no checking or magic.
grh has quit [Ping timeout: 260 seconds]
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<anotherpi>
dminuoso: you said: I dont care about how Ruby behaves.
ecuanaso has joined #ruby
<anotherpi>
dminuoso: but you said too: After having reverse engineered CRuby, […]
<anotherpi>
funny :)
kazlock has joined #ruby
Technodrome has joined #ruby
<dminuoso>
anotherpi: Well, the graph he linked was just a bit wrong
jeffreylevesque has quit [Ping timeout: 240 seconds]
<exap>
'Sup folks?
claw has quit [Ping timeout: 252 seconds]
<RickHull>
i'm wondering now what's already out there. is there a similar approach? is my idea intractable? could I make a grammar for it?
<Asher>
rickhull - working on getting my startup going
<Asher>
gotta make dogfood, bbs
<RickHull>
dang, who's the master? ;)
bmurt has joined #ruby
Channel6 has joined #ruby
exap has left #ruby [#ruby]
psychicist__ has quit [Ping timeout: 240 seconds]
youch has joined #ruby
McSoFake has quit [Quit: WeeChat 1.7]
<RickHull>
looking at OptionParser now. last time I used a builtin parser was GetOptLong and that was painful
<RickHull>
can OptionParser support smashing or flag=value assignment forms (literally with equals)?
Fernando-Basso has joined #ruby
<ljarvis>
RickHull: hey
<RickHull>
i don't know if there's a better term than smashing, just now starting to survey the landscape
chouhoulis has quit [Remote host closed the connection]
<ljarvis>
and yes it can, but with OptionParser you just have to be explicit when defining options
grh has joined #ruby
<RickHull>
my angle is to be nice to the user and flexible when it's possible to disambiguate
<RickHull>
the user being the supplier of the cmdline args
youch has quit [Ping timeout: 240 seconds]
<RickHull>
rather than the script writer deciding on a single acceptable form
<ljarvis>
I think that's nice in theory, but that's pretty much what caused v3 of slop to become a mess
<RickHull>
I believe it
kjaleshire has joined #ruby
<RickHull>
I think I've got it contained though
kjaleshire has quit [Client Quit]
<RickHull>
though nowhere close to any sort of formal grammar
<RickHull>
not sure if that's possible
kristofferR has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Julianee has joined #ruby
<RickHull>
the basic idea is to get the maximum percentage of prevalent option styles contained in a parser with zero configuration. it just needs to be fed the option spec
<ljarvis>
I could pretty much fix this in slop by gathering options during parse time and checking if they all exist (and are boolean types), but it becomes tricky when dealing with unknown options
<RickHull>
if healthy_options pans out, could you use that approach to just process ARGV?
Lord_of_Life has quit [Excess Flood]
<RickHull>
i'm not sure how you do it in v3 or v4
montanonic has joined #ruby
<RickHull>
one limitation i thought I would have to accept is that options must precede non-options, but slop v4 doesn't have this limitation
<RickHull>
i think with the right set of features, it's a tractable problem to be nice to the user
Lord_of_Life has joined #ruby
<ljarvis>
v4 was a complete rewrite and i'm happy with the code because it's quite easy to extend. v3 was fine but became a big mess during the parsing
<RickHull>
right now, I don't think I can accept the current behavior for `-p5` -- should I just rescue Slop.parse and give a nicer message?
Julianee has quit [Ping timeout: 255 seconds]
<ljarvis>
no, I absolutely want to fix that and have a failing test case I'm playing with locally
<RickHull>
is it a regression?
Tralin has quit [Read error: Connection reset by peer]
Tralin_ has joined #ruby
<ljarvis>
I can't remember to be honest, I'd say yes, but just because v3 had a config option and v4 doesn't
<ljarvis>
brb
<RickHull>
i agree with minimizing config options
claw has joined #ruby
<RickHull>
but they may be necessary and useful
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
at a first glance, it looks like orig_arg will not get read/consumed in this case
<RickHull>
oh
<RickHull>
i think i misunderstood how the pairs work
<RickHull>
i was thinking 10 args would be 5 pairs
<ljarvis>
no, each_cons not each_slice :)
<RickHull>
but it would be 9 pairs, right?
<RickHull>
first time seeing each_cons, I didn't look it up :)
<ljarvis>
10, actually. The last will be [last, nil]
<ljarvis>
it's manually inserted
<RickHull>
I hack something like that in loremarkov, maybe i can use each_cons
<ljarvis>
so "foo bar baz etc" #=> [["foo", "bar"], ["bar", "baz"], ["baz", "etc"], ["etc", nil]]
<ljarvis>
each_cons is nice, and imo perfect for option parser
<ljarvis>
v3 didn't use it
<RickHull>
it's perfect for the v4 approach -- clean
<RickHull>
i am definitely taking a dirty approach
<RickHull>
how many healthy_options tests could v4 pass?
<RickHull>
(if you agree with their formulation)
<RickHull>
a big part of the dirty approach is looking up the option spec at parse time
<RickHull>
which I don't think v4 does
<RickHull>
or does it?
<ljarvis>
I really don't know without plugging it in (which I guess would require some work)
<ljarvis>
slop checks if an option is present and if that option should expect an argument
<ljarvis>
but doesn't do type checking etc
<RickHull>
yeah, ok, that's my approach
<ljarvis>
it's probably quite necessary
Ishido has quit [Ping timeout: 240 seconds]
blackwind_123 has quit [Ping timeout: 248 seconds]
<RickHull>
Now I think it's just certain forms of short option smashing that slop v4 would have any trouble with
<RickHull>
w.r.t. healthy_options
<crazyphil>
can someone point me to documentation that would explain all of this statement: value.gsub(/[ ,]/, '\ ' => ' ', ',' => '\,'), I get the first part before the =>, but can't find any reference about the =>
blackwind_123 has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
that's the hashrocket or fat comma
<RickHull>
it links a key to a value in a Hash
<ljarvis>
RickHull: happy to try and fix those if you can add reproducible slop code to gh issues
<RickHull>
the first argument to gsub there is a regex, the second is a hash
<RickHull>
with 2 keys
<RickHull>
it's technically only 2 args though it looks like 3
<crazyphil>
can you point to documentation so I can read about it and fully understand it?
<dminuoso>
ljarvis: Well often you have multiple parameters that somehow make sense together, they form some kind of invariant.
<dminuoso>
And I maintain that invariant by placing these arguments inside an object that can maintain said invariant.
<ljarvis>
i see
Devalo has quit [Ping timeout: 240 seconds]
enterprisey has quit [Ping timeout: 255 seconds]
<ljarvis>
sounds like hassle for creating intermediate objects before calling methods, no?
<dminuoso>
Yeah
<dminuoso>
It's a habit I developed in C++ which reshaped my mind to think much harder in terms of invariants and class constracts for writing robust code.
<dminuoso>
*contracts
<Mon_Ouie>
Sounds like what makes an API like Vulkan so verbose too
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<ljarvis>
sounds like something like that would be even more tedious in c++
banisterfiend has joined #ruby
duckpupp1 has joined #ruby
<Radar>
RickHull: fyi: you're hitting enter so much that it's setting off helpa's spam protection.
<dminuoso>
ljarvis: It doesn't happen too often though.
<RickHull>
Radar, you mean previously?
<Radar>
RickHull: yes.
<RickHull>
that's me, mr spam
<Radar>
indeed.
<Radar>
I may need to tweak the code.
xlegoman has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
brybeecher has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
<Radar>
RickHull: Could you please come into #logga and enter a few messages there for me?