havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.0, 2.3.3 & 2.2.6: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby
benlieb has quit [Quit: benlieb]
Devalo has joined #ruby
unshadow has quit [Ping timeout: 240 seconds]
ecuanaso has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
JeanCarloMachado has quit [Ping timeout: 256 seconds]
Devalo has quit [Ping timeout: 245 seconds]
JeanCarloMachado has joined #ruby
ddffg has quit [Ping timeout: 264 seconds]
Julianee has quit [Remote host closed the connection]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Ping timeout: 258 seconds]
JeanCarloMachado has joined #ruby
duckpupp1 has joined #ruby
msmith has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
ResidentBiscuit has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
duckpupp1 has quit [Ping timeout: 248 seconds]
JeanCarloMachado has quit [Ping timeout: 245 seconds]
msmith has joined #ruby
msmith has quit [Remote host closed the connection]
AndBobsYourUncle has joined #ruby
JeanCarloMachado has joined #ruby
kht has joined #ruby
felltir has joined #ruby
bennofs has joined #ruby
AndBobsYourUncle has quit [Client Quit]
ResidentBiscuit has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
JeanCarloMachado has quit [Ping timeout: 258 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
mrwn has joined #ruby
JeanCarloMachado has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
mrwn has quit [Ping timeout: 240 seconds]
JeanCarloMachado has quit [Ping timeout: 256 seconds]
JeanCarloMachado has joined #ruby
rt has quit [Excess Flood]
bruce_lee has quit [Remote host closed the connection]
rt has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
redhedded1 has joined #ruby
JeanCarloMachado has joined #ruby
saneax is now known as saneax-_-|AFK
sepp2k has quit [Quit: Leaving.]
phoo1234567 has quit [Quit: Gotta go]
ecuanaso has joined #ruby
maddmaxx has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
kht has quit [Ping timeout: 264 seconds]
maddmaxx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
slappy161 has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has joined #ruby
yfeldblum has joined #ruby
yfeldblum has quit [Client Quit]
JeanCarloMachado has quit [Ping timeout: 256 seconds]
JeanCarloMachado has joined #ruby
kht has joined #ruby
UnknownSoldier has quit [Remote host closed the connection]
<acalycine> Is uing && instead of and really accepted convention?
<acalycine> *using
<scootaloo> yes
JeanCarloMachado has quit [Ping timeout: 264 seconds]
<scootaloo> && and and have different precedence and may be confusing – convention is to just use && (same for || and or)
<acalycine> Ah, cool.
JeanCarloMachado has joined #ruby
scootaloo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BackEndCoder has quit [Excess Flood]
BackEndCoder has joined #ruby
nankyokusei has joined #ruby
skweek has quit [Remote host closed the connection]
duckpupp1 has joined #ruby
<RickHull> also &&/|| combine with assignment in fun ways
<RickHull> >> value ||= :default
<ruby[bot]> RickHull: # => :default (https://eval.in/726166)
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.
CloCkWeRX has quit [Quit: Leaving.]
<RickHull> istrasci, take a look at https://github.com/pry/pry for some inspiration
leonthemisfit_ is now known as leonthemisfit
leonthemisfit has quit [Changing host]
leonthemisfit has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
bocaneri is now known as Sauvin
<istrasci> Hmm, for a Rails model, I can run MyModel.attribute_names .
hutch34 has joined #ruby
<istrasci> So I can say `MyModel.attribute_alias :b` will give me "a".
JeanCarloMachado has joined #ruby
youch has joined #ruby
harai_ has quit [Ping timeout: 258 seconds]
montanonic has joined #ruby
machinewar has joined #ruby
<machinewar> how can I configure concurrency with WEBrick
boombox_ has quit [Remote host closed the connection]
hutch34 has quit [Ping timeout: 240 seconds]
<machinewar> I want to turn it off
minimalism has joined #ruby
youch has quit [Ping timeout: 240 seconds]
kht has quit [Ping timeout: 276 seconds]
minimalism has quit [Client Quit]
msmith has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 260 seconds]
minimalism has joined #ruby
kht has joined #ruby
Devalo has joined #ruby
felltir has quit []
JeanCarloMachado has joined #ruby
Devalo has quit [Ping timeout: 276 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
skweek has quit [Ping timeout: 252 seconds]
montanonic has quit [Ping timeout: 258 seconds]
__Yiota has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
gloscombe has quit [Quit: gloscombe]
Derperperd has quit [Ping timeout: 245 seconds]
JeanCarloMachado has joined #ruby
kht has quit [Ping timeout: 258 seconds]
montanonic has joined #ruby
kht has joined #ruby
duckpupp1 has joined #ruby
kazlock has joined #ruby
redhedded1 has quit [Quit: Textual IRC Client: www.textualapp.com]
JeanCarloMachado has quit [Ping timeout: 252 seconds]
JeanCarloMachado has joined #ruby
duckpupp1 has quit [Ping timeout: 255 seconds]
nircUser has joined #ruby
<nircUser> hi
xlegoman has joined #ruby
istrasci has left #ruby [#ruby]
nircUser is now known as c00dy
c00dy has quit [Client Quit]
JoshS has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aidalgol has quit [Read error: Connection reset by peer]
kht has quit [Ping timeout: 255 seconds]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
tristanp has quit [Remote host closed the connection]
tristanp has joined #ruby
JeanCarloMachado has quit [Ping timeout: 264 seconds]
duckpupp1 has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Technodrome has joined #ruby
al2o3-cr has quit [Ping timeout: 256 seconds]
brent__ has joined #ruby
<Technodrome> anyone know how Ruby's eigenclasses work in depth?
al2o3-cr has joined #ruby
AndBobsYourUncle has joined #ruby
d^sh has quit [Ping timeout: 240 seconds]
harfangk has joined #ruby
brent__ has quit [Ping timeout: 255 seconds]
d^sh has joined #ruby
nankyokusei has joined #ruby
youch has joined #ruby
nankyokusei has quit [Ping timeout: 255 seconds]
youch has quit [Ping timeout: 245 seconds]
UnknownSoldier has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
msmith has joined #ruby
__Yiota has joined #ruby
__Yiota has quit [Client Quit]
CloCkWeRX has joined #ruby
shinnya has joined #ruby
redhedded1 has joined #ruby
redhedded1 has quit [Quit: Textual IRC Client: www.textualapp.com]
msmith has quit [Remote host closed the connection]
browndawg has joined #ruby
aidalgol has joined #ruby
matp has quit [Quit: ZZzzzZz...]
kht has joined #ruby
Derperperd has joined #ruby
slappy161 has quit [Read error: Connection reset by peer]
danielpclark has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Derperperd has quit [Ping timeout: 264 seconds]
montanonic has quit [Ping timeout: 264 seconds]
slappy161 has joined #ruby
msmith has joined #ruby
msmith has quit [Remote host closed the connection]
hutch34 has joined #ruby
<nofxxx> Technodrome, not sure I do, neither what you wanna know
<nofxxx> I like to think they are just objects, the class is just a Class.new
harai_ has joined #ruby
arescorpio has joined #ruby
kazlock has quit [Quit: This computer has gone to sleep]
<Technodrome> nofxxx is every instance, just an instance of the eigenclass first, before moving up the inheritance chain?
hutch34 has quit [Ping timeout: 240 seconds]
ReK2 has quit [Remote host closed the connection]
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ReK2 has joined #ruby
kazlock has joined #ruby
UnknownSoldier has quit [Remote host closed the connection]
maloik has quit [Remote host closed the connection]
Coldblackice has quit []
maloik has joined #ruby
Kug3lis has joined #ruby
Kug3lis is now known as Kug3lis_off
<pragmatism> Only at the class method level, IIRC.
<pragmatism> Just a sec, I know a great resource for this
<pragmatism> Technodrome ^^
<Technodrome> yeah, i understand it
<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 ?
<Nilium> Does dig dig into arrays?
<pragmatism> Nilium no.
<Nilium> Easy to implement yourself then.
<pragmatism> hmm
<pragmatism> Unsure Technodrome, thinking abou tit.
<pragmatism> about it*
<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> here is my first stab at Hash#dig, haven't paid it much thought: https://github.com/rickhull/device_input/blob/master/lib/device_input/compat.rb#L12
<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> not much
<RickHull> looking for work BTW, PM me or w/e
<Technodrome> you just get laid off?
<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
xen0fon has quit [Ping timeout: 240 seconds]
xen0fon1 is now known as xen0fon
<dminuoso> dionysus69: take a look at this:
<dminuoso> &ri Timeout
<dionysus69> unless its already submitted. Also I am planning to make frontend timer with AC so student sees server side timer to be precise
<dminuoso> This gives you a much cleaner interface.
<dionysus69> I ll check that out!
conta has joined #ruby
<toretore> dionysus69: what is the context for this?
<toretore> if you're working in the context of e.g. a web app, just putting sleeps in there is not going to work the way you want
banisterfiend has joined #ruby
gloscombe has joined #ruby
<dionysus69> toretore: yes this is a rails app. I ll see what I can do and then post back.
<dminuoso> dionysus69: For a rails app it's best to simply not do this at all.
<toretore> yeah don't go and put sleeps randomly in a rails app
nofxxx has quit [Ping timeout: 240 seconds]
<dminuoso> Did I mention that I hate garabge collectors?
<toretore> more than manually managing memory?
<dminuoso> toretore: You don't need to manually manage it if you have the right tools.
<dminuoso> I barely manage any memory at all in C++.
<dminuoso> toretore: Taking this away means you get problems such that Im having (tempfiles leaking like crap in my rails application)
<dminuoso> And guess what, the recommended solution? It's a crufy poor mans garbage collector in form of a cronjob that regularly cleans up /tmp
<dminuoso> Things like that make me hate garbage collectors.
<toretore> what do files in /tmp have to do with gc?
<dminuoso> toretore: Tempfiles in Ruby are reaped through GC finalizers.
<dminuoso> (unless you explicitly unlink them)
<dminuoso> Which you can't always do, in case of Rack multipart uploaded files
<toretore> so what makes it leak?
shwouchkster has quit [Quit: Connection closed for inactivity]
A124 has quit [Ping timeout: 255 seconds]
xen0fon1 has joined #ruby
brent__ has joined #ruby
<dminuoso> toretore: Im not exactly sure why they are leaked at all. I hold no references to these objects.
libastral has quit [Ping timeout: 240 seconds]
xen0fon has quit [Ping timeout: 255 seconds]
xen0fon1 is now known as xen0fon
cibs has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
marcdel has quit [Ping timeout: 255 seconds]
Julianee has joined #ruby
Damnit__ has joined #ruby
marcdel has joined #ruby
sepp2k has joined #ruby
jshjsh has joined #ruby
Julianee has quit [Ping timeout: 255 seconds]
Rasi has quit [Quit: WeeChat 1.6]
bennofs1 has joined #ruby
Rasi has joined #ruby
JoshS has quit [Ping timeout: 256 seconds]
bennofs1 has quit [Client Quit]
aidalgol has quit [Quit: zZzZZzzzz]
Devalo has joined #ruby
Fernando-Basso has joined #ruby
unshadow has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Devalo has quit [Ping timeout: 240 seconds]
UnknownSoldier has quit [Remote host closed the connection]
doublemalt_ has quit [Quit: Leaving]
grh has joined #ruby
A124 has joined #ruby
bkxd has quit [Ping timeout: 258 seconds]
Burgestrand has joined #ruby
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Guest81173 has joined #ruby
conta has quit [Remote host closed the connection]
nankyokusei has joined #ruby
mikecmpbll has joined #ruby
conta has joined #ruby
libastral has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
ledestin has joined #ruby
ifctj has joined #ruby
duckpupp1 has joined #ruby
Trynemjoel has quit [Ping timeout: 264 seconds]
Trynemjoel has joined #ruby
ledestin has quit [Ping timeout: 240 seconds]
ifctj has quit [Ping timeout: 256 seconds]
tomphp has joined #ruby
Log1x_ has joined #ruby
artoftheselfless has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
tomphp has quit [Client Quit]
<dminuoso> https://gist.github.com/anonymous/45afa1807a2afc48407e19930dc88c1e -- how could this code path leave the foo_page tempfile intact... ?
<dminuoso> Oh oh oh!
xen0fon has quit [Remote host closed the connection]
browndawg has quit [Quit: Leaving]
artoftheselfless has quit [Ping timeout: 255 seconds]
tomphp has joined #ruby
astrobunny has joined #ruby
conta has quit [Quit: conta]
Log1x_ has quit [Quit: Quit]
saneax-_-|AFK is now known as saneax
astrobunny has quit [Remote host closed the connection]
Log1x_ has joined #ruby
astrobunny has joined #ruby
scootaloo has joined #ruby
Julianee has joined #ruby
gix has quit [Ping timeout: 256 seconds]
astrobunny has quit [Ping timeout: 256 seconds]
Julianee has quit [Ping timeout: 255 seconds]
astrobunny has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xen0fon has joined #ruby
ifctj has joined #ruby
Burgestrand has quit [Quit: Closing time!]
gix has joined #ruby
Damnit__ has quit [Ping timeout: 255 seconds]
okmark has joined #ruby
<okmark> #ruby.pl
hutch34 has joined #ruby
<okmark> Hello
<okmark> is any program to show bytecode of mruby?
Burgestrand has joined #ruby
acalycine has joined #ruby
<acalycine> Is there a way to specify regex capture groups in sub?
<dminuoso> okmark: Yes
grh has quit [Ping timeout: 245 seconds]
<okmark> dminuoso, Very nice ;-)
<okmark> any link, example tutorial?
<dminuoso> >> RubyVM::InstructionSequence.compile('puts "hello world"').disasm # okmark
<ruby[bot]> dminuoso: # => "== disasm: #<ISeq:<compiled>@<compiled>>================================\n0000 trace 1 ...check link for more (https://eval.in/726262)
<dminuoso> >> puts RubyVM::InstructionSequence.compile('puts "hello world"').disasm # okmark
<ruby[bot]> dminuoso: # => == disasm: #<ISeq:<compiled>@<compiled>>================================ ...check link for more (https://eval.in/726263)
<okmark> dminuoso, I ask about mruby
<dminuoso> okmark: Ohh.
<okmark> and not AST byt bytecode
<dminuoso> okmark: That is not AST bytecode, that is the actual Ruby VM bytecode.
<okmark> .... ok I read.
<dminuoso> okmark: Im not deeply familiar with MRuby, I dont even know whether it even has a VM
<okmark> Is any working example about mruby?
<dminuoso> Intuitively I would expect it to use an AST interpreter
hutch34 has quit [Ping timeout: 248 seconds]
ifctj has quit [Ping timeout: 245 seconds]
blackmesa has joined #ruby
ifctj has joined #ruby
<acalycine> Hm.
<dminuoso> okmark: Okay it runs on a special VM called RiteVM apparently
<okmark> dminuoso, I need some smallest. I need writing my own small lang to this bytecode
<okmark> and run it inside C program, mruby is smallest
psychicist__ has joined #ruby
<okmark> dminuoso, this bytecode is stack oriented machine?
<dminuoso> okmark: I suppose so.
AnoHito has joined #ruby
<dminuoso> okmark: There might be some C api to directly feed it with precompiled bytecode.
CloCkWeRX has quit [Ping timeout: 256 seconds]
<dminuoso> Well, there definitely is. Just don't know whether its an external API or not.
<okmark> Can You show me any working example?
<dminuoso> okmark: No.
Burgestrand has quit [Quit: Closing time!]
<okmark> for example: i need put string, generate 5 instruction, store in file or array and run it
<dminuoso> I understand what you are trying to do.
<dminuoso> I just cant tell you whether there's an external API for it or not, I would have to dig through the mruby source myself.
<dminuoso> okmark: Even for normal Ruby this feature is really new (we didn't get this until Ruby 2.3)
xen0fon has quit [Quit: xen0fon]
<dminuoso> (Well technically it has been around for a while, it was just always disabled)
ifctj has quit [Ping timeout: 245 seconds]
<acalycine> Is there a way to specify regex capture groups in `sub`?
Burgestrand has joined #ruby
<dminuoso> okmark: You misunderstand..
<dminuoso> By "I would have to dig through the mruby source myself" I meant: Im not going to do that.
<dminuoso> I recommend you do this yourself.
<dminuoso> but
<dminuoso> okmark: MRB_API mrb_value mrb_load_irep_file(mrb_state*,FILE*);
<dminuoso> this is what I would look at..
<dminuoso> or MRB_API mrb_irep *mrb_read_irep(mrb_state*, const uint8_t*);
<dminuoso> The last one definitely.
astrobunny has quit [Ping timeout: 245 seconds]
Jackneill_ has joined #ruby
<okmark> yes and not. I need undestand what bytecode working (i cant find any info) and I need read and put to file information. Not only read and run
dionysus69 has quit [Remote host closed the connection]
dionysus69 has joined #ruby
Burgestrand has quit [Quit: Closing time!]
JeanCarloMachado has joined #ruby
Burgestrand has joined #ruby
duckpupp1 has joined #ruby
scootaloo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Remote host closed the connection]
okmark_ has joined #ruby
Burgestrand has quit [Client Quit]
JeanCarloMachado has quit [Ping timeout: 248 seconds]
conta has joined #ruby
okmark has quit [Ping timeout: 264 seconds]
JeanCarloMachado has joined #ruby
duckpupp1 has quit [Ping timeout: 276 seconds]
shinnya has joined #ruby
dasher00 has quit [Ping timeout: 255 seconds]
xall has joined #ruby
Julianee has joined #ruby
Burgestrand has joined #ruby
xall has quit [Read error: Connection reset by peer]
nankyokusei has joined #ruby
youch has joined #ruby
frozengeek__ has joined #ruby
UserJosh has joined #ruby
c355e3b has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
jshjsh has quit [Ping timeout: 240 seconds]
youch has quit [Ping timeout: 276 seconds]
dasher00 has joined #ruby
antgel has quit [Ping timeout: 240 seconds]
Damnit__ has joined #ruby
sepp2k has quit [Ping timeout: 240 seconds]
Damnit__ has quit [Client Quit]
e1z0_ has joined #ruby
Burgestrand has quit [Quit: Closing time!]
Devalo has joined #ruby
Lord_of_Life has quit [Excess Flood]
xen0fon has joined #ruby
Burgestrand has joined #ruby
xen0fon has quit [Client Quit]
Lord_of_Life has joined #ruby
bkxd has joined #ruby
Devalo has quit [Ping timeout: 255 seconds]
Burgestrand has quit [Client Quit]
harai_ has quit [Ping timeout: 264 seconds]
vivi has joined #ruby
<vivi> eeee
<vivi> hi
bkxd has quit [Ping timeout: 255 seconds]
<vivi> hy
<vivi> guys
vivi has quit [Client Quit]
Kug3lis_off is now known as Kug3lis
sepp2k has joined #ruby
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
tomphp has quit [Quit: Textual IRC Client: www.textualapp.com]
Burgestrand has joined #ruby
tomphp has joined #ruby
uranellus has quit [Ping timeout: 264 seconds]
Guest99782 is now known as olspookishmagus
mrwn has joined #ruby
kristofferR has joined #ruby
Burgestrand has quit [Quit: Closing time!]
JeanCarloMachado has quit [Ping timeout: 264 seconds]
okmark_ has quit [Ping timeout: 240 seconds]
duckpupp1 has joined #ruby
JeanCarloMachado has joined #ruby
kristofferR has quit [Client Quit]
mrwn has quit [Ping timeout: 255 seconds]
despai has joined #ruby
duckpupp1 has quit [Ping timeout: 248 seconds]
saneax is now known as saneax-_-|AFK
blackmesa has quit [Ping timeout: 276 seconds]
weez17 has joined #ruby
frozengeek__ has quit [Quit: frozengeek__]
gnufied has quit [Ping timeout: 255 seconds]
frozengeek__ has joined #ruby
shinnya has quit [Ping timeout: 258 seconds]
Julianee has quit [Remote host closed the connection]
Lord_of_Life has quit [Excess Flood]
Julianee has joined #ruby
Lord_of_Life has joined #ruby
JeanCarloMachado has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
<acalycine> ?
acalycine has quit [Quit: bye]
gnufied has joined #ruby
hutch34 has joined #ruby
millerti has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
hutch34 has quit [Ping timeout: 245 seconds]
blackmesa has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
nankyokusei has joined #ruby
scootaloo has joined #ruby
frozengeek__ has quit [Quit: frozengeek__]
frozengeek__ has joined #ruby
j416 has quit [Ping timeout: 240 seconds]
blackmes1 has joined #ruby
nankyokusei has quit [Ping timeout: 258 seconds]
blackmesa has quit [Ping timeout: 264 seconds]
govg has joined #ruby
j416 has joined #ruby
blackmes1 has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
mrwn has joined #ruby
e1z0_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Ping timeout: 264 seconds]
grh has joined #ruby
JeanCarloMachado has joined #ruby
cdg has quit [Read error: Connection reset by peer]
dhollinger has quit [Ping timeout: 258 seconds]
cdg has joined #ruby
browndawg has joined #ruby
psychicist__ has quit [Ping timeout: 240 seconds]
psychicist__ has joined #ruby
conta has quit [Quit: conta]
conta has joined #ruby
j416 has quit [Ping timeout: 258 seconds]
j416 has joined #ruby
danguita has joined #ruby
Gayathri_ has quit [Quit: Connection closed for inactivity]
conta has quit [Ping timeout: 255 seconds]
blackmes1 has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
JeanCarloMachado has quit [Ping timeout: 245 seconds]
acalycine has joined #ruby
<acalycine> How could I use variables/symbols instead of a string for argument two?
JeanCarloMachado has joined #ruby
<acalycine> result[:schedule].sub(/at\s(.*?\slocal)/, result[:date_dirty](\\1))
<acalycine> this doesn't work ^
<acalycine> this does: score[:"innings-requirement"].sub(/at\s(.*?\slocal)/,"test (\\1)")
<ljarvis> acalycine: "#{result[:date_dirty]}(\\1)" maybe?
lxsameer has quit [Ping timeout: 256 seconds]
<acalycine> Hm. Seems to think it's a comment instead. https://puu.sh/tFleu/2dd463795b.png
<ljarvis> you're missing the quotes
<ljarvis> it's just string interpolation
xen0fon has joined #ruby
xen0fon has quit [Client Quit]
cdg has quit [Remote host closed the connection]
uranellus has joined #ruby
uranellus has joined #ruby
uranellus has quit [Changing host]
<apeiros> acalycine: also note that symbols are objects. they're not "value references" like variables.
dc4 has quit [Ping timeout: 240 seconds]
ta has joined #ruby
<acalycine> Ah.
redhedded1 has joined #ruby
agent_white has quit [Ping timeout: 255 seconds]
matthewd has quit [Ping timeout: 240 seconds]
psychicist__ has quit [Ping timeout: 240 seconds]
psychicist__ has joined #ruby
<acalycine> `result[:schedule].sub(/at\s(.*?\slocal)/, "#{result[:date_dirty]}(\\1))"`
JeanCarloMachado has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
despai has quit [Quit: This computer has gone to sleep]
Lord_of_Life has quit [Changing host]
Lord_of_Life has joined #ruby
Lord_of_Life has joined #ruby
* dminuoso punches apeiros with a variable
dhollinger has joined #ruby
<scootaloo> that violence
JeanCarloMachado has quit [Ping timeout: 240 seconds]
danguita has quit [Remote host closed the connection]
JeanCarloMachado has joined #ruby
<dminuoso> He is used to it.
matthewd has joined #ruby
Devalo has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mrwn has quit [Remote host closed the connection]
ta has quit [Remote host closed the connection]
jhack has joined #ruby
bkxd has joined #ruby
Devalo has quit [Ping timeout: 260 seconds]
elementaru has quit [Remote host closed the connection]
jhack has quit [Client Quit]
jhack has joined #ruby
bkxd has quit [Ping timeout: 276 seconds]
<acalycine> Why does it expect a ')' in that ^
<acalycine> Extra bracket...
JeanCarloMachado has quit [Ping timeout: 245 seconds]
conta has joined #ruby
JeanCarloMachado has joined #ruby
blackbom1 has joined #ruby
kht has joined #ruby
minimalism has quit [Quit: minimalism]
blackbom2 has joined #ruby
blackbombay has quit [Ping timeout: 240 seconds]
blackbombay has joined #ruby
ta has joined #ruby
blackbom1 has quit [Ping timeout: 276 seconds]
blackbom2 has quit [Ping timeout: 260 seconds]
Kug3lis has joined #ruby
grh has quit [Ping timeout: 245 seconds]
psychicist__ has quit [Ping timeout: 240 seconds]
psychicist__ has joined #ruby
ta has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
duckpupp1 has joined #ruby
pilne has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
nankyokusei has joined #ruby
yokel has quit [Ping timeout: 252 seconds]
genpaku has quit [Ping timeout: 252 seconds]
blackmes1 has quit [Read error: Connection reset by peer]
genpaku has joined #ruby
yokel has joined #ruby
blackmesa has joined #ruby
dn` has quit [Quit: dn`]
nankyokusei has quit [Ping timeout: 258 seconds]
JeanCarloMachado has quit [Ping timeout: 264 seconds]
shinnya has joined #ruby
JeanCarloMachado has joined #ruby
vuoto has joined #ruby
dn` has joined #ruby
tvw has joined #ruby
despai has joined #ruby
JeanCarloMachado has quit [Ping timeout: 258 seconds]
JeanCarloMachado has joined #ruby
alex0ptr has joined #ruby
tvw has quit [Client Quit]
antgel has joined #ruby
McSoFake has joined #ruby
Axy has quit [Read error: Connection reset by peer]
Mia has joined #ruby
tvw has joined #ruby
Julianee has quit [Remote host closed the connection]
kht has quit [Ping timeout: 276 seconds]
conta has quit [Quit: conta]
alex0ptr has left #ruby [#ruby]
conta has joined #ruby
tvw has quit []
Technodrome has joined #ruby
ecuanaso has joined #ruby
oz has quit [Quit: EOF]
hutch34 has joined #ruby
gix has quit [Ping timeout: 255 seconds]
Lord_of_Life has quit [Excess Flood]
bkxd has joined #ruby
Lord_of_Life has joined #ruby
oz has joined #ruby
jhack has quit [Quit: jhack]
gix has joined #ruby
araujo has quit [Quit: Leaving]
hutch34 has quit [Ping timeout: 248 seconds]
bkxd has quit [Ping timeout: 240 seconds]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ecuanaso has joined #ruby
unshadow has quit [Quit: leaving]
Lord_of_Life has quit [Changing host]
Lord_of_Life has joined #ruby
Lord_of_Life has joined #ruby
Lord_of_Life has quit [Excess Flood]
renchan has quit [Remote host closed the connection]
Xiti has quit [Ping timeout: 264 seconds]
Lord_of_Life has joined #ruby
JeanCarloMachado has quit [Ping timeout: 255 seconds]
renchan has joined #ruby
tlahtoani has joined #ruby
psychicist__ has quit [Ping timeout: 260 seconds]
JeanCarloMachado has joined #ruby
renchan has quit [Remote host closed the connection]
duckpupp1 has joined #ruby
renchan has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
kht has joined #ruby
garaz has joined #ruby
<garaz> hi
pandaant has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
Trynemjoel has quit [Ping timeout: 245 seconds]
pandaant has quit [Remote host closed the connection]
psychicist__ has joined #ruby
kht has quit [Ping timeout: 248 seconds]
alex0ptr has joined #ruby
<garaz> what's the speed of newest Ruby?
<dminuoso> 17.9
<dminuoso> Measured by yours truly.
<garaz> (comparing to PHP 5)
<dminuoso> Using a triaxial non-repetitive quantum singularity pulse discriminator.
<dminuoso> Wow. I should become a star trek tech writer.
vuoto has quit [Remote host closed the connection]
dn`_ has joined #ruby
dn`_ has quit [Client Quit]
JeanCarloMachado has quit [Ping timeout: 258 seconds]
<acalycine> Lmao
JeanCarloMachado has joined #ruby
marsjaninzmarsa has quit [Quit: ZNC 1.7.x-git-487-cbf5c38 - http://znc.in]
dn` has quit [Ping timeout: 255 seconds]
vuoto has joined #ruby
conta has quit [Ping timeout: 256 seconds]
<havenwood> garaz: It entirely depends on what your'e doing. Why do you ask?
psychicist__ has quit [Quit: Lost terminal]
<garaz> havenwood: I am thinking if it's worth learning it
<havenwood> garaz: It is.
<elomatreb> Sure. Ruby is a fun language, very powerful for general scripting work
shinnya has quit [Ping timeout: 258 seconds]
<elomatreb> It's not just Rails
dn` has joined #ruby
skweek has joined #ruby
youch has joined #ruby
<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
OTORelic has quit [Ping timeout: 240 seconds]
despai has joined #ruby
<dminuoso> >> a = "foo"; def a.length; return 172; end; puts a.length
<ruby[bot]> dminuoso: # => 172 ...check link for more (https://eval.in/726423)
<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]
<mikolaj9> please tell me how I can compile my code http://pastebin.com/mrM7dhtU
<ruby[bot]> mikolaj9: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/67cfa387bb02f65977dd5f07b8585570
<ruby[bot]> mikolaj9: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
<dminuoso> mikolaj9: It's based on 2.1, but architecturally it still applies
<dminuoso> (some of the C snippets does not match anymore)
despai has joined #ruby
<Technodrome> i dont care about hacking the C source code, it just helps me understand the language better
<ljarvis> heh
<mikolaj9> how i can read from mrb and produce bytecode (opcode)
<Technodrome> singleton class -> real class - > superclass singleton -> superclass real class ?
<Technodrome> is that how it is ?
<mikolaj9> ok, show me any duper mrb file
<dminuoso> Technodrome: mmm, yes
<dminuoso> Technodrome: wait. no
<Technodrome> what is the singleton's class superclass? the real class above it? or the singleton of the superclass ?
<dminuoso> Before we keep talking we need to change terminology I thiknk.
<dminuoso> because the word class has two meanings.
<mikolaj9> https://gist.github.com/anonymous/67cfa387bb02f65977dd5f07b8585570 please tell me how I can compile my code
slappy161 has joined #ruby
<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
<dminuoso> or singleton RCLass
ecuanaso has joined #ruby
<dminuoso> This is beautiful.
<dminuoso> That shows how things fit together.
<Technodrome> i need to read that book
<dminuoso> And then that.
<Technodrome> klass is the singleton class right?
<dminuoso> Uhh no.
<dminuoso> klass is just a pointer.
<dminuoso> Technodrome: singleton classes are the intermediary classes of objects.
<dminuoso> Technodrome: dont confuse RClasses with being actual objects
<Technodrome> that thing you just sent me, where is the singleton object?
acalycine has quit [Quit: bye]
<dminuoso> Technodrome: the Virtual class
<Technodrome> i dont see the word virtual there
<dminuoso> Or no..
<dminuoso> wait
chouhoulis has joined #ruby
<dminuoso> No I linked it.
<dminuoso> Technodrome: Look at the second picture.
garaz has quit [Quit: Page closed]
OTORelic has quit [Ping timeout: 240 seconds]
<Technodrome> ah ok
Axy has joined #ruby
acalycine has joined #ruby
<dminuoso> classes dont have singleton classes
<dminuoso> or rather
<dminuoso> RClasses dont
<Technodrome> so the superclass of virtual, is the real class
<dminuoso> Right.
<dminuoso> The important bit, is that you must differentiate between the object you produce by typing "class Foo; end;
<dminuoso> and its RClass
JeanCarloMachado has joined #ruby
<Technodrome> i read soemthing somewhere that said the superclass of a virtual / singleton , is the parent's superclass singleton
<dminuoso> err what?
<Technodrome> let me try to find it, it really confused me
Mia has quit [Ping timeout: 252 seconds]
Lord_of_Life has quit [Excess Flood]
<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:
JeanCarloMachado has joined #ruby
<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]
<dminuoso> Technodrome: I simplified this a bit and extended by another level: http://i.imgur.com/t9PD933.png
kappy has joined #ruby
<dminuoso> or mmm
<dminuoso> Ohh I made a mistake!
JeanCarloMachado has joined #ruby
<dminuoso> Or no I did not.
ruby915 has joined #ruby
<Technodrome> ha, this confuses everyone :(
<dminuoso> Or man this is too confusing indeed.
<ruby915> Hi guys
<Technodrome> i just tried this in a terminal
<Technodrome> my BB.superclass is A's singletonclass
<Technodrome> class B's singleton class BB, is pointing to A's singleton, not the real class
Ishido has quit [Ping timeout: 240 seconds]
<dminuoso> Technodrome: I think we should avoid using Ruby to understand this
<dminuoso> because ruby is living a pure lie
<ruby915> Hi guys, I wanna start contributing and i have no idea where to start, can anyone help me?
<dminuoso> Ruby does very well to hide these singleton classes from you
<Technodrome> that diagram, doesn't match what i'm getting in my interpreter
<dminuoso> ruby915: Find a program or library you enjoy and use first.
<Technodrome> your singletons are point to the real class
gix has quit [Ping timeout: 260 seconds]
<mikolaj9> anybody can tell me what i can convert mrb file to human readable format in C?
<dminuoso> real class..
blackmesa has quit [Ping timeout: 240 seconds]
<dminuoso> Technodrome: Yeah Ill do my homework
<dminuoso> and figure this out tomorrow
<dminuoso> got the day off, so Ill sit down in a cafe and crack this.
<Technodrome> try that out in your interpreter
<dminuoso> screw these, Ill debug ruby
<Technodrome> the part right below this
<dminuoso> its been too long since Ive had a segmentation fault
<Technodrome> If we call A’s eigen-class AA, and B’s eigen-class BB. Then we will found that BB.superclass == AA
<Technodrome> just try that out
<Technodrome> BB.superclass is AA
<dminuoso> the question is
<Technodrome> so you have 2 singletons directly pointing to each other
<dminuoso> what superclass does under the hood
<Technodrome> good question
<dminuoso> most of these ruby methods are designed to give you information consistent with how method dispatch works.
<dminuoso> because
<Technodrome> why would it skip the A class though
<dminuoso> want me to get started on how module prepend works?
<Technodrome> or maybe because the singleton class is first in the call chain, that it points? is that what you mean?
nofxx has joined #ruby
ruby915 has quit [Quit: Page closed]
<dminuoso> ancestors returns the order in which ruby will lookup for methods
<dminuoso> not actual klass/super chains
<Technodrome> still though, i dont see why BB.superclass is point to AA , i just can't wrap my head around it
<dminuoso> again, I dont even know what superclass does.
<dminuoso> if superclass just returns the "give me the next class that would be looked up" it makes perfect sense
<Technodrome> it almost seems like when dealing with the singleton class, that it doesn't even realize there is a real class
<dminuoso> Technodrome: Ill have to stop researching here, because I got a buggy react component Id like to fix
<dminuoso> but Ill dig into this tomrorow
<Technodrome> you are probably right
duckpupp1 has joined #ruby
<dminuoso> but I wouldnt trust superclass in the slightest
<Technodrome> i can do a quick test, to maybe see if that is correct
<dminuoso> none of these ruby methods directly reflect on how things look under the hood
<dminuoso> they reflect on how ruby reacts
gix has joined #ruby
<dminuoso> I mean, lets not even get started on refined classes..
ta has quit [Ping timeout: 264 seconds]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
kappy has quit [Quit: leaving]
<Technodrome> BB.superclass.superclass == AA.superclass
<Technodrome> => true
<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
xall has joined #ruby
bkxd has joined #ruby
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]
nowhere_man has quit [Ping timeout: 256 seconds]
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
centrx has joined #ruby
nicolai86 has joined #ruby
agent_white has joined #ruby
enterprisey has joined #ruby
psychicist__ has joined #ruby
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
<ruby[bot]> al2o3-cr: # => true (https://eval.in/726450)
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> you following me here al2o3-cr ?
<al2o3-cr> trying to
<Technodrome> if this image is true
<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
bkxd has quit [Ping timeout: 264 seconds]
dimasg has quit [Ping timeout: 252 seconds]
<dminuoso> or weird im not sure
<anotherpi> mas8899: try to do it like you used to, and look at this http://ruby-doc.org/stdlib-2.4.0/libdoc/rexml/rdoc/REXML.html
<dminuoso> This is much much better.
<dminuoso> and more correct even
Cohedrin_ has joined #ruby
<anotherpi> the R of RClass is for?
<dminuoso> anotherpi: well technically you are right... mmmmm
bkxd has joined #ruby
<dminuoso> singleton classes are RClasses too
<banisterfiend> anotherpi Ruby
Devalo has joined #ruby
<anotherpi> banisterfiend: oh ok :)
<anotherpi> did a singleton class is created if it is useless?
<dminuoso> anotherpi: No, in reality they are only created on demand.
<anotherpi> for example: a_string = "hello"; instanciate a new String, but I don't it have a singleton classb
<anotherpi> ok cool
<dminuoso> banisterfiend: What do you think? ahttp://i.imgur.com/ygZUS91.png
<dminuoso> If memory serves right, if anyone *you* do have knowledge of ruby internals
<dminuoso> ;-)
RickHull has joined #ruby
Devalo has quit [Ping timeout: 255 seconds]
OTORelic has quit [Ping timeout: 255 seconds]
<anotherpi> do you read Ruby Under a Microscope?
<dminuoso> Yes.
<anotherpi> <dminuoso> anotherpi: I dont care about how Ruby behaves.
<anotherpi> lol
<anotherpi> i don't, i was bored after 30/40 pages
mikecmpbll has joined #ruby
scootaloo has joined #ruby
duckpupp1 has joined #ruby
<anotherpi> dminuoso: lol, you answer on #RubyOnRails too
<anotherpi> hyperactive ruby person
shakes has joined #ruby
harai_ has joined #ruby
duckpupp1 has quit [Ping timeout: 240 seconds]
shakes has quit [Client Quit]
<RickHull> apeiros, ljarvis, around? want to talk option parsers?
<RickHull> (or anyone else)
dimasg has joined #ruby
<RickHull> banisterfiend, sup mang
chouhoulis has joined #ruby
<RickHull> zzak, hiya :)
kazlock has quit [Quit: This computer has gone to sleep]
dimasg has quit [Client Quit]
jeffreylevesque_ has joined #ruby
<RickHull> Asher, still in Atlanta area?
<Asher> i am
<Asher> how's it going?
<RickHull> bredy gud
<RickHull> you were getting a grad degree last I checked
<RickHull> that was like 4 or 5 years ago maybe?
exap has joined #ruby
<RickHull> what are you up to these days?
<RickHull> I'm working on a spike for an option parser idea: https://github.com/rickhull/healthy_options
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…]
nankyokusei has joined #ruby
workmad3 has joined #ruby
<dminuoso> asm>> def foo(arg); puts arg; end; foo("1234") # Technodrome
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/726464
nankyokusei has quit [Ping timeout: 248 seconds]
vuoto has quit [Remote host closed the connection]
<dminuoso> asm>> puts "a".singleton_class
<ruby[bot]> dminuoso: I have disassembled your code, the result is at https://eval.in/726465
_geoff has quit [Ping timeout: 240 seconds]
renchan has quit [Remote host closed the connection]
DoubleMalt has joined #ruby
tomphp has joined #ruby
ta has joined #ruby
<ljarvis> RickHull: this pretty much fixes it without config options: https://gist.github.com/leejarvis/7789f25eb33f97e6ffd91399ec0a1798
<RickHull> did you get the term "smashed" from me? ;)
<ljarvis> I did :) and I couldn't think of anything else
<RickHull> it's not very technical but it gets the meaning across :)
ponga has quit [Quit: Connection closed for inactivity]
AndBobsYourUncle has joined #ruby
<RickHull> what do you think about the `args, opts = parse(args, opts={})` signature?
<RickHull> is that novel, standard, dumb?
<RickHull> where parse() is recursive
<ljarvis> I think it's fine, but I like returning an object that encapsulates all of that and more (why I introduced Slop::Result in v4)
<RickHull> i'm just now source diving on the various impls. as you know, i've been slop user for a while :)
centrx has quit []
<ljarvis> :)
<RickHull> what is **opts?
<RickHull> splat twice?
<ljarvis> for kwargs
<RickHull> ah right, i haven't thought about that in a while
<RickHull> i see # support foo=bar
blackmesa has joined #ruby
<RickHull> oh, nvm, was talking with someone else about that
grh has quit [Ping timeout: 240 seconds]
<RickHull> looking at the code, I'm not convinced yet that orig_arg is handled properly
hays has quit [Ping timeout: 264 seconds]
<RickHull> if the pair is --foo=bar --baz will --baz get consumed properly?
kristofferR has joined #ruby
<RickHull> ljarvis, ^
<ljarvis> RickHull: what do you mean "consumed"?
<RickHull> registered as a flag/option
<RickHull> and not left in the args/arguments array
<ljarvis> yeah, it'll raise unknown option `--baz'
<RickHull> i mean if it's known
LoneHermit has joined #ruby
<ljarvis> as a bool?
<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?
<ljarvis> %ri Hash
<ljarvis> &ri Hash
UserJosh is now known as JoshS
<crazyphil> ok, so it's a hash of regexes?
<RickHull> hash of string keys to string values
<RickHull> arg1 = regex, arg2 = hash of strings
__Yiota has joined #ruby
<RickHull> ljarvis, yep, will do
__Yiota has quit [Read error: Connection reset by peer]
<RickHull> crazyphil, ruby allows hashes to be passed as method parameters without the outer braces. it's a syntax sugar hack to simulate keyword args
<RickHull> where the keys don't look like keywords, it's not a great practice IMHO
<RickHull> there is another sugar bit which lets symbol keys omit their colon sigil and use a trailing colon instead of a hashrocket
<RickHull> to further simulate keyword args
<RickHull> but this can easily be confusing to understand at a first glance
<crazyphil> yes, it's very confusing
<RickHull> my preferred style is to only simulate keyword args when the hash has symbol keys
<RickHull> ljarvis, did ruby get real kwargs at some point? how does that work with the hash sugar?
TomyLobo has quit [Ping timeout: 255 seconds]
<mas8899> anotherpi: thanks
<ljarvis> RickHull: yeah, version 2 I think. They're separate from the hash sugar but the double splat sucks them into a hash
<RickHull> i'm so used to the hash sugar, particularly with the symbol sugar. it strains me to imagine how to handle both properly
hays has joined #ruby
SpComb has quit [Ping timeout: 256 seconds]
<RickHull> i'll read up on it :)
<ljarvis> you can now do stuff like def foo(bar:, baz:) to define require kwargs
xlegoman has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ljarvis> required*
<RickHull> and inside the method you have a local bar?
<ljarvis> aye
SpComb has joined #ruby
<dminuoso> that syntax
<dminuoso> gives me headaches
<dminuoso> :|
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Cohedrin_ has joined #ruby
<ljarvis> i kinda like it
ddffg has quit [Ping timeout: 260 seconds]
UnknownSoldier has joined #ruby
kristofferR has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rikkipitt has joined #ruby
frozengeek__ has quit [Quit: frozengeek__]
millerti has joined #ruby
nankyokusei has joined #ruby
ddffg has joined #ruby
<dminuoso> ljarvis: Well, I've started to deviate from hash/kwargs based parameters
<dminuoso> ljarvis: I've slowly started leaning towards an OpenStruct-based style, statically enforcing how methods can be called.
nankyokusei has quit [Ping timeout: 256 seconds]
Kug3lis_off has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
saltsa has quit [Ping timeout: 246 seconds]
Devalo has joined #ruby
scootaloo has quit [Quit: Textual IRC Client: www.textualapp.com]
<ljarvis> OpenStruct-based style?
<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?
<RickHull> sure
saltsa has joined #ruby
msmith has joined #ruby
Xiti has quit [Quit: Xiti]
Xiti has joined #ruby
Xiti has quit [Changing host]
Xiti has joined #ruby
CloCkWeRX has joined #ruby
crazyphil_h has joined #ruby
chouhoulis has joined #ruby
crazyphil has quit [Ping timeout: 240 seconds]
CloCkWeRX has quit [Ping timeout: 252 seconds]
Technodrome has left #ruby ["Textual IRC Client: www.textualapp.com"]
nowhere_man has joined #ruby
millerti has quit [Ping timeout: 240 seconds]
msmith has quit [Remote host closed the connection]
harai_ has quit [Ping timeout: 256 seconds]
chouhoulis has quit [Ping timeout: 260 seconds]
Julianee has joined #ruby
kht has joined #ruby
dc4 has joined #ruby
xen0fon has joined #ruby
Julianee has quit [Ping timeout: 255 seconds]
millerti has joined #ruby
Jackneill_ has quit [Remote host closed the connection]
JeanCarloMachado has joined #ruby
GodFather has quit [Read error: No route to host]
LoneHermit has quit [Remote host closed the connection]
CloCkWeRX has joined #ruby
kht has quit [Ping timeout: 276 seconds]
<RickHull> ljarvis, it seems with slop boolean options, if an option defaults to true, there is no good way to turn it off. is that right?
jackjackdripper has joined #ruby
AnoHito has quit [Ping timeout: 240 seconds]
AnoHito_ has joined #ruby
<RickHull> goes to docs... i just remember running into this before
dionysus69 has quit [Ping timeout: 240 seconds]
<RickHull> aha, --no-$flag is supported, cool
<RickHull> no way to do that with a short flag though, right?
<ferr1> Hey, I have this code: https://gist.github.com/Fercell/dde3d53cdcb7e844af8704df96deaf22 code is ugly, but I need to run the each block of code inside Load loop asynchronously, any ideas how to achieve that?
CloCkWeRX has quit [Ping timeout: 240 seconds]
sid_fules has joined #ruby
AndBobsYourUncle has joined #ruby
_geoff has joined #ruby
AndBobsYourUncle has quit [Ping timeout: 260 seconds]
UnknownSoldier has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 240 seconds]
UnknownSoldier has joined #ruby
griffindy has quit [Quit: Textual IRC Client: www.textualapp.com]
JeanCarloMachado has joined #ruby
mas8899 has quit [Remote host closed the connection]
MrLow has joined #ruby
<MrLow> Hi
montanonic has quit [Ping timeout: 240 seconds]
<MrLow> I have a problem that is probably very easy to solve
<MrLow> I am trying to access an array by doing my_array[index] where index is a variable holding an integer
<RickHull> ferr1, you can use threads, or something like pmap or parallel_map comes to mind
<MrLow> but I can’t seem to get it to work
<ferr1> RickHull: Is it enough to put the Thread.new block inside the loop?
<RickHull> >> ary = [:a, :b, :c]; index = 2; ary[index]
<ruby[bot]> RickHull: # => :c (https://eval.in/726507)
LoneHerm_ has joined #ruby
<RickHull> ferr1, not at all. threads are not easy to get started with
<RickHull> though if you know what you are doing, it might end up looking something like that
<ferr1> :(
<RickHull> there are abstraction libs like celluloid that use threads
griffindy has joined #ruby
nankyokusei has joined #ruby
<RickHull> something like parallel_map or pmap is more drop-in
<RickHull> going off a foggy recollection
LoneHerm_ has quit [Remote host closed the connection]
MrLow has quit [Quit: MrLow]
<ferr1> Thanks
anotherpi has quit [Ping timeout: 252 seconds]
duckpupp1 has joined #ruby
CloCkWeRX has joined #ruby
nankyokusei has quit [Ping timeout: 248 seconds]
blackwind_123 has quit [Ping timeout: 245 seconds]
boombox_ has joined #ruby
naprimer_2 has joined #ruby
duckpupp1 has quit [Ping timeout: 255 seconds]
jackjackdripper has quit [Quit: Leaving.]
blackwind_123 has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
montanonic has joined #ruby
<RickHull> pmap provides peach if you don't want to express your block as a map
<RickHull> it gets annoying trying roll up the results of several operations in parallel. bugs and "strange" behavior this way lie
<ferr1> I don't need it to roll up the results of several operations in parallel
<ferr1> I just need to run these loop for each load at a time
naprimer has quit [Ping timeout: 245 seconds]
<ferr1> because it takes about 1.5 minute each
<RickHull> what if one of them crashes or times out?
username_ has joined #ruby
<RickHull> do you need to re-run it? etc..
<ferr1> I'll see it in log
<RickHull> the log might look pretty crazy
<RickHull> if 12 things are writing to it at once
<ferr1> I just compare the data with what I already have
rikkipitt has quit [Quit: Leaving...]
boombox_ has quit [Remote host closed the connection]
<RickHull> sounds good, just wanted to give a fair warning :)
<ferr1> If the numbers don't match, it will be needed to review it once again anyways