coops has quit [Quit: Connection closed for inactivity]
justinfaler has quit [Ping timeout: 240 seconds]
elphe has joined #ruby
<chet>
#python
chet has left #ruby [#ruby]
<havenwood>
?rubyonrails chet
<ruby[bot]>
havenwood: I don't see no chet, whom should I tell about rubyonrails?
white_lilies has joined #ruby
<havenwood>
?rails
<ruby[bot]>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
x77686d has joined #ruby
TinkerTyper has quit [Quit: ZNC 1.7.x-nightly-20180120-fcc710b4 - https://znc.in]
TinkerTyper has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
quobo has joined #ruby
arescorpio has joined #ruby
shinnya has joined #ruby
pastorinni has quit [Remote host closed the connection]
garyserj has joined #ruby
<garyserj>
what is the advantage or reason for doing %w[a b c d] instead of ["a","b","c","d"] ? Is it purely and simply that it is a shorthand? and what type are the things within the square brackets here [a b c d] since presumably they are not strings before %w is applied
<havenwood>
garyserj: easier to type, but more importantly easier to read
<eam>
garyserj: %w and its components are not objects, they are syntax
<havenwood>
garyserj: the reader knows up front the array is simple strings
<eam>
it's taken directly from perl's qw[] construct
<eam>
ruby replaces the "q" with "%"
<garyserj>
ah ok, thanks
<eam>
the same is true of qx => %x, q => %, qr => %r and so on
<eam>
the delimiters can be almost any character, paired or otherwise
<eam>
another nice feature of these alternate quoting methods is that by changing the string delimiter you can avoid having to quote strings with lots of " or ' in them
<eam>
which in perl land used to be quite common in scripts, though ruby has uh, matured past this somewhat
Dimik has quit [Ping timeout: 268 seconds]
cagomez has joined #ruby
nekomune has quit [Read error: Connection reset by peer]
justinfaler has joined #ruby
jottr has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kapil___ has joined #ruby
John_Ivan has quit [Read error: Connection reset by peer]
quobo has quit []
jottr has quit [Ping timeout: 265 seconds]
atchoum has quit [Ping timeout: 268 seconds]
RougeR has quit [Ping timeout: 260 seconds]
jottr has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
cagomez has quit [Remote host closed the connection]
arkinor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dogweather has quit []
yohji has joined #ruby
oetjenj has joined #ruby
white_lilies has joined #ruby
claudiuinberlin has joined #ruby
ur5us has quit []
bigblind has quit [Ping timeout: 248 seconds]
Ishido has quit [Ping timeout: 252 seconds]
TomyWork has joined #ruby
lipoqil has quit [Read error: Connection reset by peer]
lipoqil has joined #ruby
darthThorik has quit [Ping timeout: 256 seconds]
pfg has quit [Read error: Connection reset by peer]
scrptktty has quit [Read error: Connection reset by peer]
rann has quit [Read error: Connection reset by peer]
craysiii has quit [Read error: Connection reset by peer]
scrptktty has joined #ruby
pfg has joined #ruby
rann has joined #ruby
craysiii has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
meinside has quit [Ping timeout: 256 seconds]
white_lilies has quit [Ping timeout: 240 seconds]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marmorkreb has quit [Read error: Connection reset by peer]
marmorkreb has joined #ruby
justinfaler has quit [Ping timeout: 256 seconds]
schneide_ has joined #ruby
amirite has joined #ruby
schneide_ has quit [Remote host closed the connection]
marmorkr_ has joined #ruby
schneide_ has joined #ruby
amirite has quit [Ping timeout: 240 seconds]
marmorkreb has quit [Ping timeout: 260 seconds]
ramfjord has joined #ruby
alex`` has joined #ruby
aufi has joined #ruby
drcode has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
aufi_ has joined #ruby
Dimik has joined #ruby
danielpclark has joined #ruby
aufi has quit [Ping timeout: 252 seconds]
oetjenj has joined #ruby
guardianx has quit []
doublemalt_ has quit [Quit: Leaving]
vutral|kali has quit [Ping timeout: 252 seconds]
nathani has quit [Quit: WeeChat 1.8]
white_lilies has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
white_lilies has quit [Ping timeout: 255 seconds]
deathwishdave has joined #ruby
tvw has quit []
deathwishdave has quit [Client Quit]
jottr has joined #ruby
Ishido has joined #ruby
cdg has joined #ruby
marr has joined #ruby
marmorkr_ has quit [Read error: Connection reset by peer]
marmorkr_ has joined #ruby
elphe has quit [Ping timeout: 260 seconds]
jottr has quit [Ping timeout: 248 seconds]
Ishido has quit [Ping timeout: 256 seconds]
cdg has quit [Ping timeout: 260 seconds]
maum has quit [Remote host closed the connection]
arkinor has joined #ruby
mikecmpbll has joined #ruby
clemens3 has joined #ruby
deathwishdave has joined #ruby
bigblind has joined #ruby
vutral|kali has quit [Ping timeout: 256 seconds]
x77686d has quit [Quit: x77686d]
maufart__ has joined #ruby
aufi_ has quit [Ping timeout: 255 seconds]
modin has quit [Ping timeout: 256 seconds]
bigblind has quit [Ping timeout: 260 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
LastWhisper____ has joined #ruby
Burgestrand has quit [Quit: Closing time!]
arkinor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has joined #ruby
white_lilies has joined #ruby
goatish has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
mtkd has joined #ruby
bigblind has joined #ruby
drcode has quit [Ping timeout: 252 seconds]
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
white_lilies has quit [Ping timeout: 248 seconds]
guille-moe has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
elphe has joined #ruby
bigblind has quit [Ping timeout: 265 seconds]
haylon has joined #ruby
arkinor has joined #ruby
apeiros has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
amirite has joined #ruby
correct-docker has joined #ruby
correct-docker has quit [Client Quit]
Dimik has quit [Ping timeout: 252 seconds]
iron_houzi has joined #ruby
<iron_houzi>
Hi. Can anybody please help me with understanding the actual config of a Puma server I'm trying to deploy? I just want to verify that the config matches my expectations..
haylon has quit [Ping timeout: 276 seconds]
<iron_houzi>
..sorry if OT, #puma wasn't really a thing..
<tbuehlmann>
what's the problem?
Ishido has joined #ruby
traxnov has joined #ruby
jnyw has quit [Quit: WeeChat 2.0.1]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deathwishdave has joined #ruby
<iron_houzi>
tbuehlmann: I'm trying to execute an app running with Puma, and it's not connecting to the DB, even though the DB config checks out.
xcesariox has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
arkinor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has joined #ruby
aufi_ has joined #ruby
dni has joined #ruby
<dni>
hi guyd i have a quite simepl problem
<dni>
im trying to pass a return auf a function to me chef template like this
arkinor has joined #ruby
maufart__ has quit [Ping timeout: 256 seconds]
bigblind has quit [Ping timeout: 256 seconds]
<dni>
enablessl = File.exist?(ssl_conf)
andikr has quit [Remote host closed the connection]
<dni>
template "/etc/apache2/sites-enabled/#{name}.conf" do
<dni>
variables ( :ssl => enablessl )
<dni>
and its always false... what am i missing? isnt the var not evaluated?
ldnunes has joined #ruby
<apeiros>
?chef dni
<ruby[bot]>
dni: Please join #chef for help with your cookbooks.
Ishido has joined #ruby
<dni>
im thinking im lacking some ruby knowhow
<dni>
and how to pash hashes
<dni>
*pass
apparition has joined #ruby
arkinor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has joined #ruby
<apeiros>
the syntax is correct. variables(:ssl => enablessl) will invoke a method variable() with a hash as argument, having :ssl as key and the value of enablessl as value.
raynold has quit [Quit: Connection closed for inactivity]
cdg has joined #ruby
<dni>
apeiros: so why it isnt working?
<apeiros>
as said, ask in chef
<dni>
i got this in my template, <% if @ssl then %>
<dni>
hm
<dni>
i dont even get what is my problem here
<dni>
because passing other arguments works fine, only the File.exists i want to pass is always false
<dni>
although the file is existsing
<apeiros>
maybe the file doesn't exist
bigblind has quit [Ping timeout: 256 seconds]
<apeiros>
is ssl_conf a relative or an absolute path?
<dni>
its existsing for sure
white_lilies has joined #ruby
<dni>
absolute
RougeR has quit [Ping timeout: 252 seconds]
<dni>
i have this check aboive in a not_if { } there its working fine
<apeiros>
well, add a binding.pry or a debug-printout statement. if it says false, the file at that path doesn't exist. despite what you think.
<dni>
mh
<dni>
maybe the variables get evaluated first, before the files even exists...
<apeiros>
variables don't get evaluated. they just reference a value.
<apeiros>
the file must exist when `File.exist?` is called.
<dminuoso>
Unless it's a $ variable. Those get evaluated.
<apeiros>
dminuoso: you mean when they aren't really variables. but you're not helping with the pedantry here :-p
<dminuoso>
Hah! :)
cdg has quit [Ping timeout: 276 seconds]
<dni>
if have code above where fileexists works
<apeiros>
(and you could even say all variables are evaluated, considering the lookup to be evaluation)
<dni>
there has to be some async magik goiing on there then
oetjenj has joined #ruby
<dminuoso>
apeiros: You know what I want - I want foo.map(&:bar).map(&:quux) to be the same as foo.map { |o| o.bar.quux } :(
<dminuoso>
I want ruby functors to be lawful. :(
<dni>
damn that sucks, im trying to figure at how the pass a variable to my template for ever 3 hours now :)
<dni>
i googled everything :D
<apeiros>
dminuoso: o0 not quite sure when that's not the case.
<dni>
and im not new at all to programming just ruby
<apeiros>
anyway, off for jogging & lunch
vutral|kali has quit [Read error: Connection reset by peer]
<dni>
frustrating
white_lilies has quit [Ping timeout: 260 seconds]
<dminuoso>
apeiros: You can observe the difference when working with rails relations.
<dni>
can i somehow pass a function through the hash to then call it in the template or something
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<dminuoso>
apeiros: Maybe I did some gross mistake, but I dont think you can do this in a pointfree manner: connections.flat_map { |e| e.active_customers.distinct }
arkinor has joined #ruby
<dni>
du i have some kind auf ruby_block? to evaluate the file.exists call?
<dminuoso>
dni: Implicitly. Throw an exception if it doesn't. It's semantically equivalent.
<dminuoso>
or use `if` =)
white_lilies has joined #ruby
<dni>
so i tried to do a ruby block before :D
<dni>
maybe the variable then has a value
<dni>
:D just guessing and blindly testing out stuff :)
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta_ has quit [Remote host closed the connection]
gnufied has joined #ruby
<dminuoso>
dni: a "block" is just an anonymous function. a lambda function.
<dminuoso>
blocks/procs/lambdas are basically the same thing with just very subtle differences
<dni>
maybe my value is ther then ;)
<dni>
i cant explain it why its not set, because in code above its set correctly
drewmcmillan has joined #ruby
white_lilies has quit [Ping timeout: 256 seconds]
<dni>
maybe i have somehow have todo the ruby_block beacuse in chef the somehow sequentionally run those block? :D
<dni>
and variables outside done get set at the time im thinking?
<dni>
i really, dont know just wanna find a explanation, documenation doesnt help at all
<Burgestrand>
I can't point you to a ruby-specific guide; however the approach to building an interpreter or a compiler is not significantly different depending on what language you choose to implement it in (an exception is possibly lisp due to the nature of the code pretty much being the AST)
gregf_ has quit [Ping timeout: 260 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has joined #ruby
<paleorange>
so i think i'd need some kind of simple parser generator (preferably peg) first
<Burgestrand>
That's why building a simple calculator interpreter is a good start, it involves all steps necessary that are required for a larger project: parsing an arbitrary text into a meaningful representation [in ruby], and then executing those instructions; variables and memory is mainly expanding the instruction set
<Burgestrand>
paleorange so what's your purpose with this exercise?
<paleorange>
i want to saw off the parts of existing language don't fit
<paleorange>
that don't fit*
<paleorange>
mainly oop
<paleorange>
but modifying existing interpreter would require to get into c which i don't know
<Burgestrand>
paleorange so you want to make your own programming language? for a specific purpose or just because it's fun?
<paleorange>
so why not try to build an interpreter in an easier (overall) language instead of c
jeffreylevesque has quit [Ping timeout: 240 seconds]
bigblind has quit [Ping timeout: 256 seconds]
rasternode has quit [Ping timeout: 260 seconds]
chrisseaton has left #ruby [#ruby]
<paleorange>
i want to remake the language without the parts i don't need to use it in production straight away
<paleorange>
in this case it's php
<Burgestrand>
haha
<Burgestrand>
I'm sorry, but this sounds so trolly
swills has quit [Remote host closed the connection]
<paleorange>
i'm rolling my eyes so hard now
<Burgestrand>
Well, if production use straight away is your use-case I'm not the person to help you, even if full-time I had the time I couldn't with clear conscience help you build something that you intended for production use anywhere the coming three months
John_Ivan has quit [Read error: Connection reset by peer]
<Burgestrand>
Good luck :)
bigblind has joined #ruby
DaniG2k has joined #ruby
<paleorange>
i know where this is going, don't leave me hanging thankyouverymuch
John_Ivan has joined #ruby
gnufied has joined #ruby
<DaniG2k>
hello all. I am posting a form with images with Dropzone. I've almost gotten everything to work, the controller is receiving the images and input fields. Only one last thing isn't working. I've posted my question in full on SO
<ruby[bot]>
DaniG2k: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<DaniG2k>
oops sorry
<DaniG2k>
thought I was in that channel
<DaniG2k>
my bad
zapata has quit [Read error: Connection reset by peer]
infernix has joined #ruby
zapata has joined #ruby
<paleorange>
Burgestrand what i meant is producing usable version asap
<paleorange>
and then iterating on it on-the-fly
<Burgestrand>
paleorange while PHP was built fairly quickly originally, getting to the current version has taken 24 years, what time frame are you aiming for?
<paleorange>
not current
<paleorange>
php4-ish
swills has joined #ruby
swills has joined #ruby
<paleorange>
i.e. w/o oop as i said originally
swills_ has joined #ruby
swills_ has quit [Client Quit]
<paleorange>
and apache/nginx compatability has to be solved as well
white_lilies has quit [Ping timeout: 240 seconds]
<paleorange>
because it's a subset it should be compatible
bigblind has quit [Quit: Ping timeout (120 seconds)]
<RougeR>
i dont quite understand how the .each method is working
<RougeR>
would anyone be able to offer me some insight?
nowhere_man has quit [Ping timeout: 256 seconds]
haylon has joined #ruby
<pombreda>
would this be 2.3.1 ? or 2.3.0?
<pombreda>
RougeR, each is a way to make something iterable (aka in Ruby speak enumerable) so in this case list nodes in the tree
<pombreda>
since it is being called also inside the tree walking each for each of the nodes, this ends up walking the tree
<pombreda>
well anyway, for me, I will go to 2.3.1 :P
cdg has joined #ruby
amirite has quit [Ping timeout: 268 seconds]
<pombreda>
RougeR, if you are not familiar with recursion, that may look surprising :P
synthroid has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 276 seconds]
cdg has joined #ruby
white_lilies has joined #ruby
jcalla has joined #ruby
paleorange has quit [Ping timeout: 260 seconds]
gnufied has quit [Ping timeout: 260 seconds]
white_lilies has quit [Ping timeout: 268 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clemens3 has joined #ruby
vondruch has joined #ruby
Psybur has joined #ruby
jaruga has joined #ruby
gnufied has joined #ruby
rwb has joined #ruby
AJA4350 has quit [Remote host closed the connection]
AJA4350 has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
quobo has quit [Quit: Connection closed for inactivity]
amirite has joined #ruby
DaniG2k has quit [Quit: leaving]
cschneid has joined #ruby
ta_ has joined #ruby
synthroid has joined #ruby
schneide_ has quit [Remote host closed the connection]
_haylon has joined #ruby
amirite has quit [Ping timeout: 276 seconds]
schneide_ has joined #ruby
DLSteve has joined #ruby
schneide_ has quit [Remote host closed the connection]
cschneid has quit [Ping timeout: 260 seconds]
schneide_ has joined #ruby
haylon has quit [Ping timeout: 256 seconds]
rikkipitt has joined #ruby
hph^ has joined #ruby
pastorinni has joined #ruby
white_lilies has joined #ruby
cschneid has joined #ruby
danielpclark has quit [Ping timeout: 240 seconds]
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
white_lilies has quit [Ping timeout: 248 seconds]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has quit [Ping timeout: 265 seconds]
amirite has joined #ruby
John_Ivan has joined #ruby
apparition has joined #ruby
<RougeR>
pombreda: heya sorry got stuck down the rabbit hole
<RougeR>
im on 2.5.0
<RougeR>
and yeah i think ive grasped its using recursion now. ive reverse engineered it using a couple of if statements
<RougeR>
i understood the each statement, it was the how that was confusing me. im on the right track now
<RougeR>
and yeah ive never really used recursion much before
elphe has quit [Ping timeout: 276 seconds]
<RougeR>
thanks for your help
<apeiros>
RougeR: you could add code to emit .dot data to graph your tree :)
<apeiros>
might help with understanding what's going on
ta_ has quit [Remote host closed the connection]
<RougeR>
im alright with the understanding of whats going on now. recursion/tree wise
<RougeR>
im ending up with too many items in my returned array though
<RougeR>
just trying to get a look at the array now
ecuanaso has joined #ruby
danielpclark has joined #ruby
Burgestrand has quit [Quit: Closing time!]
sundhell is now known as sundhell_away
TinkerTyper has quit [Quit: ZNC 1.7.x-nightly-20180120-fcc710b4 - https://znc.in]
jottr_ has joined #ruby
white_lilies has joined #ruby
TinkerTyper has joined #ruby
jottr has quit [Ping timeout: 265 seconds]
arkinor has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
willamin has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
WA9ACE has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
white_lilies has quit [Ping timeout: 256 seconds]
WA9ACE has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
ecuanaso has joined #ruby
gregf_ has joined #ruby
jottr_ has quit [Ping timeout: 260 seconds]
white_lilies has joined #ruby
<Mrgoose2>
In ruby is it possible to determine what type an exception is? I would like to catch it in a rescue but im not sure what type of exception it is
apparition has quit [Quit: Bye]
jeffreylevesque has joined #ruby
<apeiros>
Mrgoose2: exceptions are ordinary objects. you can ask them all the things you can ask every object too.
<apeiros>
f.ex. Object#class
schneide_ has quit [Remote host closed the connection]
<Mrgoose2>
ah, easy enough
<apeiros>
the only specialty is that they are instance of Exception or a subclass (note: *never* raise exceptions which are instances of Exception, *never* subclass Exception directly. StandardError is the "lowest" thing to take)
white_lilies has quit [Ping timeout: 252 seconds]
oleo has joined #ruby
schneide_ has joined #ruby
Rapture has joined #ruby
jrafanie has joined #ruby
alfiemax has joined #ruby
arkinor has joined #ruby
cschneid has joined #ruby
LastWhisper____ has joined #ruby
cschneid has quit [Ping timeout: 255 seconds]
stormpack has joined #ruby
desperek has joined #ruby
alfiemax has quit [Remote host closed the connection]
drcode has joined #ruby
drcode has quit [Remote host closed the connection]
tlaxkit has joined #ruby
d10n-work has joined #ruby
x77686d has joined #ruby
Psybur has quit [Ping timeout: 264 seconds]
npgm has joined #ruby
drewmcmillan has joined #ruby
amirite has quit [Ping timeout: 256 seconds]
marr has quit [Ping timeout: 260 seconds]
white_lilies has joined #ruby
rippa has joined #ruby
danielpclark has quit [Quit: Leaving]
white_lilies has quit [Ping timeout: 248 seconds]
milardovich has joined #ruby
rikkipitt has quit [Remote host closed the connection]
<apeiros>
and since obviously @root can be nil, BinaryTree#nodes would need checking.
<apeiros>
gtg. dminuoso can surely help with the rest :D
<RougeR>
thanks for your time, catchya later
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Psybur has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
x77686d has quit [Quit: x77686d]
hph^ has quit [Ping timeout: 248 seconds]
apeiros has quit []
InfinityFye has quit [Ping timeout: 256 seconds]
zaibitsu has joined #ruby
zaibitsu has left #ruby [#ruby]
conta has quit [Ping timeout: 255 seconds]
aufi_ has quit [Quit: Leaving]
yohji has quit [Remote host closed the connection]
x77686d has joined #ruby
rikkipitt has quit [Quit: Leaving...]
plexigras has quit [Ping timeout: 256 seconds]
troys has joined #ruby
za1b1tsu_ has joined #ruby
za1b1tsu_ has quit [Client Quit]
za1b1tsu has joined #ruby
hph^ has joined #ruby
hph^ has quit [Max SendQ exceeded]
plexigras has joined #ruby
vondruch has quit [Ping timeout: 240 seconds]
rrutkowski has joined #ruby
white_lilies has joined #ruby
rrutkowski has quit [Client Quit]
schneide_ has quit [Remote host closed the connection]
sergio_101 has joined #ruby
rrutkowski has joined #ruby
infernix has joined #ruby
white_lilies has quit [Ping timeout: 276 seconds]
rrutkowski has quit [Remote host closed the connection]
schneide_ has joined #ruby
rrutkowski has joined #ruby
nowhereman_ has quit [Ping timeout: 276 seconds]
oetjenj has joined #ruby
Meowcenary has joined #ruby
rrutkowski has quit [Client Quit]
cagomez has joined #ruby
rrutkowski has joined #ruby
x77686d has quit [Quit: x77686d]
drewmcmillan has joined #ruby
schneide_ has quit [Remote host closed the connection]
Xentil has joined #ruby
<Xentil>
How can i end execution of block? When i use "return" i get "client.rb:50:in `block (2 levels) in <main>': unexpected return (LocalJumpError)" error. When i use "break" i get "client.rb:50:in `block (2 levels) in <main>': break from proc-closure (LocalJumpError)" error.
<Xentil>
So ?
Ishido has quit [Remote host closed the connection]
nickjj_ is now known as nickjj
marmorkreb has quit [Remote host closed the connection]
jottr has joined #ruby
marmorkreb has joined #ruby
oetjenj has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ishido has joined #ruby
x77686d has joined #ruby
marmorkreb has quit [Ping timeout: 248 seconds]
<canton7>
Xentil, 'next'
<canton7>
think about a block passed to #each -- 'next' exits the block early, 'return' exits the scope around the #each itself
<Xentil>
canton7: Ok, thanks
x77686d has quit [Quit: x77686d]
herbmillerjr has quit [Quit: Konversation terminated!]
<dminuoso>
canton7: and no, `return` does not exit the scope around each, but it returns control to the topmost method or lambda on the current callstack.
<dminuoso>
Which can be surprisingly frustratring depending on your level of nesting inside blocks and procs.
<canton7>
true, I meant 'break' not 'return'
<dminuoso>
canton7: You cant use `break` like that.
andikr has quit [Remote host closed the connection]
<dminuoso>
Or at least I dont think you should be able to d
<canton7>
and your gist says "return control to the caller of the topmost method or lambda" -- to the *caller* of the topmost method of lambda. Not to the topmost method or lambda itself, which is what you said just above
raynold has joined #ruby
<dminuoso>
okay let me modify because I realized its still a bit off.
<dminuoso>
canton7: it returns control past the end of the topmost method lambda or method.
<dminuoso>
(that includes the current active stack frame)
<canton7>
why not just "returns from the topmost method lambda or method"?
<dminuoso>
It seems as if the catch table is set up in the current stack frame when the proc is created.
angrywombat has left #ruby [#ruby]
<dminuoso>
But.. that doesn't. Stupid. Ill file a bug report.
jamesaxl has quit [Read error: Connection reset by peer]
darkhanb has joined #ruby
jamesaxl has joined #ruby
Chronocity has quit [Ping timeout: 256 seconds]
megamos has joined #ruby
Kilo`byte has quit [Ping timeout: 240 seconds]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneide_ has joined #ruby
Kilo`byte has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
osvico has joined #ruby
mtkd has joined #ruby
drewmcmillan has joined #ruby
nyuszika7h_ is now known as nyuszika7h
noobineer has quit [Ping timeout: 256 seconds]
milardovich has joined #ruby
Dimik has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
garyserj has quit []
LastWhisper____ has joined #ruby
aupadhye has quit [Ping timeout: 256 seconds]
AxelAlex has joined #ruby
marmorkreb has joined #ruby
marmorkreb has quit [Remote host closed the connection]
rrutkowski has quit [Quit: rrutkowski]
white_lilies has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
Bob8989|2 has joined #ruby
white_lilies has quit [Ping timeout: 265 seconds]
RougeR has quit [Ping timeout: 256 seconds]
dviola has joined #ruby
Beams has quit [Quit: .]
Guest86910 has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
milardovich has quit [Remote host closed the connection]
terens has joined #ruby
<terens>
Hi
<terens>
I am stuck with naming classes
<havenwood>
terens: say more?
<terens>
I want lets a say a class named Wire . however wire would use lots of other classes / layers. So if I make a directory wire then Wire would normally be a module.
qba73 has quit [Ping timeout: 260 seconds]
<havenwood>
terens: You can use either a module or a class as a namespace. Does Wire have no state, only one instance of state, or multiple instances of state?
<terens>
It would be initialized with constructor. I know that I can but I haven't seen it in any gem