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!
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Write error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Write error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Write error: Connection reset by peer]
apeiros_ has quit [Ping timeout: 246 seconds]
<havenwood> the gem name "php" is available
<havenwood> speaking of gem names, the "_" gem is pretty nifty...
<havenwood> can't get it to actually work, but fancy
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kujira has quit [Ping timeout: 245 seconds]
kujira has joined #ruby
Giruvagen has quit [Ping timeout: 245 seconds]
kujira has quit [Client Quit]
weaksauce has joined #ruby
Dark_Arc has quit [Quit: ZNC 1.6.5 - http://znc.in]
<Radar> Is there a shorter / cleaner way of doing the comparison in this code? https://gist.github.com/radar/f079875d0379600e9fc2446cb513ebf8
<Radar> I think asking answer to check an internal value (question) from a separate class is a smell, but I can't think of a shorter way to write rit.
<Radar> write it*
<Radar> Maybe I'm being too picky?
Dark_Arc has joined #ruby
jottr has joined #ruby
im0nde has quit [Ping timeout: 252 seconds]
<havenwood> Radar: What's `question.class`?
<Radar> Question
<baweaver> answers.select(&Qo[question: question, value: 3])
<baweaver> :D
<Radar> baweaver: hax
<baweaver> Ah, less than
<baweaver> answers.select(&Qo[question: question, value: ..3])
<Radar> does qo... of course it does
jottr has quit [Ping timeout: 272 seconds]
<Radar> Isn't that only a Ruby 2.6 syntax?
<baweaver> That, yes
<baweaver> Though I assume it's 0 to 3 or so?
<baweaver> answers.select(&Qo[question: question, value: 0..3])
<Radar> 1..2 for this check
<Radar> answer values are 1-5
<Radar> low ones are 1-2
<baweaver> Oh, right, I have a spoiler for ya
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> that's pretty succinct to me.
apparition has joined #ruby
<Radar> Here's a bigger file that I'm playing around in: https://gist.github.com/radar/26a95a7e9b6dfc2558af6e2b6dea27bd
<Radar> I like: answers.select(&for_question(question)).select(&:low?), but it does two loops through the questions
<baweaver> OH! You have methods?
<Radar> If there was a way somehow to combine the functions and only make one loop it'd be better
<Radar> yeah! :D
<baweaver> Guess what else Qo does :D
<baweaver> answers.select(&Qo[:low?, for_question(question)])
<baweaver> I _could_ make it play nice with both hash and array matchers at once to do something more like this:
<al2o3-cr> beautiful Ruby syntax ;)
<baweaver> answers.select(&Qo[:low?, question: question])
<baweaver> Though by that point it'd double equal the value, so...
<baweaver> answers.select(&Qo[:low?, question])
<baweaver> That works
<baweaver> Xf and Qo both are used in production, so it well is now :D
<baweaver> Ah, nevermind, that last shorthand assumes exact equality
<baweaver> I may just make it do both styles (array and hash) to give more flexibility
<al2o3-cr> all methods <2 lines.
Guest61135 has joined #ruby
<Radar> answers.select(&Qo[:low?, question]) <- this works? How?!
<Radar> Time to gem install
<Radar> baweaver: that doesn't work for me
<baweaver> It doesn't
Guest61135 has quit [Ping timeout: 240 seconds]
<baweaver> noted it right after
<Radar> oh right
im0nde has joined #ruby
<baweaver> Name punning would be nice though
<Radar> Both examples don't seem to work for me
<baweaver> the one with both array and hash won't
<baweaver> I'd have to fix a few things
<baweaver> give me a bit on that one, could have it done in a few hours or less.
<Radar> Code like this makes me wish Ruby had Elixir's pipe operator
<Radar> x |> a.call |> b.call
apeiros_ has joined #ruby
<Radar> or x |> a.() |> b.()
Tempesta has joined #ruby
duderonomy has joined #ruby
Cork has joined #ruby
<havenwood> Radar: Interestingly, with your code example, the multiple iterations are faster than a single pass: https://gist.github.com/havenwood/e0ac0fec4b53143603b687530d818175
<havenwood> At least on CRuby 2.5.1
<havenwood> TruffleRuby is an order of magnitude faster overall, but single iteration clearly wins.
<Radar> TIL
armyriad has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
siaw23 has quit [Quit: siaw23]
white_lilies has joined #ruby
jottr has joined #ruby
<al2o3-cr> havenwood: what core processor is that on?
<havenwood> al2o3-cr: 4 physical
<baweaver> Oh right. Qo benchmarks are going to go straight to hell now XD
<al2o3-cr> havenwood: what speed?
<havenwood> al2o3-cr: 2.8 GHz Intel Core i7
<havenwood> TruffleRuby is two* orders of magnitude faster
<baweaver> 2.9GHz 6-core Intel Core i9 (8th gen)
* baweaver wonders what that does to the current benchmark
<al2o3-cr> havenwood: gist your code i'll try on my 2 core i7 2.9 Ghz
<havenwood> baweaver: hahaha
<havenwood> it folds this one away nicely
<havenwood> al2o3-cr: k, sec
<al2o3-cr> baweaver: get an xeon platinum haha ;)
<baweaver> I was about to be really happy too at some of the speed improvements T_T
jottr has quit [Ping timeout: 252 seconds]
<al2o3-cr> havenwood: ok, cheers pal
<al2o3-cr> havenwood: thank you.
<havenwood> baweaver: I'm curious what numbers you get on TruffleRuby with that 6-core... :)
<baweaver> As soon as I figure out why my Ruby install refuses to put ffi in...
cagomez has joined #ruby
<havenwood> baweaver: libffi isn't dynamically linking right?
<baweaver> Xcode is good, brew is now unborked (mac clone works great for non ruby things)
<baweaver> "Make sure that `gem install ffi -v '1.9.23' --source 'https://rubygems.org/'` succeeds before bundling."
<baweaver> running around doing the SO dance for now
<al2o3-cr> i need to upgrade my laptop haha ;)
<havenwood> baweaver: Sanity check?: brew --prefix libffi #=> /usr/local/opt/libffi
<al2o3-cr> baweaver: i'd like to see what this produces on yours
<havenwood> al2o3-cr: confirmed, multiple iterations with block optimizations ftw
<havenwood> al2o3-cr: nifty
<al2o3-cr> aye ;)
<havenwood> nice when the version that reads better happens to be faster too
<al2o3-cr> exactly.
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver> brew --prefix libffi
<baweaver> /usr/local/opt/libffi
yqrashawn has joined #ruby
TheBloke has quit [Read error: Connection reset by peer]
TheBloke has joined #ruby
<baweaver> havenwood: shenanigans ^
<al2o3-cr> baweaver: whats the ffi for?
esrse has joined #ruby
<al2o3-cr> oh, libnotify
<al2o3-cr> well rb-notify
<al2o3-cr> last time i used osx was years ago.
<al2o3-cr> did you run this? gem install ffi -v '1.9.23' --source 'https://rubygems.org/'
<baweaver> Same thing
<baweaver> Will hunt it down later
cagomez has quit [Remote host closed the connection]
<evdubs_> stupid question - if i define == in a class, do i also need to define != ?
evdubs_ is now known as evdubs
<havenwood> baweaver: doesn't *happen* to get resolved after a?: brew install automake
<baweaver> it's installed
<havenwood> baweaver: ah, then that can' tbe it!
agent_white has quit [Quit: leaving]
<al2o3-cr> evdubs: try; def ==() nil end is the bomb ;)
<al2o3-cr> evdubs: then def ==(*) end
FrankyCyborg has left #ruby [#ruby]
<baweaver> aha, got it
<baweaver> danged thing
<al2o3-cr> havenwood: def ==() end in pry
ZzZombo has quit [Ping timeout: 252 seconds]
Xiti has quit [Quit: Xiti]
<al2o3-cr> baweaver: pretty rapido.
<baweaver> About to give it to Truffle once that installs
<al2o3-cr> baweaver: is 2.9 Ghz per core?
<baweaver> Not sure
<baweaver> I just got the highest revv'd macbook I could
<al2o3-cr> sweet
<al2o3-cr> i asked because if you not doing multiprocessing singular core will perform faster.
<al2o3-cr> given core/speed
<baweaver> Gah, now Truffle is mad at me
<baweaver> llvm shenanigans
Xiti has joined #ruby
<baweaver> whoopsie, truffle doesn't like refinements
<baweaver> havenwood save us
Guest61135 has joined #ruby
Guest61135 has quit [Ping timeout: 272 seconds]
ZzZombo has joined #ruby
white_lilies has quit [Ping timeout: 246 seconds]
gnufied has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Quit: AJA4350]
zapata has quit [Read error: Connection reset by peer]
nowhere_man has quit [Remote host closed the connection]
arooni has quit [Ping timeout: 252 seconds]
nowhere_man has joined #ruby
arooni has joined #ruby
zapata has joined #ruby
ivanskie has joined #ruby
braincrash has quit [Quit: bye bye]
<evdubs> al2o3-cr, havenwood, thanks
lytol_ has joined #ruby
infernix has quit [Ping timeout: 252 seconds]
zapata has quit [Ping timeout: 252 seconds]
bheesham has quit [Ping timeout: 252 seconds]
bheesham has joined #ruby
braincrash has joined #ruby
zapata has joined #ruby
jottr has joined #ruby
infernix has joined #ruby
gix has quit [Disconnected by services]
mistergibson has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 244 seconds]
dellavg_ has joined #ruby
TheBloke has quit [Read error: Connection reset by peer]
TheBloke has joined #ruby
thy0 has quit [Quit: TTFN]
jottr has joined #ruby
moei has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 252 seconds]
terens has joined #ruby
Sembei has quit [Max SendQ exceeded]
Sembei has joined #ruby
terens has quit [Ping timeout: 244 seconds]
tdy has joined #ruby
pwnd_nsfw has quit [Read error: Connection reset by peer]
sheepman has quit [Ping timeout: 245 seconds]
reber has joined #ruby
sheepman has joined #ruby
pwnd_nsfw has joined #ruby
johnny56 has quit [Ping timeout: 272 seconds]
za1b1tsu has joined #ruby
Jakoonce has quit [Quit: Leaving]
Guest61135 has joined #ruby
Guest61135 has quit [Ping timeout: 244 seconds]
idiocrash has joined #ruby
dellavg_ has quit [Ping timeout: 240 seconds]
yqrashawn has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
johnny56 has joined #ruby
Inline has quit [Quit: Leaving]
Cork has quit [Quit: .]
Cork has joined #ruby
_whitelogger has joined #ruby
cliluw has joined #ruby
aufi has joined #ruby
mike11 has joined #ruby
jottr has joined #ruby
apeiros_ has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 252 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
snickers has joined #ruby
apeiros_ has joined #ruby
Nicmavr has joined #ruby
bijan_ has joined #ruby
MoritaShinobu has joined #ruby
mike11 has quit [Quit: Leaving.]
alem0lars has joined #ruby
apeiros_ has quit [Remote host closed the connection]
Tuor has joined #ruby
yohji has joined #ruby
raulp has quit [Read error: Connection reset by peer]
tjbp has quit [Ping timeout: 272 seconds]
sysvalve has joined #ruby
raulp has joined #ruby
mikecmpbll has joined #ruby
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
sylario has joined #ruby
bijan_ has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
deathwishdave has joined #ruby
nowhere_man has quit [Ping timeout: 250 seconds]
salasrod has quit [Ping timeout: 252 seconds]
KramerC has quit [Ping timeout: 252 seconds]
salasrod has joined #ruby
alicef has quit [Ping timeout: 252 seconds]
mike11 has joined #ruby
ZzZombo_ has joined #ruby
ZzZombo has quit [Ping timeout: 244 seconds]
ZzZombo__ has joined #ruby
ZzZombo__ is now known as ZzZombo
aupadhye has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
KramerC has joined #ruby
alicef has joined #ruby
ZzZombo_ has quit [Ping timeout: 244 seconds]
bijan_ has joined #ruby
idiocrash has quit [Quit: Textual IRC Client: www.textualapp.com]
<TvL2386> hey guys, question about documentation of code: Since ruby always returns the result of the last evaluation in a method, something may be returned that the author didn't intend to or simply is not interested in. Should I then document what it returns, or should I document it returns nothing?
<TvL2386> I feel like I should change all my methods to return nil if I'm going to document that
<TvL2386> but then that makes me sad
<ZzZombo> Document the actual result type. Put `nil` as the last statement where necessary.
<TvL2386> thx
<TvL2386> no surprises :)
<ZzZombo> That's what I stick to. I always make sure the last expression produces the expected result, use explicit `return`, or put `nil` down at the end.
<ZzZombo> or use*
mikecmpbll has joined #ruby
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
jottr has joined #ruby
apparition has quit [Quit: Bye]
<TvL2386> sounds like a good plan!
old_relik has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
<old_relik> can this be written this more succintly? https://pastebin.com/raw/Xue252eN
<ruby[bot]> old_relik: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
venmx has joined #ruby
<TvL2386> yes it can
<TvL2386> first of all I would do "if condition? or another_condition?"
<TvL2386> because the body is identical
<old_relik> sorry made a mistake, the body is actually not identical
<TvL2386> lol
<TvL2386> anyway: it looks fine and small to me
Mortomes|Work has joined #ruby
RougeR has joined #ruby
old_relik has quit [Quit: Page closed]
apeiros_ has joined #ruby
Guest61135 has joined #ruby
jottr has joined #ruby
apparition has joined #ruby
Guest61135 has quit [Client Quit]
masterasia has joined #ruby
<masterasia> if I reopen a class, what happens to everything existing in it?
<masterasia> does my new code essentially get appended to the end?
<ruby[bot]> masterasia: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<apeiros_> masterasia: nothing happens. it will remain.
apeiros_ is now known as apeiros
<masterasia> Does the code get added to the beginning or end?
<apeiros> and yes, it's just as if you'd not closed the class and added that code at the end
<apeiros> so if you reopen a class and define a method again, last one wins
<masterasia> It is important, specifically for before_filters in rails controllers
lxsameer has joined #ruby
<masterasia> thanks apeiros
<masterasia> is this documented anywhere?
<masterasia> or just something you know based on experience
<masterasia> I guess I could find out by digging into the implementation details
<apeiros> I think it is documented somewhere. no idea where, though. Been a while since I learned that :D
bijan_ has quit [Remote host closed the connection]
bijan_ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
tjbp has joined #ruby
alem0lars has quit [Remote host closed the connection]
alem0lars has joined #ruby
bijan_ has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
bijan_ has joined #ruby
chichou has joined #ruby
bijan_ has quit [Read error: Connection reset by peer]
apeiros has quit []
tdy has quit [Ping timeout: 272 seconds]
tristanp has joined #ruby
marz_d`ghostman has joined #ruby
<marz_d`ghostman> What's a good ORM for plain ruby?
bijan_ has joined #ruby
deathwishdave has joined #ruby
tristanp has quit [Ping timeout: 272 seconds]
bijan_ has quit [Read error: Connection reset by peer]
bijan__ has joined #ruby
chichou_ has joined #ruby
bijan__ has quit [Read error: Connection reset by peer]
chichou has quit [Ping timeout: 245 seconds]
<TvL2386> marz_d`ghostman: probably depends on which backend you're using
<TvL2386> marz_d`ghostman: I'm only used to activerecord though
<TvL2386> marz_d`ghostman: for plain ruby I mostly use mysql2, but that's not an ORM
<marz_d`ghostman> TvL2386: hmmm I'm looking into trying new technology. Perhaps MongoDB
<marz_d`ghostman> TvL2386: Nah, I think I'll stick with MySQL and use activerecord
<TvL2386> marz_d`ghostman: sounds cool! My next little rails project will also use mongodb (mostly for learning purposes)
alem0lars has quit [Ping timeout: 246 seconds]
bijan_ has joined #ruby
ZzZombo has quit [Read error: Connection reset by peer]
Puffball_ has joined #ruby
bijan__ has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
<chichou_> marz_d`ghostman: did you try sequel?
<marz_d`ghostman> chichou_: I tried searching for one, it appears activerecord is the most popular
blackmesa has joined #ruby
<TvL2386> sequel extends activerecord
<chichou_> I think you meant activemodel?
<TvL2386> arg... I'm sorry, that's not correct... I was thinking about `squeel`
<chichou_> the same letters in different orders :P
<TvL2386> yeah lol :)
t0adst00l has joined #ruby
<chichou_> and I wasn't right either, it doesn't even extend activemodel but it's just a development dependency somehow
gnufied has joined #ruby
Sembei has quit [Max SendQ exceeded]
Sembei has joined #ruby
blackmesa has quit [Ping timeout: 250 seconds]
gnufied has quit [Ping timeout: 252 seconds]
bijan__ has quit []
apeiros_ has joined #ruby
AJA4350 has joined #ruby
esrse has quit [Ping timeout: 245 seconds]
Mortomes|Work has quit [Ping timeout: 252 seconds]
GodFather has joined #ruby
xfbs has joined #ruby
InfinityFye has joined #ruby
bijan_ has joined #ruby
ZzZombo has joined #ruby
za1b1tsu has quit [Ping timeout: 252 seconds]
nfk has joined #ruby
za1b1tsu has joined #ruby
lupine has quit [Remote host closed the connection]
<nfk> i can't believe i spent like 4 hours yesterday debugging firefox csp, sinatra, rack-protection and my app when the cause was NoScript running in my firefox...
lupine has joined #ruby
tristanp has joined #ruby
tristanp has quit [Ping timeout: 252 seconds]
<donofrio> nfk, don't beat yourself up too much, next time "Private browsing" for your testing
bmurt has joined #ruby
bijan_ has quit [Remote host closed the connection]
alireza has joined #ruby
<alireza> Hey Ammigos!
<alireza> I have a promotion base class
<alireza> which has two methods, `eligible?` and `perform`
<nfk> donofrio, i obviously run noscript inside it as well
<nfk> after all, i do about half of my googling in private or incognito just so that algorithm didn't start spamming me with lawnmover or lisp framework results
clemens3 has joined #ruby
<alireza> How can I call `return order.total unless eligble?(order)` before children logic
<alireza> that pattern always repeats in all promotion children classes
<alireza> but when I call `super` that doesn't work
bijan_ has joined #ruby
za1b1tsu has quit [Read error: Connection reset by peer]
<nfk> that's some code spaghetti you've got going there
Liothen has quit [Quit: The Dogmatic Law of Shadowsong]
Radar has quit [Ping timeout: 252 seconds]
<alireza> nfk: me?
Liothen has joined #ruby
SolarAquarion has quit [Quit: PanicBNC - http://PanicBNC.net]
<nfk> some easy things first: 1) it's good that you're using @percent to indicate that it's a percentage but if you're actually doing math on it, it's much safe to just keep it as a float and format it as a percentage only when shown in a human friendly manner
Fusl has quit [Ping timeout: 256 seconds]
bijan_ has quit [Ping timeout: 252 seconds]
chouhoulis has joined #ruby
<alireza> nfk: thanks for your consideration
<nfk> that way if stuff goes sideways you'll end up with 0.2% discount where it should have been 20% instead of substacting 20, because someone forgot to do the conversion
<alireza> nfk: but I don't get where's the spagetti?
<nfk> alireza, hey, you have to be careful with money, if you bill me €-5, i'll take them and the product, thank you
Fusl has joined #ruby
za1b1tsu has joined #ruby
SolarAquarion has joined #ruby
<alireza> nfk: actually percent is for that, when you say 10 percent you mean 0.1
<alireza> so I can abstract out percentage logic outside or just provide a simple keyword argument which indicates that
<alireza> it's just a simple test
<nfk> alireza, it's just a good practice, when it comes to money, to avoid using percentage as your internal representation
<alireza> nfk: for sure
<alireza> but my question is how to call `return order.total unless eligible?(order)` in parent class
bijan_ has joined #ruby
<nfk> alireza, and i'm sharing my opinion on how i'd avoid some pitfals, speaking of which, i would have order.base_total and order.total
<alireza> nfk: yeah I appricate that
<nfk> that way, again, if stuff goes sideways, you won't end up repeatedly applying the same discount
<alireza> yeah, I need line itmes
<alireza> *items
<alireza> and a base total
<alireza> but first I'm going to elminate `return order.total unless eligible?(order)` in children classes
<nfk> you'd likely also want to do all your discounts in one place (i.e. pass in order and some hash of all potentially applicable discounts)
bijan_ has quit [Ping timeout: 252 seconds]
<nfk> alireza, i think that if you redo your discounting to all happen in one place, then you won't have that issue in the first place but that's just me
<alireza> nfk: https://dpaste.de/etRL
<alireza> nfk: see?
<nfk> yeah, i see a lot of abstraction with very little code, which is why i called that code spaghetti
bijan_ has joined #ruby
<nfk> alireza, my gut feeling without considering that spaghetti is that when you call super the self it's being called on is not what you think it is but that's just my first hunch
<alireza> nfk: yeah I just realized that
<alireza> nfk: I should consider something like before_action
fmccann has quit [Quit: ZNC 1.7.1 - https://znc.in]
<alireza> nfk: thanks for your time, btw.
alireza has left #ruby ["WeeChat 2.1"]
bijan_ has quit [Ping timeout: 252 seconds]
bijan_ has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
Puffball_ has quit [Remote host closed the connection]
Puffball has joined #ruby
jottr has joined #ruby
thy0 has joined #ruby
MaiconVieira has joined #ruby
chouhoulis has quit [Remote host closed the connection]
gnufied has joined #ruby
thy0 has quit [Quit: TTFN]
thy0 has joined #ruby
xtsee has quit [Ping timeout: 252 seconds]
t0adst00l has quit [Ping timeout: 256 seconds]
jottr has quit [Ping timeout: 245 seconds]
bijan_ has quit [Ping timeout: 250 seconds]
kapil___ has joined #ruby
t0adst00l has joined #ruby
bijan_ has joined #ruby
jottr has joined #ruby
micabot has joined #ruby
bijan_ has quit [Ping timeout: 252 seconds]
alem0lars has joined #ruby
aufi has quit [Ping timeout: 245 seconds]
bijan_ has joined #ruby
blackmesa has joined #ruby
BrainWork has joined #ruby
<BrainWork> hi. i know absolutely nothing about ruby, but i am a programmer with many years of experience in other languages such as php, C++, even assembler. What is a good resource as a 'crib note' to kickstart some starting knowledge in ruby please?
bijan_ has quit [Ping timeout: 252 seconds]
<BrainWork> i have no goal except to learn the basics of another language relatively quickly
<BrainWork> there's lots of documentation out there but much of it is either a dry reference manual or assumes beginner status
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bijan_ has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
tristanp has joined #ruby
<chichou_> BrainWork: online material only or books as well?
jottr has joined #ruby
tristanp has quit [Ping timeout: 245 seconds]
<nfk> BrainWork, well, if you're just fooling around, maybe try http://rubykoans.com/
<nfk> i remember having quite a bit of fun with those when i started, though it was some online interpreter rather than a set of local files
<nfk> BrainWork, this might be of interest to you: https://news.ycombinator.com/item?id=9308684
za1b1tsu has quit [Ping timeout: 246 seconds]
* nfk goes on a run to do some errands
nowhere_man has joined #ruby
bijan_ has quit [Remote host closed the connection]
bijan_ has joined #ruby
aufi has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
snickers has joined #ruby
duderonomy has joined #ruby
vondruch_ has joined #ruby
Inline has joined #ruby
Inline has quit [Read error: Connection reset by peer]
MaiconVieira has left #ruby [#ruby]
Inline has joined #ruby
vondruch has quit [Ping timeout: 272 seconds]
vondruch_ is now known as vondruch
apparition has quit [Quit: Bye]
bijan_ has quit []
Rapture has joined #ruby
mike11 has quit [Quit: Leaving.]
thy0_ has joined #ruby
thy0 has quit [Ping timeout: 245 seconds]
jordanm has quit [Remote host closed the connection]
jottr has joined #ruby
jordanm has joined #ruby
MoritaShinobu has quit [Quit: Leaving]
alem0lars has quit [Ping timeout: 252 seconds]
jottr has quit [Ping timeout: 272 seconds]
lomex has joined #ruby
jottr has joined #ruby
sauvin has quit [Ping timeout: 244 seconds]
SeepingN has joined #ruby
faitswulff has joined #ruby
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wojnar has joined #ruby
Cork has quit [Quit: .]
jottr has quit [Ping timeout: 245 seconds]
cagomez has joined #ruby
Cork has joined #ruby
Eiam has joined #ruby
Cork has quit [Excess Flood]
ivanskie has joined #ruby
Cork has joined #ruby
za1b1tsu has joined #ruby
faitswulff has quit []
jottr has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lektrik has quit [Quit: Leaving the chat for a while!]
aupadhye has quit [Remote host closed the connection]
akem has quit [Ping timeout: 240 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
snickers has joined #ruby
snickers has quit [Client Quit]
akem has joined #ruby
akem has quit [Ping timeout: 246 seconds]
micabot has quit [Quit: Leaving]
akem has joined #ruby
apeiros_ has quit []
blackmesa1 has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
akem has quit [Ping timeout: 244 seconds]
sysvalve has quit [Quit: Leaving]
blackmesa1 has quit [Ping timeout: 252 seconds]
cagomez has quit [Remote host closed the connection]
GodFather has quit [Ping timeout: 240 seconds]
duderonomy has quit [Ping timeout: 252 seconds]
akem has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lomex has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
clemens3 has quit [Ping timeout: 245 seconds]
thy0_ has quit [Quit: TTFN]
thy0 has joined #ruby
DTZUZU has quit [Quit: WeeChat 1.9]
Tuor has quit [Ping timeout: 245 seconds]
aufi has quit [Ping timeout: 252 seconds]
Fusl has quit [Remote host closed the connection]
yohji has quit [Remote host closed the connection]
alem0lars has joined #ruby
Fusl has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros_ has joined #ruby
mynameisdebian has joined #ruby
lxsameer has quit [Ping timeout: 245 seconds]
DTZUZU has joined #ruby
blackmesa has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
mynameisdebian has quit [Remote host closed the connection]
bijan_ has joined #ruby
bijan_ has quit [Client Quit]
duderonomy has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
RougeR has quit [Ping timeout: 252 seconds]
<baweaver> BrainWork: Book list in the channel topic
<baweaver> But short version: Eloquent Ruby
GodFather has joined #ruby
DTZUZO_ has quit [Ping timeout: 240 seconds]
prometheus_falli has joined #ruby
t0adst00l has quit [Ping timeout: 256 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
sauvin has joined #ruby
Nicmavr has joined #ruby
darkhanb has joined #ruby
schneider1 has joined #ruby
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
thy0_ has joined #ruby
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
thy0_ has quit [Client Quit]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
thy0_ has joined #ruby
howdoicomputer has joined #ruby
thy0 has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
howdoicomputer has quit [Ping timeout: 250 seconds]
lxsameer has quit [Ping timeout: 252 seconds]
blackmesa has joined #ruby
Dbugger has joined #ruby
wojnar has quit [Quit: Leaving]
lxsameer has joined #ruby
chichou_ has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
<nfk> those were some long errands but, hey, at least i got move a bit
<nfk> +to
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
lxsameer has joined #ruby
GodFather has quit [Ping timeout: 272 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mynameisdebian has joined #ruby
lxsameer has joined #ruby
Eiam has quit [Quit: Textual IRC Client: www.textualapp.com]
InfinityFye has quit [Quit: Leaving]
Rapture has quit [Ping timeout: 245 seconds]
lxsameer has quit [Ping timeout: 252 seconds]
schneider1 has quit [Quit: WeeChat 2.0.1]
mynameisdebian has quit [Remote host closed the connection]
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
RougeR has joined #ruby
lxsameer has joined #ruby
blackmesa has quit [Ping timeout: 264 seconds]
snickers has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
johnny56 has quit [Read error: Connection reset by peer]
johnny56 has joined #ruby
lxsameer has joined #ruby
SeepingN has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 245 seconds]
SeepingN has quit [Read error: Connection reset by peer]
SeepingN has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
sanscoeur has joined #ruby
ua has quit [Ping timeout: 252 seconds]
<nfk> Oh, derp, I'm testing my webapp on both firefox and google chrome and i'm getting different colors!
deathwishdave has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
venmx has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
mikecmpbll has joined #ruby
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
lxsameer has quit [Ping timeout: 272 seconds]
<nfk> On one hand I feel like pursuing this rabbit but I know that color management is gonna be one hellish rabit hole. Especially on linux. After all, all my profiles (other than my mpv vo_gpu one) is set to a test profile with wacky colors - if anything was capable of picking them up, I'd immediately notice that
<nfk> s/is/are/
SeepingN has quit [Disconnected by services]
blackmesa1 has joined #ruby
SeepingN_ has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 252 seconds]
jottr has joined #ruby
lxsameer has joined #ruby
bmurt has joined #ruby
tdy has joined #ruby
TheBloke has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 246 seconds]
lxsameer has quit [Ping timeout: 252 seconds]
deathwishdave has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
druonysus has joined #ruby
druonysus has left #ruby ["http://quassel-irc.org - Chat comfortably. Anywhere."]
lxsameer has joined #ruby
roshanavand has quit [Ping timeout: 272 seconds]
SeepingN_ is now known as CPngN
lxsameer has quit [Ping timeout: 240 seconds]
yorickpeterse has joined #ruby
yorickpeterse has quit [Client Quit]
lxsameer has joined #ruby
jottr has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
lxsameer has quit [Ping timeout: 246 seconds]
lxsameer has joined #ruby
ua has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 252 seconds]
alem0lars has quit [Ping timeout: 252 seconds]
sameerynho has joined #ruby
thy0_ has quit [Quit: TTFN]
thy0 has joined #ruby
lunarkittychan is now known as lunarfyre7
druonysus has joined #ruby
AndreYuhai has joined #ruby
DTZUZO_ has joined #ruby
TheBloke has joined #ruby
<AndreYuhai> Hi, how can we test stuff on Travis which requires username and password? Any sources?
nowhere_man has joined #ruby
<havenwood> AndreYuhai: Those ^ should get you on the right track.
<AndreYuhai> havenwood: Oh thank you! :) I didn't even know it was called like so.
weaksauce has joined #ruby
faitswulff has joined #ruby
venmx has joined #ruby
faitswulff has quit [Remote host closed the connection]
faitswulff has joined #ruby
akem has quit [Ping timeout: 252 seconds]
roshanavand has joined #ruby
akem has joined #ruby
knight33 has joined #ruby
sanscoeur has quit [Ping timeout: 252 seconds]
faitswulff has quit [Remote host closed the connection]
jottr has joined #ruby
blackmesa1 has quit [Ping timeout: 250 seconds]
blackmesa1 has joined #ruby
jottr has quit [Ping timeout: 244 seconds]
sanscoeur has joined #ruby
faitswulff has joined #ruby
prometheus_falli has quit [Ping timeout: 256 seconds]
Dirak has joined #ruby
<Dirak> !learn
prometheus_falli has joined #ruby
code_zombie has joined #ruby
eckhardt has joined #ruby
<Dirak> Hi, I'm a JS dev, and I need to learn Ruby for a company I'm interviewing with. What are the legit resources for learning Ruby on the level of 'you don't know js' and 'eloquent js'
TomyLobo has joined #ruby
moei has joined #ruby
mike11 has joined #ruby
<CPngN> funny you sayeloquent
<oz> Dirak: there's a nice list or learning material at https://www.ruby-lang.org/en/documentation/
mynameisdebian has joined #ruby
deathwishdave has joined #ruby
RougeR has quit [Ping timeout: 240 seconds]
RougeR has joined #ruby
mynameisdebian has quit [Ping timeout: 260 seconds]
<Dirak> My friend told me Ruby is a way of thinking and a philosophy so I need my reading material to redpill me
jottr has joined #ruby
<nfk> and oz already linked you with pretty much the stuff everyone learns from (obviously from the ones that fit their taste)
<nfk> as for the ones you listed, i have no idea about their teaching style as i learned js the hard way - by writing application code before the days of node
<nfk> ecmascript as a language is so simple that i'm always baffled by people who need to learn it
<Dirak> w0w there are some serious caveats to JS u just gotta know
<Dirak> like that the max int is 2^58. And that callbacks take the form (err, data) as their signature
blackmesa1 has quit [Quit: WeeChat 2.2]
deathwishdave has quit [Quit: Textual IRC Client: www.textualapp.com]
<nfk> i find it pretty difficult to max out anything that large
jp has joined #ruby
<nfk> also i was under impression that 58 usable bits for memory addresses on 64 bit arches was an implementation approach rather than a language feature
<Dirak> I have a friend who works at an ecommerce company. Every million transactions or so, their company magically lose a penny cuz of JS's Number imprecision. They call it the JS tax
<CPngN> yet they use JS
<CPngN> cuz silly
<nfk> couldn't they actually have BigInt implemented in JS?
jottr has quit [Ping timeout: 260 seconds]
<havenwood> typeof 42n; #=> 'bigint'
lomex has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
scrptktty has joined #ruby
<nfk> actually, how would they end up losing money? it was a bit less than I thought - just mere 2.8e17 but that's seems to be enough to track the world's economy at a fraction of penny/cent precision
<nfk> *that
roshanavand has quit [Ping timeout: 250 seconds]
roshanavand has joined #ruby
blackmesa has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
jp has joined #ruby
evdubs_ has joined #ruby
jottr has joined #ruby
nowhere_man has joined #ruby
evdubs has quit [Ping timeout: 252 seconds]
jottr has quit [Ping timeout: 272 seconds]
faitswulff has quit [Remote host closed the connection]
nine_milli_ has joined #ruby
moei has quit [Quit: Leaving...]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
<nine_milli_> is php better than ruby?
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
<oz> nine_milli_: it depends. ;)
<nfk> don't feed the troll
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
<CPngN> it depends. either "no", or "hell no!"
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
<oz> nfk: oh, true that. :)
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
<nine_milli_> what are the advantages of ruby over php if any?
apeiros_ has quit [Ping timeout: 252 seconds]
<nine_milli_> also was ruby made by a 400lb man in a bed somewhere?
jolamb has joined #ruby
Eiam has joined #ruby
lxsameer has joined #ruby
nine_milli_ has left #ruby ["Leaving"]
xtsee has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
roshanavand has quit [Quit: Lost terminal]
jolamb has left #ruby ["WeeChat 1.9.1"]
jp has quit [Ping timeout: 252 seconds]
weaksauce has quit [Ping timeout: 272 seconds]
<baweaver> !troll nine_nilli_
<ruby[bot]> baweaver: Could not find user with nick "nine_nilli_"
<baweaver> !troll nine_milli_
<baweaver> There we go.
<Dirak> Does every object in Ruby have the method .nil?
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
<nfk> if you meant nil?, then... you might be able to not have one if you essentially uprooted or replaced the entire runtime
<nfk> but as things stand, yes
<nfk> afaik
jottr has quit [Ping timeout: 245 seconds]
faitswulff has joined #ruby
<nfk> Dirak, oh, i just realised i automatically removed the ? from .nil because you were asking a question, sorry
faitswulff has quit [Ping timeout: 252 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
bmurt has joined #ruby
apeiros_ has joined #ruby
<Dirak> how come the object_id of numbers follows the pattern 2n + 1?
<nfk> my gut feeling is that it just might be to avoid a circular definition, because object_id has to return an object?
nowhere_man has quit [Ping timeout: 252 seconds]
<Dirak> oh wtf << isn't a bitwise operator in Ruby?
<nfk> is it even a bitwise operator in C++ is my first question
<nfk> anyway, ObjectSpace._id2ref 2
<nfk> try that
<nfk> Dirak, anyway, my bad, << is the bitwise operator, and it's also doing the same job in ruby: a = 1; puts a; a <<= 2; puts a
<Dirak> ooh gotcha
<nfk> what you might be confused about is the fact that it's just a method (just like in C++), which means that you can define your own /, + and, yes, <<
blackmesa has quit [Quit: WeeChat 2.2]
<Dirak> I like << syntax to push into an array
gnufied has quit [Ping timeout: 252 seconds]
DTZUZO_ has quit [Ping timeout: 272 seconds]
reber has quit [Remote host closed the connection]
tdy has quit [Ping timeout: 240 seconds]
jp has joined #ruby
mike11 has quit [Quit: Leaving.]
ndr0s has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
vondruch_ has joined #ruby
RiPuk has joined #ruby
faitswulff has joined #ruby
jasmith has joined #ruby
vondruch has quit [Ping timeout: 246 seconds]
vondruch_ is now known as vondruch
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Puffball has quit [Remote host closed the connection]
hays_ has joined #ruby
nowhere_man has joined #ruby
Puffball has joined #ruby
DTZUZO_ has joined #ruby
<hays_> anyone who uses rubocop--is it fair to say that driving the number of "offenses" to zero is not usually practicable
<hays_> I'm finding some cases where.. it doesn't make sense to make the method shorter, or ABC complexity makes sense
faitswulff has quit [Remote host closed the connection]
Dirak has quit [Ping timeout: 250 seconds]
TomyLobo has quit [Read error: Connection reset by peer]
knight33 has quit [Quit: Textual IRC Client: www.textualapp.com]
mikecmpbll has quit [Quit: inabit.]
tdy has joined #ruby
<marz_d`ghostman> I'm using dispatch and I have these lines: autocmd FileType ruby let b:dispatch = 'rspec %' nnoremap <F9> :Dispatch!<CR> but I'm getting an erorr: || make: *** No targets specified and no makefile found. Stop.
<marz_d`ghostman> I can run :Dispatch rspec % fine though
Dirak has joined #ruby
tdy has quit [Ping timeout: 246 seconds]
[Butch] has joined #ruby
za1b1tsu has quit [Ping timeout: 272 seconds]
TheBloke has quit [Ping timeout: 250 seconds]
sameerynho has quit [Ping timeout: 252 seconds]
IanMalcolm has joined #ruby
faitswulff has joined #ruby
<baweaver> hays_: Depends on how pedantic one wants to be
<baweaver> I normally set some to warn and some to error
<baweaver> Difference is what you want to be build-breaking
<hays_> baweaver: it seems basically impossible to use optparse in a way that won't violate a rubocop rule
<hays_> since you end up with a big block if you have more than a few args
chichou_ has joined #ruby
IanMalcolm has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
lxsameer has joined #ruby
elphe has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
nfk has quit [Quit: Try memory.free_dirty_pages=true in about:config]
Dirak has quit [Ping timeout: 260 seconds]
chichou_ has quit [Ping timeout: 252 seconds]
xfbs has quit [Quit: afk]
za1b1tsu has quit [Ping timeout: 272 seconds]
jp has quit [Ping timeout: 244 seconds]
jottr has joined #ruby
esrse has joined #ruby
gnufied has joined #ruby
Azure has joined #ruby
<havenwood> hays_: increase unreasonably low default values
<hays_> optparse might be like a page long
jottr has quit [Ping timeout: 272 seconds]
gnufied has quit [Ping timeout: 246 seconds]
paraxial has quit [Ping timeout: 252 seconds]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
SanguineAnomaly has quit [Ping timeout: 264 seconds]
RougeR has quit [Ping timeout: 245 seconds]
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
RougeR has joined #ruby
Dirak has joined #ruby
AndreYuhai has quit [Ping timeout: 252 seconds]
paraxial has joined #ruby
SanguineAnomaly has joined #ruby