baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
akaiiro has quit [Ping timeout: 250 seconds]
ta_ has quit [Ping timeout: 252 seconds]
cagomez has joined #ruby
infernix has quit [Ping timeout: 250 seconds]
dbz has quit [Remote host closed the connection]
sameerynho has quit [Ping timeout: 246 seconds]
rubydoc has quit [Ping timeout: 250 seconds]
phaul has quit [Ping timeout: 250 seconds]
duderonomy has quit [Ping timeout: 276 seconds]
orbyt_ has joined #ruby
infernix has joined #ruby
TomyLobo has quit [Read error: Connection reset by peer]
beeman has quit [Quit: Connection closed for inactivity]
acwatt has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dbz has joined #ruby
darkhanb has joined #ruby
dbz has quit [Ping timeout: 252 seconds]
duderonomy has joined #ruby
Azure has quit [Ping timeout: 268 seconds]
nowhereman_ has quit [Ping timeout: 252 seconds]
tdy has joined #ruby
nowhereman_ has joined #ruby
dbz has joined #ruby
za1b1tsu has joined #ruby
pskosinski has quit [Ping timeout: 252 seconds]
pskosinski has joined #ruby
zwliew has joined #ruby
dinfuehr has quit [Ping timeout: 252 seconds]
dinfuehr has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
darkhanb has joined #ruby
darkhanb has quit [Client Quit]
Azure has joined #ruby
dviola has quit [Quit: WeeChat 2.2]
uplime has joined #ruby
jetchisel has quit [Ping timeout: 252 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akaiiro has joined #ruby
arescorpio has joined #ruby
dinfuehr has quit [Ping timeout: 250 seconds]
moei has joined #ruby
dinfuehr has joined #ruby
_whitelogger has joined #ruby
dinfuehr has quit [Ping timeout: 244 seconds]
dinfuehr has joined #ruby
braincrash has quit [Quit: bye bye]
dinfuehr_ has joined #ruby
dinfuehr has quit [Ping timeout: 252 seconds]
braincrash has joined #ruby
dinfuehr_ has quit [Ping timeout: 252 seconds]
dinfuehr has joined #ruby
dinfuehr has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
arescorpio has quit [Remote host closed the connection]
aeze has quit [Quit: The Lounge - https://thelounge.github.io]
Nicmavr has quit [Read error: Connection reset by peer]
dinfuehr has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
Nicmavr has joined #ruby
arescorpio has joined #ruby
dinfuehr has quit [Ping timeout: 252 seconds]
druonysus has quit [Ping timeout: 252 seconds]
dinfuehr has joined #ruby
vutral has quit [Ping timeout: 260 seconds]
dinfuehr has quit [Ping timeout: 245 seconds]
dinfuehr has joined #ruby
za1b1tsu has quit [Ping timeout: 250 seconds]
zwliew has quit [Quit: Connection closed for inactivity]
za1b1tsu has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mahlon has quit [Ping timeout: 252 seconds]
tdy has quit [Ping timeout: 252 seconds]
arescorpio has quit [Quit: Leaving.]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
graphene has quit [Remote host closed the connection]
AKPWD has quit [Quit: じゃね。]
graphene has joined #ruby
AKPWD has joined #ruby
cagomez has quit [Ping timeout: 244 seconds]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
mahlon has joined #ruby
dinfuehr has quit [Ping timeout: 244 seconds]
orbyt_ has joined #ruby
dinfuehr has joined #ruby
ta_ has joined #ruby
akaiiro has quit [Ping timeout: 268 seconds]
armyriad has quit [Ping timeout: 252 seconds]
armyriad has joined #ruby
rippa has joined #ruby
P1RATEZ has quit []
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
beeman has joined #ruby
ta_ has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has joined #ruby
tdy has quit [Client Quit]
akaiiro has joined #ruby
cow[moo] has joined #ruby
acwatt has quit [Ping timeout: 252 seconds]
BTRE has quit [Remote host closed the connection]
cow[moo] has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has joined #ruby
rubydoc has joined #ruby
BTRE has joined #ruby
MaiconVieira has quit [Ping timeout: 252 seconds]
nowhereman_ has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
mixfix41 has joined #ruby
reber has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
za1b1tsu has joined #ruby
venmx has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
conta has joined #ruby
cow[moo] has joined #ruby
cow[moo] has quit [Client Quit]
ta_ has joined #ruby
akaiiro has quit [Remote host closed the connection]
reber__ has joined #ruby
reber has quit [Ping timeout: 252 seconds]
mixfix41 has quit [Ping timeout: 250 seconds]
mixfix41 has joined #ruby
ta_ has quit [Ping timeout: 250 seconds]
_whitelogger has joined #ruby
_whitelogger has joined #ruby
Dimik has quit [Ping timeout: 268 seconds]
RougeR has joined #ruby
wildermind has joined #ruby
sameerynho has joined #ruby
conta has quit [Read error: Connection reset by peer]
conta has joined #ruby
throwntall has quit [Remote host closed the connection]
throwntall has joined #ruby
ta_ has joined #ruby
floehopper has joined #ruby
ams__ has joined #ruby
floehopper has quit []
venmx has quit [Ping timeout: 245 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
za1b1tsu has joined #ruby
ta_ has quit [Ping timeout: 272 seconds]
za1b1tsu has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ruby
djellemah has quit [Ping timeout: 268 seconds]
vutral1 has joined #ruby
kapil____ has joined #ruby
gigetoo has joined #ruby
volix has quit [Quit: leaving]
volix has joined #ruby
ellcs has joined #ruby
ua_ has quit [Ping timeout: 252 seconds]
ellcs has quit [Ping timeout: 250 seconds]
ua has joined #ruby
dbz has quit [Remote host closed the connection]
ta_ has joined #ruby
nowhereman_ has quit [Ping timeout: 252 seconds]
mike11 has joined #ruby
BTRE has quit [Remote host closed the connection]
BTRE has joined #ruby
evdubs_ has joined #ruby
desperek has joined #ruby
evdubs has quit [Ping timeout: 250 seconds]
asphyxia has quit [Ping timeout: 244 seconds]
Turnikov[m] has quit [Ping timeout: 276 seconds]
sticaz has joined #ruby
venmx has joined #ruby
beeman has quit [Quit: Connection closed for inactivity]
bougyman has quit [Ping timeout: 264 seconds]
sticaz has quit [Quit: sticaz]
bougyman has joined #ruby
venmx has quit [Ping timeout: 246 seconds]
jtperreault has quit [Ping timeout: 246 seconds]
jtperreault has joined #ruby
ta_ has quit [Ping timeout: 252 seconds]
jyaworski_ has joined #ruby
apparition has joined #ruby
jyaworski_ is now known as jyaworski
jetchisel has joined #ruby
conta has quit [Remote host closed the connection]
GodFather has joined #ruby
conta has joined #ruby
Turnikov[m] has joined #ruby
venmx has joined #ruby
beeman has joined #ruby
GodFather has quit [Ping timeout: 244 seconds]
MoritaShinobu has joined #ruby
hakanai has joined #ruby
<hakanai> Hi guys. I want to receive a mail everytime a exception is raised in the application, so I added in the end of the module "rescue => e ; <CODE TO SEND MAIL> ; raise ; end".
<hakanai> Is there a better way to do it? It seems ugly
ams__ has quit [Quit: Connection closed for inactivity]
<hakanai> https://dpaste.de/fqy2 I'm using it
<phaul> hakani I dont think that does what you expect
<phaul> hakanai: sorry, for mistyping your name
<phaul> the code that's in module runs when the Module is loaded. any exception in code that's in methods in that module will not send emails.
<phaul> sending email was not output...
<al2o3-cr> hakanai: you can use TracePoint.new(:raise) { ... }
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zapata has joined #ruby
<hakanai> oh thank you phaul, you have a point
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
<hakanai> al2o3-cr: it works nicely
<hakanai> thanks
runjutsu has joined #ruby
<runjutsu> hello everyone.
<runjutsu> how can you and I together make the world a better place?
<runjutsu> answer me or I will pick up a machine gun and shoot down every single one of you
<runjutsu> I am warning you >=(
* runjutsu kills everyone
<runjutsu> you're now dead so nobody can reply anymore.
apparition has quit [Quit: Bye]
GodFather has joined #ruby
mike11 has quit [Quit: Leaving.]
ta_ has joined #ruby
ta_ has quit [Ping timeout: 252 seconds]
hakanai has quit [Quit: Lost terminal]
kapil____ has quit [Quit: Connection closed for inactivity]
<havenwood> !badnick runjutsu
runjutsu was kicked from #ruby by ruby[bot] [nickname is not suitable for this channel, see http://ruby-community.com/pages/user_rules]
uplime has quit [Ping timeout: 268 seconds]
gheegh has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
MoritaShinobu has quit [Quit: Leaving]
houhoulis has joined #ruby
ta_ has joined #ruby
_whitelogger has joined #ruby
Azure has quit [Ping timeout: 268 seconds]
conta has quit [Quit: conta]
conta1 has joined #ruby
conta1 has quit [Client Quit]
Azure has joined #ruby
GodFather has quit [Ping timeout: 250 seconds]
ta_ has quit [Ping timeout: 245 seconds]
kurko_ has joined #ruby
venmx has quit [Remote host closed the connection]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
sticaz has joined #ruby
uplime has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
mike11 has joined #ruby
ta_ has joined #ruby
venmx has joined #ruby
cow[moo] has joined #ruby
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tockitj has joined #ruby
nowhereman_ has joined #ruby
knight33 has joined #ruby
orbyt_ has joined #ruby
mike11 has quit [Quit: Leaving.]
GodFather has joined #ruby
ta_ has quit [Ping timeout: 276 seconds]
conta has joined #ruby
conta has quit [Remote host closed the connection]
RougeR has quit [Ping timeout: 252 seconds]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta_ has joined #ruby
ta_ has quit [Read error: Connection reset by peer]
kurko_ has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nowhereman_ has quit [Ping timeout: 244 seconds]
kurko_ has quit [Client Quit]
nowhere_man has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
dellavg_ has joined #ruby
dbz has joined #ruby
thejamespinto has joined #ruby
<thejamespinto> Hi Everyone!
<thejamespinto> https://github.com/ruby/ruby Could anybody please help me understand where the statements for if/else and for/for-in are declared in the ruby sources?
beeman has quit [Quit: Connection closed for inactivity]
<uplime> i doubt they're declared in any one place
<uplime> what specifically are you looking for?
jetchisel has quit [Quit: Unfortunately time is always against us -- [Morpheus]]
beeman has joined #ruby
voker57 has joined #ruby
schneider has joined #ruby
uplime has quit [Ping timeout: 252 seconds]
Exuma has joined #ruby
schneider has quit [Quit: WeeChat 2.0.1]
nchambers has joined #ruby
za1b1tsu has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
<phaul> &what_is size
<rubydoc> It's a(n) method name.
MyMind has quit [Excess Flood]
MyMind has joined #ruby
Dimik has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
gheegh has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
gheegh has quit [Quit: Textual IRC Client: www.textualapp.com]
Dimik has quit [Ping timeout: 244 seconds]
houhoulis has quit []
za1b1tsu has quit [Ping timeout: 245 seconds]
Exuma has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 245 seconds]
RougeR has joined #ruby
qolq has joined #ruby
darkhanb has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
Exuma has joined #ruby
ua_ has joined #ruby
beeman has quit []
ua has quit [Ping timeout: 268 seconds]
sarmiena_ has joined #ruby
Puffball has quit [Remote host closed the connection]
Puffball has joined #ruby
beeman has joined #ruby
jetchisel has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> phaul: is there any case where it is actually "an" for this?
darkhanb has joined #ruby
<phaul> uh. no. :D I didn't even asked that question
<thejamespinto> https://github.com/ruby/ruby Could anybody please help me understand where the statements for if/else and for/for-in are declared in the ruby sources?
duderonomy has joined #ruby
<apeiros> thejamespinto: parse.y probably?
ellcs has joined #ruby
darkhanb has quit [Client Quit]
<phaul> &what_is Array#size
<rubydoc> It's a(n) instance method.
<apeiros> oooh
<apeiros> right! :D
<thejamespinto> apeiros: I'd never have guessed it
nowhere_man has quit [Ping timeout: 272 seconds]
duderonomy has quit [Client Quit]
<thejamespinto> apeiros: do you think a loop/else can be written in Ruby? Just like there is one in Handlebars?
<apeiros> you mean whether you could change ruby's syntax? if you know your stuff, sure. I wouldn't be able to without a substantial time investment.
<thejamespinto> apeiros: could you please help me find where for/for-in are declared in that file? https://github.com/ruby/ruby/blob/trunk/parse.y
MaiconVieira has joined #ruby
MaiconVieira has quit [Client Quit]
<thejamespinto> yeah, I had just found them, too k_for
<thejamespinto> I think what needs to happen there is that every for would need to be added around an if statement internally, so that'd be achievable
<apeiros> that'd run the loop condition twice
<apeiros> ah, too much C++ before. loop doesn't have a condition (so can't be wrapped in an if) and for/in works differently. anyway. have fun, I'm off :)
<thejamespinto> apeiros: haha, thanks
<thejamespinto> what I mean to say is that maybe it'd be needed to internally wrap that loop inside an IF, so you can have the ELSE
<thejamespinto> but maybe it can simply be added as an extra `UNLESS arg` in the end that takes in the second block
<thejamespinto> I see possibilities :D
<thejamespinto> thank you so much, apeiros :D
rubydoc has quit [Remote host closed the connection]
<phaul> thejamespinto: so the goal is to change Ruby syntax introducing a new control structure? Like a loop/conditional statement hybrid?
<thejamespinto> yes
<thejamespinto> the average rubist would prefer to use `[].each { |x| puts x } else { puts "so lonely" }`
<thejamespinto> but each is a method on Enumerable, so I decided to investigate what using FOR would look like
<thejamespinto> so.. `for x in [] { puts x } else { puts "so lonely" }`
<phaul> an other / easier way would be to have an each like method that returns true / false value
sarmiena_ has quit [Quit: sarmiena_]
<phaul> [].each_or_false { |x| puts x } || { puts "so lonely" }
<phaul> better name each_or_else
<phaul> oh. wait a minute...
<thejamespinto> phaul: I have to admit, I like this structure better than any of the other ones I've seen, or came up with
<phaul> [].each_or_false { |x| puts x } or { puts "so lonely" }
<phaul> with || its syntax error. but with keyword or it would work
darkhanb has joined #ruby
<thejamespinto> phaul: yeah, but the problem is that the target audience for this structure is people who use ERB
<thejamespinto> How many times have you seen a list of things that was empty and it did not state that it was empty?
<thejamespinto> I'm not trying to come up with an ingenious ugly-looking hack
<thejamespinto> but the issue I've found is that we'd have to essentially change the structure of the else statement
<thejamespinto> so it would know if it's tied to an IF or to a FOR
<thejamespinto> which explains why we don't have unless/else
<thejamespinto> I say it'd be easier to just write a new keyword to try to add it to Ruby
<thejamespinto> such as k_otherwise
rubydoc has joined #ruby
<thejamespinto> <% for user in @users %><% otherwise %><% end %>
<thejamespinto> and that simply works as if you had written `unless @users`
<thejamespinto> the language for .y files is called yacc https://ruby-hacking-guide.github.io/yacc.html
<thejamespinto> That's the most disgusting programming acronym I have ever seen
<phaul> "it'd be easier to just write a new keyword" OK :)
<phaul> welcome to the realm of "53 reduce conflict in grammar" error messages ..."
<phaul> I would say it's really difficult
duderonomy has joined #ruby
<phaul> and that's just the parser part. Then comes the code for code generation in the VM instruction sequence. and then comes along JIT
djellemah has joined #ruby
nowhere_man has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
<thejamespinto> phaul: I'm not saying it's dead-easy. But a new keyword would showcase the benefit of the syntax and that'd get the conversation started on making it work with the existing `else`
<thejamespinto> tenderlover has a gem that may help with this https://github.com/tenderlove/racc
<phaul> thejamespinto: look, I really don't want to stop you doing that. If you manage to do it, you will learn a lot about ruby internals. also there is no harm in trying.
<phaul> I dont think racc is relevant for this
<thejamespinto> is there a good place to learn how to use YACC with the objective of adding a custom keyword to Ruby?
<thejamespinto> I could not find a real proper place
<phaul> it's bison for ruby yacc is very old
dbz has quit [Remote host closed the connection]
<thejamespinto> phaul: do you think each/else could be created as a gem?
<phaul> I don't know. you can do some background research in general related to compilers / gammars , parser
dellavg_ has quit [Ping timeout: 244 seconds]
<phaul> there is a good book, I found. I can try to get a link if it's still online...
<thejamespinto> I never took a proper compilers course
dviola has joined #ruby
<phaul> there is a lot to the topic. Background knowledge would really help you in this
<phaul> sorry, I can't find the link for the book :(
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
reber__ has quit [Read error: Connection reset by peer]
g- has quit [Ping timeout: 246 seconds]
g- has joined #ruby
dbz has joined #ruby
<thejamespinto> phaul: think that could be delivered as a ruby gem?
ponga has joined #ruby
<phaul> no. The ruby syntax cannot be altered as a gem. You can flex the already existing muscles of ruby syntax to the limits, and many gems do that to the extent that you first don't think it's ruby, think about rspec, rake, -- Qo :) but you can't change keywords from a gem
Azure has quit [Ping timeout: 246 seconds]
dbz has quit [Ping timeout: 246 seconds]
<thejamespinto> phaul: in that case, can you help me locate where Enumerable#each is declared?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
Exuma has quit [Quit: Textual IRC Client: www.textualapp.com]
<phaul> Enumerable#each is not implemented I think. the point is that every other Enumerable method would rely on each. Including classes have to implement #each to fullfil the Enumerable contract.
<phaul> &ri Enumerable#each
<rubydoc> Found no entry that matches class Enumerable instance method each.
<phaul> &ri Array#each
<thejamespinto> Well, come to think about it
<thejamespinto> Now I can literally look for the original method definition in C
<thejamespinto> rb_ary_each
* phaul afk
dbz has joined #ruby
code_zombie has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
mikecmpbll has joined #ruby
dbz has quit [Remote host closed the connection]
tubbo has joined #ruby
tubbo has quit [Client Quit]
pabs has quit [Ping timeout: 252 seconds]
cd has joined #ruby
cd has quit [Client Quit]
tubbo has joined #ruby
tubbo has quit [Client Quit]
tubbo has joined #ruby
tubbo has quit [Client Quit]
tubbo has joined #ruby
tubbo has quit [Client Quit]
pabs has joined #ruby
cd has joined #ruby
tubbo has joined #ruby
tubbo has quit [Client Quit]
za1b1tsu has joined #ruby
clemens3 has joined #ruby
cd has quit [Quit: cd]
cd has joined #ruby
za1b1tsu has quit [Ping timeout: 244 seconds]
themsay has joined #ruby
themsay has quit [Read error: Connection reset by peer]
themsay has joined #ruby
dbz has joined #ruby
Axy has quit [Read error: Connection reset by peer]
kurko_ has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
houhoulis has joined #ruby
<_ari> hm
dbz has quit [Remote host closed the connection]
thejamespinto has quit [Remote host closed the connection]
marmotini_ has joined #ruby
ellcs has quit [Ping timeout: 250 seconds]
marmotini_ has quit [Client Quit]
marmotini_ has joined #ruby
marmotini_ has quit [Client Quit]
marmotini_ has joined #ruby
desperek has quit [Quit: xoxo]
IanMalcolm has joined #ruby
IanMalcolm has quit [Client Quit]
dbz has joined #ruby
dbz has quit [Ping timeout: 244 seconds]
GodFather has joined #ruby
marmotini_ has quit [Quit: Leaving]
marmotini_ has joined #ruby
akaiiro has joined #ruby
dbz has joined #ruby
venmx has quit [Ping timeout: 246 seconds]
phaul has quit [Ping timeout: 245 seconds]
venmx has joined #ruby
nowhere_man has quit [Ping timeout: 276 seconds]
nowhere_man has joined #ruby
ponga has quit [Quit: Connection closed for inactivity]
venmx has quit [Ping timeout: 245 seconds]
graphene has quit [Remote host closed the connection]
kurko__ has joined #ruby
graphene has joined #ruby
kurko_ has quit [Ping timeout: 246 seconds]
clemens3 has quit [Ping timeout: 252 seconds]
sameerynho has quit [Ping timeout: 272 seconds]
dbz has quit [Remote host closed the connection]
dbz has joined #ruby
dbz has quit [Read error: Connection reset by peer]
dbz has joined #ruby
Dimik has joined #ruby
marmotini_ has quit [Ping timeout: 245 seconds]
IanMalcolm has joined #ruby
IanMalcolm has quit [Client Quit]
orbyt_ has joined #ruby
elcontrastador has joined #ruby
jyaworski has quit [Quit: ZNC - http://znc.in]
jyaworski has joined #ruby
dbz has quit [Ping timeout: 272 seconds]
graphene has quit [Remote host closed the connection]
kurko__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
ur5us has joined #ruby
segy has quit [Quit: ZNC - http://znc.in]
duderonomy has quit [Client Quit]
tdy has joined #ruby
segy has joined #ruby