baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.5.0, 2.4.3, 2.3.6: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
<havenwood> tefa: It doesn't say which method? It's odd they'd hide that from you.
<tefa> havenwood it dosnt, that way i could solve it easier...
xt233 has left #ruby [#ruby]
<havenwood> tefa: You might consider switching to a different tutorial that lets you run the code yourself.
Silmarilion has quit [Read error: Connection reset by peer]
<baweaver> Which go where now?
sanscoeur has quit [Ping timeout: 248 seconds]
<tefa> havenwood I searched the web, there isnt. Not in spanish and good at this one it is teaching..
<havenwood> baweaver: RubyRoutines *soon*
tjbp has quit [Ping timeout: 240 seconds]
sanscoeu_ has quit [Ping timeout: 276 seconds]
<havenwood> tefa: It'd be great if someone translated exercism to Spanish, et cetera: https://github.com/exercism/discussions/issues/203
<havenwood> tefa: exercism has some nice problems and you can run it on your own computer
<guacamole> ruby koans too
<havenwood> but alas
<havenwood> It's in English.
<rubycoder37> so I have this CSV with this code: https://gist.github.com/anonymous/3dc4a9bd1d53677708b2c11a688f6441 notice how the 'expected output' has a specific hierarchy with the name and the combination of the currency/amount, I know the basic of reading a file and converting CSV to JSON but I don't know how to achieve this format
<havenwood> tefa: You might have less trouble with the English in exercism or koans than you're having with the opaque Ruby service.
<guacamole> rubycoder37 have you worked with hashes before?
kies has quit [Ping timeout: 260 seconds]
<rubycoder37> guacamole: yes
<guacamole> so you just need construct a hash, and compare the name column against the keys in the hash to decide if it already exists. if it does, add another value to "wallets" if not add the key and the "wallets" nested hash key and relevant wallet info
<guacamole> does that help? or something specific not working you can point me to?
<weaksauce> what's the expected output when there is more than one client?
<weaksauce> just an array of hashes?
<rubycoder37> yes
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<weaksauce> tefa do you have the method signatures that they are expecting to use?
konsolebox has quit [Ping timeout: 268 seconds]
<weaksauce> because without seeing the call site it's tough to say which one is messing up
rgiscard has quit [Quit: Cheers]
tjbp has joined #ruby
krawchyk has joined #ruby
<weaksauce> rubycoder37 try using map then on each of the lines in the csv. each time constructing the hash that looks like the json output. something like the_lines_array.map do |line| {name: line[:name], wallets: {each of the wallets}} end
<weaksauce> but of course you need to modify it to actually work
<weaksauce> actually you can't do that because you need to aggregate over lines
krawchyk has quit [Client Quit]
<tefa> weaksauce I can only use the code inside the actual code... and (max, min, all?, any?, select, find, push, delete, and some others) not any other...
sylario has quit [Quit: Connection closed for inactivity]
<rubycoder37> weaksauce: sounds good, I'll do that, thanks
Mike11 has quit [Quit: Leaving.]
<weaksauce> tefa do you have a link to the problem?
krawchyk has joined #ruby
alfiemax has joined #ruby
<tefa> weaksauce this gist.. its all i have.. https://gist.github.com/tefanga/399905367c95d6499a9d8eed117cc89a
<weaksauce> tefa it's on a public website?
<havenwood> rubycoder37: Not sure if I followed what you want, but consider: require 'json'; require 'csv'; headers, *rows = CSV.read('wallet.csv'); rows.each_with_object(Hash.new { |h, k| h[k] = {} }) { |(client, currency, amount), h| h[client][currency] = amount }
<tefa> weaksauce thats everything.. actual the Zombie module Bouba whats the previous exercise, on this new exercise I only created the human, Juliana, so the website its using the zombie module from the previous exercise, thats why I uploaded everything to the gist, maybe the error its on the zombie module...
<tefa> weaksauce yes, its on a public site, this is the site: mumuki.io
<tefa> weaksauce even if you enter directly to mumuki.io and you log in.. you can go directly to the exercise by going to Chapter 5 Programación con Objetos, then to Lesson 6, exercise 1
<havenwood> rubycoder37: commented on your gist
alfiemax has quit [Ping timeout: 248 seconds]
krawchyk has quit [Quit: krawchyk]
<rubycoder37> havenwood: wow! thanks for this, trying your code
<weaksauce> tefa trying to log in but it's slow
<havenwood> Waiting for mumuki.io...
<tefa> weaksauce it isnt slow... first time its failing.. ever...
<tefa> weaksauce it never been... first time. dont know why
<mikhael_k33hl> Is there a method to extract only the key from a hash?
<havenwood> mikhael_k33hl: #keys
konsolebox has joined #ruby
<mikhael_k33hl> havenwood: that returns an array, what if I know it only returns one value?
<havenwood> mikhael_k33hl: you just want to check if the Hash has a single key and get a bool back?
<mikhael_k33hl> havenwood: Looking into the docs, I think that's the only one
<mikhael_k33hl> havenwood: Sorry for the confusion, I meant I know for sure that the hash will only have one key/value pair hehe
<havenwood> >> {mikhael: :k33hl}.first.last
<ruby[bot]> havenwood: # => :k33hl (https://eval.in/955924)
<havenwood> mikhael_k33hl: ^
<guacamole> mikhael_k33hl you want [:key] to be :key instead?
<havenwood> >> {mikhael: :k33hl}.keys.first
<ruby[bot]> havenwood: # => :mikhael (https://eval.in/955925)
<havenwood> >> {mikhael: :k33hl}.first.first
<ruby[bot]> havenwood: # => :mikhael (https://eval.in/955926)
<havenwood> mikhael_k33hl: There isn't a single method for that purpose, but #keys then #first should do the trick nicely.
<havenwood> #first then #first also works
<weaksauce> is it guaranteed to be that many elements always or can it fail at some point by having 0 or more than one or be nil?
krawchyk has joined #ruby
<mikhael_k33hl> havenwood: thanks man
<weaksauce> tefa seems like I can't log in sorry
<tefa> weaksauce im not pretty sure if I understand you.. but by experience I can tell that the site, usually knows the errors you can have...I have had others errors before, including nil ones..
<weaksauce> tefa that was for mikhael_k33hl actually
<tefa> weaksauce oh xd
krawchyk has quit [Client Quit]
<tefa> weaksauce it cant be true :( just when Im getting help, website fails... never failed before.. never... they are conspiring against me...-.-
<tefa> weaksauce now its working... I log off and re log and it works... yes it takes a minute but it does now..
<rubycoder37> havenwood: your example worked great, thanks
morenoh149 has joined #ruby
<weaksauce> tefa i will try again i suppose
<tefa> weaksauce you wanted the site to test it ?
<weaksauce> yeah
<tefa> weaksauce I can show you what I see... for example, this is the list of exercise: https://i.imgur.com/KHnUDzv.png
morenoh149 has quit [Ping timeout: 265 seconds]
<tefa> weaksauce this is the exercise 1: https://i.imgur.com/YkKhtt4.png and this is the exercise 2: https://i.imgur.com/iC78exn.png
holanga has joined #ruby
holis has joined #ruby
<weaksauce> perhaps it is an issue with implicitly passed in self? i can't recall the rules on that
<weaksauce> tefa ^
<weaksauce> also, i can't read spanish
<holis> Dont know what it means implicity passed in self..
<holis> (Im eating.. im tefa.. with my cellphone xd)
d10n-work has quit [Quit: Connection closed for inactivity]
<holis> There isnt much to understand...but if you want I can translate evrrything for you
workmad3 has joined #ruby
holanga has quit [Ping timeout: 265 seconds]
<weaksauce> holis does the code need to be a module and does it need to be `self.` methods?
<holis> Yes..its the only way I have been using till now.. only modules like the code i shared... and defined self.blabla
<holis> So i can execute them or give them orders..
<weaksauce> > Esto es lo que se conoce como error 500 .
<weaksauce> server error when i try to log in. it's probably just poorly written tests on the backend
<holis> Im sorry about that.. like i said never failed before :(
<holis> The thing you wrote in spanish means.. This is what we know of error 500
workmad3 has quit [Ping timeout: 276 seconds]
<weaksauce> oh you know what, holis it is probably expecting the module or object to be passed into attack!
<weaksauce> try adding another variable as an input and see what happens
<weaksauce> this seems to be too vague to be all that useful
marxarelli is now known as marxarelli|afk
<holis> You mean for example... on def self.attack(x) under it write something like @hello = x ? Insted of the order i gave?
<weaksauce> def self.atacar!(damage, hero) or def self.atacar!(hero, damage)
<weaksauce> and then hero.recibir_danio!(damage)
kliq has quit [Read error: Connection reset by peer]
<weaksauce> that's about the only thing that makes sense
<holis> I got you.. will try that right now
<holis> I got your point.. and think you are right
<weaksauce> good luck
<tefa> weaksauce iuuuuuhuuuu haha
<tefa> weaksauce fki*** site, didnt told me that...
<tefa> weaksauce xd, guess woulda be 2 easy...
<weaksauce> yeah. not having the method signature provided for you is crazy
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tefa> weaksauce changed to def self.atacar!(zombie,x) and insted of Bouba.recibir_danio!(x) used zombie.recibir_danio!(x), workd :D
<weaksauce> nice!
<tefa> weaksauce but now i learned something... everytime or pretty sure most of them, the website want to correlate something.. or link.. it will use a second var or similar.. to the clare the other object or module.. etc
<tefa> declar*
<tefa> declare*
<tefa> weaksauce I will finish eating now, thanks for the help, and for re trying help.times {solve error} xd
<weaksauce> no problem tefa
<weaksauce> tefa you might want to just do something easier like @salud -= 2*x instead of x.times as it's a bit more idiomatic to do it that way
<weaksauce> also a good habit to get into to name the variables more in line with what they do
<weaksauce> so x could be called num_of_strikes or something like that
minimalism has joined #ruby
<holis> I usually do, but I dont like long names..and when i recode the code, trying to solve the error.. i change names to short things so i can change them quick.. and dont lose time writing dictionary xd
<weaksauce> it will probably save you more time in the long run to do it right though. glad it's working though
<holis> And my code only longs the time the website want to.. so.. i dont care too much xd but when i do my final code... for example for a work of myself.. a program.. or a test in the school.. i would be super explicit and understandable legible
kapil___ has joined #ruby
<tefa> weaksauce but yes, I dot what you say :D
hahuang65 has joined #ruby
marr has quit [Ping timeout: 260 seconds]
alfiemax has joined #ruby
Matthew1 has joined #ruby
holis has quit [Ping timeout: 256 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
alfiemax has quit [Ping timeout: 255 seconds]
<tefa> and weak, using x.times whas me having fun... I know I can use x*2 .. but knowing they dont let me use too much code... I play with it sometimes... doing easy things complex and complex easy.. xd I learn from the error too
roonsauce has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg_ has joined #ruby
<weaksauce> :D
mikimouse22 has joined #ruby
<weaksauce> there's an old saying that you need to be 2 times as smart as the code to debug it so if you write the most clever code you can, you are not smart enough to fix your own code
<weaksauce> something along those lines
eckhardt has joined #ruby
<mikimouse22> hi. im trying to setup passenger module on top of nginx but all the files I'm requesting are returned in plain text instead of parsed by ruby. i don't know how to debug this problem
morenoh149 has joined #ruby
<tefa> haha true.
roonsauce has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 248 seconds]
<tefa> the virtual classroom just teach me how to use a Class.. and how to just "def" xd
cdg_ has quit [Ping timeout: 248 seconds]
morenoh149 has quit [Ping timeout: 240 seconds]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikimouse22 has quit [Quit: Page closed]
ResidentBiscuit has joined #ruby
<tefa> why is there so many people in this chat room and noones chat?
alfiemax has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
ResidentBiscuit has quit [Remote host closed the connection]
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Read error: Connection reset by peer]
ResidentBiscuit has joined #ruby
alfiemax has quit [Ping timeout: 264 seconds]
SkyFire has joined #ruby
funnel has quit [Ping timeout: 240 seconds]
<SkyFire> Can someone help me with routing ruby? i know very listtle ruby but this is a simple path routing issue that idk how works
tvw has quit [Remote host closed the connection]
funnel has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hndk has quit [Quit: Leaving]
cdg has joined #ruby
<gizmore> SkyFire: rails?
<SkyFire> umm
<SkyFire> yes?
<SkyFire> i literly like dk ruby at all
<gizmore> wrong channel. query me if you like
<gizmore> or try #rails
<SkyFire> ik html, and java, and some C# so im familiar with code
<SkyFire> i have no clue which ruby im using
<SkyFire> i installed something form the ruby website
<gizmore> try ruby --version
<SkyFire> i get: ruby 2.4.3p205
<SkyFire> and a date
<SkyFire> and [x64-mingw32]
<SkyFire> so the line of code im working with (that works) is: get 'massage_Alhambraaa' => 'static_pages#massage_Alhambraaa'
<gizmore> this is from routes.rb
cdg has quit [Ping timeout: 240 seconds]
<SkyFire> yes
rubycoder37 has quit [Quit: Lost terminal]
<gizmore> it calls a function... "get"
<gizmore> with some dictionary as param
<gizmore> 'massage_Alhambraaa' => 'static_pages#massage_Alhambraaa'
<gizmore> this somehow generates routes in your rails app
<SkyFire> there is a file: massage_Alhambraaa.html.erb in the folder: static_pages
<gizmore> what is the problem?
<SkyFire> i created another fodler: CA in folder: static_pages
<gizmore> static_pages should be also a controller. no?
<SkyFire> how can i route the files in the CA folder?
<gizmore> static_pages should be also a controller. no?
<SkyFire> idkk
<gizmore> 'massage_Alhambraaa' => 'static_pages#massage_Alhambraaa'
envex has quit []
<gizmore> calls massage_Alhambraaa in static_pages controller, iirc
<gizmore> but better ask in rails
<gizmore> also feel free to pm me
John_Ivan has quit [Read error: Connection reset by peer]
bmurt has quit [Remote host closed the connection]
<gizmore> this channel is more for core ruby
kies has joined #ruby
<SkyFire> ok, im new to both rails and ruby
brendan- has joined #ruby
jerikl has joined #ruby
ResidentBiscuit has quit []
konsolebox has quit [Ping timeout: 256 seconds]
konsolebox has joined #ruby
gizmore|2 has joined #ruby
AJA4350 has quit [Quit: AJA4350]
infernix has joined #ruby
gizmore has quit [Ping timeout: 265 seconds]
morenoh149 has joined #ruby
dinfuehr has quit [Ping timeout: 248 seconds]
<weaksauce> SkyFire it's actually #rubyonrails unless there was a fracture of the channel
dinfuehr has joined #ruby
<tefa> im actually needing help again, anyone ? :D
<tefa> weak? xd
nadir has quit [Quit: Connection closed for inactivity]
morenoh149 has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
tefa2 has joined #ruby
tefa has quit [Ping timeout: 268 seconds]
alfiemax has quit [Ping timeout: 265 seconds]
matthewd has quit [Ping timeout: 276 seconds]
matthewd has joined #ruby
tefa has joined #ruby
Puffball has joined #ruby
tefa2 has quit [Ping timeout: 265 seconds]
<tefa> Can anybody help ? im getting this problem https://i.imgur.com/tbihkLb.png as you can see class Sobrevivientes its already declare.. and in the second exercise i just added another method...following the steps the exercise asked for. as you can see in Sobrevivientes there is a method called atacar! and it uses recibir_danio!... my exercise worked and pass the test.. but there is something not
<tefa> quite complete... it says that my program worked but i have to use "recibir_danio!" in atacar!... so its weird.. cause i already used.. as you can see on Sobrevivientes class.... what could it be wrong ? thanks in advance
VeryBewitching has quit [Quit: Konversation terminated!]
workmad3 has joined #ruby
milardovich has quit []
<tefa> nvm, solved it
milardovich has joined #ruby
netherwolfe has joined #ruby
bentlema has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
netherwolfe has quit [Ping timeout: 252 seconds]
mikhael_k33hl has quit [Quit: Page closed]
howdoi has quit [Quit: Connection closed for inactivity]
nadir has joined #ruby
morenoh149 has joined #ruby
alfiemax has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
RougeR has quit [Ping timeout: 255 seconds]
morenoh149 has quit [Ping timeout: 260 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
tefa has quit []
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<nwm_> is there an alternative to instance_eval when creating a dsl?
<nwm_> seems hackish
kies has quit [Ping timeout: 240 seconds]
milardovich has quit []
zer0xDEAD9001 has joined #ruby
zer0xDEAD9001 has quit [Client Quit]
cdg has joined #ruby
tefa has joined #ruby
Azure has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
<tefa> hello += 100 -> means hello + 100 the new value for hello... so -= the same but insted of plus, less... how does it works for "/" and or "*"
kies has joined #ruby
govg has joined #ruby
AndChat|474201 has joined #ruby
AndChat|474201 has quit [Max SendQ exceeded]
AndChat|474201 has joined #ruby
AndChat|474201 has quit [Max SendQ exceeded]
alfiemax has quit [Ping timeout: 240 seconds]
s3nd1v0g1us has quit [Ping timeout: 276 seconds]
erlend has quit [Ping timeout: 252 seconds]
erlend has joined #ruby
<Radar> OK Ruby refactoring peeps: https://gist.github.com/radar/99494e1afc224989f45bfd78d5db9d3f What's a shorter way of writing this?
<Radar> tefa: Do you mean *= and /= ?
hahuang65 has quit [Quit: WeeChat 2.0.1]
meadmoon has joined #ruby
darkhanb has joined #ruby
alfiemax has joined #ruby
kies has quit [Ping timeout: 256 seconds]
sanscoeur has joined #ruby
fluid has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
fluid has quit [Client Quit]
maum has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
arescorpio has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
orbyt_ has joined #ruby
<tefa> Radar yes, but if i try *= or /= wont work..
<Radar> tefa: what happens when you try?
<Radar> kspencer: yes that's with a string... what about with a number?
<tefa> for example i want to do so here... @energy = @energy /2
roonsauce has joined #ruby
<tefa> as you can see i have to rewrite @energy...
<kspencer> hmm i just found this with some googling, some of my stuff may be incorrect
<Radar> @energy /= 2 will wo-rk
<Radar> I don't know where that - came from. Have it for free.
alfiemax has joined #ruby
roonsauce has quit [Ping timeout: 256 seconds]
<tefa> wont work for me... maybe is the website room where im working
meadmoon has quit [Ping timeout: 255 seconds]
<oz> ah I hadn't discovered this one yet... with Rails (5.0). `Date.today.today? # => false` :>
alfiemax has quit [Ping timeout: 256 seconds]
<oz> (because `.today` uses the local/system time zone, but `#today?` compares with `.current` which uses UTC)
trautwein has quit [Quit: ZNC 1.6.5 - http://znc.in]
trautwein has joined #ruby
snath has joined #ruby
<oz> it's cute ; and with that have a good night. :)
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
alex`` has quit [Ping timeout: 260 seconds]
bentlema has quit []
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
segy_ has joined #ruby
segy has quit [Ping timeout: 240 seconds]
segy_ is now known as segy
cdg has quit [Remote host closed the connection]
arescorpio has quit [Excess Flood]
jerikl has joined #ruby
alfiemax has joined #ruby
xenops has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 255 seconds]
workmad3 has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
dviola has quit [Quit: WeeChat 2.0.1]
meinside has quit [Quit: Connection closed for inactivity]
alfiemax has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
schneide_ has joined #ruby
schneide_ has quit [Ping timeout: 264 seconds]
spectrum has joined #ruby
johnny56_ has quit [Ping timeout: 256 seconds]
luna_x has joined #ruby
DroidBurgundy has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has quit [Remote host closed the connection]
<tefa> anyone want to chattt
<tefa> xd
jordanm has quit [Remote host closed the connection]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
alfiemax has joined #ruby
n0m4d1c has quit [Remote host closed the connection]
kapil___ has quit [Quit: Connection closed for inactivity]
alfiemax has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
Matthew1 has quit [Remote host closed the connection]
ramfjord has joined #ruby
jerikl has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DroidBurgundy has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
Puffball has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 276 seconds]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Puffball has joined #ruby
Puffball has quit [Remote host closed the connection]
konsolebox has joined #ruby
reber has joined #ruby
jerikl has joined #ruby
dinfuehr has quit [Ping timeout: 248 seconds]
DroidBurgundy has quit [Ping timeout: 264 seconds]
dinfuehr has joined #ruby
jerikl has quit [Client Quit]
konsolebox has quit [Ping timeout: 260 seconds]
andydna has quit [Read error: Connection reset by peer]
LocaMocha has joined #ruby
jerikl has joined #ruby
konsolebox has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
jordanm has joined #ruby
DroidBurgundy has joined #ruby
aufi has joined #ruby
KeyJoo has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
brendan- has joined #ruby
DroidBurgundy has quit [Ping timeout: 260 seconds]
konsolebox has quit [Ping timeout: 248 seconds]
konsolebox has joined #ruby
nwm_ has quit [Ping timeout: 260 seconds]
slyphon has joined #ruby
slyphon has quit [Changing host]
slyphon has joined #ruby
schneide_ has joined #ruby
za1b1tsu has joined #ruby
cdg has joined #ruby
schneide_ has quit [Ping timeout: 256 seconds]
cdg has quit [Ping timeout: 240 seconds]
slyphon has quit [Quit: WeeChat 2.0.1]
slyphon has joined #ruby
slyphon has quit [Client Quit]
workmad3 has joined #ruby
nwm_ has joined #ruby
alfiemax_ has joined #ruby
rabajaj has joined #ruby
slyphon has joined #ruby
n0m4d1c has joined #ruby
dionysus69 has joined #ruby
workmad3 has quit [Ping timeout: 264 seconds]
alfiemax has quit [Ping timeout: 276 seconds]
n0m4d1c has quit [Ping timeout: 268 seconds]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roonsauce has joined #ruby
nwm_ has quit [Ping timeout: 240 seconds]
DroidBurgundy has joined #ruby
roshanavand has joined #ruby
apeiros has quit [Remote host closed the connection]
roonsauce has quit [Ping timeout: 276 seconds]
nwm_ has joined #ruby
nwm_ has quit [Read error: Connection reset by peer]
DTZUZO has quit [Ping timeout: 240 seconds]
DroidBurgundy has quit [Ping timeout: 276 seconds]
slyphon has quit [Ping timeout: 264 seconds]
kies has joined #ruby
jnollette has quit [Ping timeout: 255 seconds]
jnollette has joined #ruby
alfiemax has joined #ruby
snickers has joined #ruby
alfiemax_ has quit [Ping timeout: 240 seconds]
nadir has quit [Quit: Connection closed for inactivity]
skweek has quit [Ping timeout: 256 seconds]
tvw has joined #ruby
spuk has quit [Ping timeout: 264 seconds]
conta has joined #ruby
mrush has quit [Quit: leaving]
konsolebox has quit [Ping timeout: 252 seconds]
konsolebox has joined #ruby
tefa has quit []
drewmcmillan has joined #ruby
roshanavand has quit [Ping timeout: 240 seconds]
konsolebox has quit [Ping timeout: 240 seconds]
marmorkreb has joined #ruby
konsolebox has joined #ruby
xuanrui has joined #ruby
xuanrui has quit [Client Quit]
marmorkreb has quit [Ping timeout: 240 seconds]
devil_tux has joined #ruby
alex`` has joined #ruby
howdoi has joined #ruby
schneide_ has joined #ruby
halt has joined #ruby
halt is now known as Guest82678
alfiemax has quit [Remote host closed the connection]
ramfjord has joined #ruby
slyphon has joined #ruby
alfiemax has joined #ruby
ramfjord has quit [Ping timeout: 276 seconds]
Dimik has quit [Ping timeout: 276 seconds]
slyphon has quit [Ping timeout: 264 seconds]
marmorkreb has joined #ruby
clemens3 has joined #ruby
jeffreylevesque has quit [Read error: Connection reset by peer]
anisha has joined #ruby
guardianx has joined #ruby
anisha_ has joined #ruby
lpmusic has joined #ruby
anisha has quit [Ping timeout: 265 seconds]
vyorkin has joined #ruby
skweek has joined #ruby
asqrd_ has joined #ruby
claudiuinberlin has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guardianx has quit []
konsolebox has quit [Ping timeout: 248 seconds]
ams__ has joined #ruby
anisha__ has joined #ruby
konsolebox has joined #ruby
sylario has joined #ruby
anisha_ has quit [Ping timeout: 255 seconds]
devil_tu1 has joined #ruby
workmad3 has joined #ruby
yohji has joined #ruby
maum has quit [Remote host closed the connection]
workmad3 has quit [Ping timeout: 256 seconds]
asqrd_ has quit [Quit: Leaving]
cdg has joined #ruby
amatas has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
skweek has quit [Ping timeout: 255 seconds]
cdg has quit [Ping timeout: 252 seconds]
amatas has quit [Client Quit]
amatas has joined #ruby
roshanavand has joined #ruby
anisha_ has joined #ruby
marr has joined #ruby
anisha__ has quit [Ping timeout: 240 seconds]
drewmcmillan has joined #ruby
guille-moe has joined #ruby
workmad3 has joined #ruby
guille-moe has quit [Remote host closed the connection]
guille-moe has joined #ruby
sameerynho has joined #ruby
sameerynho has quit [Ping timeout: 256 seconds]
roonsauce has joined #ruby
anisha__ has joined #ruby
kliq has joined #ruby
anisha_ has quit [Ping timeout: 268 seconds]
roonsauce has quit [Ping timeout: 248 seconds]
Silmarilion has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
RevanOne has quit [Read error: Connection reset by peer]
Beams has joined #ruby
troys has quit [Quit: Bye]
DTZUZO has joined #ruby
ramfjord has joined #ruby
slyphon has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
Serpent7776 has joined #ruby
lxsameer has joined #ruby
slyphon has quit [Ping timeout: 264 seconds]
konsolebox has joined #ruby
marmorkreb has quit [Ping timeout: 265 seconds]
yohji has quit [Ping timeout: 248 seconds]
za1b1tsu has quit [Read error: Connection reset by peer]
konsolebox has quit [Ping timeout: 268 seconds]
konsolebox has joined #ruby
rikkipitt has joined #ruby
agent_white has quit [Quit: leaving]
yohji has joined #ruby
ldnunes has joined #ruby
matcouto has joined #ruby
konsolebox has quit [Ping timeout: 248 seconds]
konsolebox has joined #ruby
zautomata has joined #ruby
apparition47 has joined #ruby
konsolebox has quit [Ping timeout: 268 seconds]
slyphon has joined #ruby
konsolebox has joined #ruby
dstol has joined #ruby
anisha_ has joined #ruby
anisha__ has quit [Ping timeout: 248 seconds]
slyphon has quit [Ping timeout: 264 seconds]
zautomata1 has quit [Quit: WeeChat 1.7]
daaaave has joined #ruby
konsolebox has quit [Ping timeout: 255 seconds]
milardovich has joined #ruby
konsolebox has joined #ruby
<daaaave> Hey, I’m pretty new to ruby and I’m writing some rspec. I noticing that I am repeating myself like crazy in tests. Is there a way to improve this so the first 4 lines are more concise? https://pastebin.com/feubvU2k
<ruby[bot]> daaaave: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/98fa24020660ddacfe45b3fbf5e69132
<ruby[bot]> daaaave: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
dstol has left #ruby [#ruby]
Silmarilion has quit [Read error: Connection reset by peer]
<dminuoso> daaaave: Are you using RSpec?
<daaaave> dminuoso: yeah
<tbuehlmann> daaaave: I'm having some questions, but without the answers to them this could save some lines: https://gist.github.com/tbuehlmann/277a976398cb681806265659a71b30f3
<dminuoso> daaaave: You can use @let to lazily memoize the construction of item/items/blumen
<dminuoso> err *let
<dminuoso> Well what tbuehlmann said =)
* dminuoso pokes tbuehlmann with an adjoint functor
* dminuoso grins as tbuehlmann is trying to figure out whether its left or right adjoint
milardovich has quit [Remote host closed the connection]
<tbuehlmann> I'm at least one step ahead of you since I don't know what a functor is, nor whether it's left or right
marmorkreb has joined #ruby
milardovich has joined #ruby
infernix has quit [Ping timeout: 265 seconds]
<dminuoso> tbuehlmann: As far as you as a programmer are concerned, a Functor is anything you can .map over.
<daaaave> oh, interesting, is there a way to use pass different args into the let in the it 'bars'?
<dminuoso> Array or Tree are examples.
damasceno has joined #ruby
<dminuoso> Hash too, there's just called "transform_values"
<dminuoso> *there it's
<damasceno> Hello. I've just finished my first ruby app and I would like to know if there's a way to create a single file to execute the app, like a simple .exe (But in this case, for Linux).
matcouto has quit [Remote host closed the connection]
<damasceno> Something similar to the .jar from Java
<dminuoso> damasceno: There's traveling Ruby. Generally it's far easier to just require ruby to be installed.
milardovich has quit [Ping timeout: 240 seconds]
<tbuehlmann> daaaave: you can use contexts to change the lets, if that's what you mean
<dminuoso> damasceno: Or if the dependencies get more complicated to ship your app inside a docker container
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
milardovich has joined #ruby
matcouto has joined #ruby
<damasceno> dminuoso: sorry, I didn't get it. The problem is: I need to tell the user to install the following gems: a,b,c (This is fine), but then I have to tell him to copy the 6 ruby (.rb) files from the application. I think it's easier to tell the user to install the gems, download the binary file "application" and execute it. Is there a way to do that?
konsolebox has quit [Ping timeout: 248 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<dminuoso> tbuehlmann: In my Q library for example there's a module called Functor. Everything is implemented in such a way, that if you have any class that satisfies: obj.is_a?(Functor) then you can blindly use .map { |a| ... }
<daaaave> tbuehlmann: alright, that's helpful
matcouto has joined #ruby
AJA4350 has joined #ruby
<daaaave> thanks dminuoso and tbuehlmann
<tbuehlmann> dminuoso: great
matcouto has quit [Remote host closed the connection]
<tbuehlmann> daaaave: most of http://www.betterspecs.org/ is good advice I'd say
<tbuehlmann> have a look
matcouto has joined #ruby
milardovich has quit [Remote host closed the connection]
<dminuoso> damasceno: Gems are managed with bundler.
konsolebox has joined #ruby
matcouto has quit [Remote host closed the connection]
<dminuoso> damasceno: That "copying ruby files" sounds a bit weird. Why exactly does the user need to copy ruby files?
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
tvw has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<damasceno> dminuoso: It's an open-source project, I have 6 files (Because I wanted to split instead of putting the entire code in one single .rb file, I don't even know if that's good, xD), so I'm going to upload these files to github and the user will need to download these files and then install the gems and then execute the main.rb file, no?
matcouto has quit [Remote host closed the connection]
<damasceno> That's what I did with another computer, to make sure it works in Mac and Linux
matcouto has joined #ruby
<dminuoso> damasceno: So one way do this is: Include a Gemfile (this is for bundler), and then the installation instructions is:
<damasceno> Please let me know if there's an easy way, I just started with ruby =T
<dminuoso> "git clone blah; cd blah; bundle"
matcouto has quit [Remote host closed the connection]
cdg has joined #ruby
<dminuoso> And then everything is done.
rikkipitt has quit [Remote host closed the connection]
matcouto has joined #ruby
<dminuoso> damasceno: Or you build a gem.
matcouto has quit [Remote host closed the connection]
<dminuoso> damasceno: That is the ideal way, because then it just boils down to "gem install blah" assuming you published it on rubygems.org
matcouto has joined #ruby
<damasceno> Hum, I'll check that to see what's the easiest way for the user to execute it. Thanks for your help =)
<dminuoso> damasceno: It's not hard. =)
matcouto has quit [Remote host closed the connection]
<damasceno> So you think building my own gem is easier for the user, right?
<dminuoso> damasceno: Yes.
matcouto has joined #ruby
<damasceno> Will do that then, thank you very much :)
<dminuoso> damasceno: Here's how you use rails: `gem install rails`, you wait a moment, and then you have the `rails` executable available. =)
matcouto has quit [Remote host closed the connection]
<damasceno> Yes, that's exactly what I want
<damasceno> :D :D
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
amatas_ has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
infernix has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
rikkipitt has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
luna_x has quit [Ping timeout: 260 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
milardovich has joined #ruby
luna_x has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
milardovich has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
milardovich has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
daaaave has quit [Quit: Page closed]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
amatas_ has quit [Quit: amatas_]
matcouto has quit [Remote host closed the connection]
vyorkin has quit [Ping timeout: 255 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
amatas_ has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
sonOfRa has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
DroidBurgundy has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
cdg has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
ramfjord has joined #ruby
matcouto has joined #ruby
damasceno has quit [Quit: Page closed]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
DroidBurgundy has quit [Ping timeout: 248 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
goatish has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 256 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
sonOfRa has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
GodFather has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
c0ncealed has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
c0ncealed has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
nowhere_man has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
milardovich has quit [Remote host closed the connection]
matcouto has joined #ruby
jerikl has joined #ruby
jerikl has quit [Client Quit]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
nowhereman_ has quit [Ping timeout: 268 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
KeyJoo has quit [Remote host closed the connection]
anisha_ has quit [Ping timeout: 240 seconds]
matcouto has quit [Remote host closed the connection]
anisha_ has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
cdg has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
tvw has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
konsolebox has quit [Ping timeout: 265 seconds]
cdg has quit [Ping timeout: 252 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
konsolebox has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
rapha has joined #ruby
<rapha> hi
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<jhass> hi
spectrum has quit [Ping timeout: 248 seconds]
matcouto has joined #ruby
AJA4350 has quit [Ping timeout: 252 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<rapha> in https://gist.github.com/sixtyfive/2180574730f3f2f28ee1532639c9a9f3 , the gets in line 7 only works the first time through the loop. Beginning with the second time, it never waits for that user input and skips to the gets in line 11 instead. What am I doing wrong?
terens has joined #ruby
matcouto has quit [Remote host closed the connection]
apparition47 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
spectrum has joined #ruby
cajone has joined #ruby
matcouto has quit [Remote host closed the connection]
cajone has left #ruby [#ruby]
<jhass> mh, I'm surprised it gets to the second one even, since Ctrl+D/EOF closes the file descriptor
matcouto has joined #ruby
<jhass> ah, nvm I misread
matcouto has quit [Remote host closed the connection]
AJA4350 has joined #ruby
matcouto has joined #ruby
<jhass> maybe it has to do with the mismatch between STDIN.gets("EOF") and html.include? "EOI" in the next line?
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
SecretNINJA has joined #ruby
apparition47 has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<rapha> jhass: i mean different things by EOF and EOI
<rapha> but perhaps i should think of my own magical markers instead of using ones that are more or less commonplace
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
amatas_ has quit [Ping timeout: 248 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<rapha> jhass: so i changed them from "EOI" and "EOF" to "DONE" and "NEXT" but that doesn't help.
matcouto has joined #ruby
antoniobeyah has quit [Quit: Connection closed for inactivity]
matcouto has quit [Remote host closed the connection]
amatas_ has joined #ruby
matcouto has joined #ruby
<jhass> I would add a p(name) between ll. 7 and 8 to see what the value is when it's "skipped"
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<jhass> I guess your terminal is line mode so there's a trailing \n left which the second gets in the first loop doesn't consume
Cthulu201 has quit [Quit: Nowhere special. I always wanted to go there.]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
vondruch_ has joined #ruby
matcouto has quit [Remote host closed the connection]
devil_tux has quit [Ping timeout: 276 seconds]
matcouto has joined #ruby
vondruch has quit [Ping timeout: 260 seconds]
vondruch_ is now known as vondruch
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matcouto has quit [Remote host closed the connection]
* dminuoso consumes an apple
matcouto has joined #ruby
devil_tu1 has quit [Ping timeout: 276 seconds]
mtkd has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
milardovich has joined #ruby
matcouto has quit [Remote host closed the connection]
<rapha> jhass: updated the gist with the script's output and indeed there's now a newline between the two print() outputs so it looks like you're right. what's the remedy though? is there some sort of buffer clear method?
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<rapha> dminuoso: much health to you!
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
SebastianThorn has joined #ruby
<jhass> well you could just require the newline and do gets("NEXT\n")
<pavelz> so what is the deal with .try(:[], b) command why :[] Symbol is used ?
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
tcopeland has quit [Quit: tcopeland]
<jhass> to call the [] method, foo[b] is just syntax sugar for foo.[](b)
matcouto has quit [Remote host closed the connection]
<pavelz> oh lol ok thanks.
matcouto has joined #ruby
<rapha> jhass: finally!!!! thank you a million times! after three days it works!
synthroid has joined #ruby
<dminuoso> pavelz: methods are identified by symbols (in fact the entire reason for symbols existing is to identify methods and other things)
matcouto has quit [Remote host closed the connection]
<dminuoso> pavelz: So the correct way to refer to a method is by a symbol. =)
milardovich has quit [Ping timeout: 255 seconds]
matcouto has joined #ruby
* rapha wanders off happily to get a good nap in
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
Cthulu201 has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
slyphon has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
milardovich has joined #ruby
stormpack has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
slyphon has quit [Ping timeout: 264 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
rikkipitt has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
rikkipitt has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
DroidBurgundy has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
anisha_ has quit [Ping timeout: 255 seconds]
leitz has joined #ruby
matcouto has joined #ruby
DroidBurgundy has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
DroidBurgundy has joined #ruby
DroidBurgundy has quit [Remote host closed the connection]
stormpack_ has joined #ruby
devil_tux has joined #ruby
devil_tu1 has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
stormpack has quit [Ping timeout: 240 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
anisha_ has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
jokke has joined #ruby
<jokke> hey
matcouto has joined #ruby
<jokke> how can i find all classes that include a certain module?
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
nadir has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
k0mpa has joined #ruby
<jhass> ObjectSpace.each_object(Class).select {|c| c.ancestors.include? Mod } something like that
matcouto has joined #ruby
amatas_ has quit [Quit: amatas_]
<jhass> if you control the module it might be better to keep a tailly via the included hook
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<jokke> oh hi jhass!
<jhass> but I hope this is just for debugging anyway
<jokke> long time no see
* dminuoso thinks jokke could have thought of this himself
<jhass> yeah :P
<jokke> yeah i thought of using the included hook
matcouto has quit [Remote host closed the connection]
<jokke> unfortunately not for debugging purposes
shinnya has joined #ruby
<dminuoso> jokke: That wont catch builtins
matcouto has joined #ruby
<dminuoso> Or prepended things
<jokke> it's a active support concern
<jokke> very limited use
<dminuoso> jokke: Those "concerns" are just plain old modules with some minor sugar
<jokke> yeah
matcouto has quit [Remote host closed the connection]
<jokke> but they're used in a very limited context
matcouto has joined #ruby
<dminuoso> jhass: Also.. ancestors.include? ? :(
<dminuoso> What happened to you?
matcouto has quit [Remote host closed the connection]
<jhass> nothing :o
matcouto has joined #ruby
<jokke> dminuoso: he's on the crystal side now!
<jokke> :)
<dminuoso> Oh
matcouto has quit [Remote host closed the connection]
<dminuoso> jhass: Does Crystal have some dirty ObjectSpace backdoor to find anything, including next years christmas presents?
<jokke> how would i best register the including classes? class var? class instance var?
matcouto has joined #ruby
<jokke> dminuoso: crystal has awesome macros :)
<dminuoso> jokke: class variables are almost always the wrong choice. ;-)
<jhass> dminuoso: no :(
matcouto has quit [Remote host closed the connection]
<jokke> dminuoso: which ones were the ones that get inherited, again?
<dminuoso> jhass: macros in what sense? in the sense of elixir rewriting ASTs?
<jhass> class level instance var seems about right
matcouto has joined #ruby
<jokke> dminuoso: yeah
<dminuoso> jokke: class vars have that inheritance behavior which makes them kind of weird
matcouto has quit [Remote host closed the connection]
<jhass> well, you read from the AST to produce new code that's fed back into the parser
<jokke> dminuoso: you can even compile and run whole programs that will generate code which will be replaced for your macro
matcouto has joined #ruby
<jokke> it's really powerful
matcouto has quit [Remote host closed the connection]
<jokke> but like rubys metaprogramming it can get very "magical" very fast
matcouto has joined #ruby
<jokke> dminuoso: ah yeah ok
<dminuoso> jokke: a class "instance" var otoh is nothing special. It's just a regular instance variable.
<jokke> yeah
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<dminuoso> jhass: fun fact, did you know that ruby uses a stack machine to dynamically at runtime determine the nesting?
<dminuoso> I recently learned this myself.
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<jhass> tbh i don't even know what a stack machine is
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<dminuoso> jhass: something that uses a stack to maintain state. at certain code regions Ruby just emits a "push XYZ onto nesting stack", and at other code regions Ruby emits a "pop whatever is on the current stack"
<jhass> oh, do you just mean the datastructure that's often available as "stack", that is a pop/push optimized array?
matcouto has quit [Remote host closed the connection]
<jhass> ok
<dminuoso> Originally I thougth nesting was lexically determined
matcouto has joined #ruby
<jhass> ah
matcouto has quit [Remote host closed the connection]
<jhass> I see
<dminuoso> And then I learned that `class << a` and `instance_eval(str)/class_eval(str)` push the respective class dynamically
<dminuoso> (As opposed to not at all)
matcouto has joined #ruby
<dminuoso> >> 1.instance_eval { puts Module.nesting }
<ruby[bot]> dminuoso: # => nil (https://eval.in/956325)
<jhass> actually makes sense keeping that in mind
<dminuoso> >> 1.class_eval { puts Module.nesting }
<ruby[bot]> dminuoso: # => undefined method `class_eval' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/956326)
<dminuoso> uhh
<dminuoso> >> 1.class_eval "puts Module.nesting"
<ruby[bot]> dminuoso: # => undefined method `class_eval' for 1:Fixnum (NoMethodError) ...check link for more (https://eval.in/956327)
matcouto has quit [Remote host closed the connection]
<dminuoso> >> 1.instance_eval "puts Module.nesting"
<jhass> haha
<dminuoso> >> 1.instance_eval "puts Module.nesting"
matcouto has joined #ruby
<jhass> time to pry ;P
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<dminuoso> Next lesson learned
<dminuoso> >> "foo".instance_eval "puts Module.nesting"
<ruby[bot]> dminuoso: # => #<Class:#<String:0x422e1b88>> ...check link for more (https://eval.in/956328)
<dminuoso> Apparently Integer doesnt have singleton classes.
matcouto has quit [Remote host closed the connection]
<dminuoso> jhass: ^- and this is the surprising bit. This only happens if you use the String form, but not the block form.
matcouto has joined #ruby
yohji has quit [Ping timeout: 248 seconds]
<jhass> haha
<jhass> how dare you to wish for consistency
<dminuoso> >> class << foo; puts Module.nesting; end
<ruby[bot]> dminuoso: # => undefined local variable or method `foo' for main:Object ...check link for more (https://eval.in/956330)
matcouto has quit [Remote host closed the connection]
<dminuoso> >> class << "foo"; puts Module.nesting; end
<ruby[bot]> dminuoso: # => #<Class:#<String:0x41355b24>> ...check link for more (https://eval.in/956331)
<dminuoso> So this gives you a backdoor to create an arbitrary nesting stack. Its fun.
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<dminuoso> jhass: Yeah indeed. So did you ditch Ruby for good?
matcouto has joined #ruby
<jhass> nah, just not actively using it for anything beyond slack bots currently
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
jcalla has joined #ruby
<dminuoso> But using Crystal otherwise?
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<jhass> for hobby projects yeah
<dminuoso> What do you use professionally then?
matcouto has quit [Remote host closed the connection]
<jhass> currently Android apps
matcouto has joined #ruby
<dminuoso> Sounds like Java or possibly RN
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<jhass> Java, think I might try Kotlin for the next small enough thing possible, KTX looks promising
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
sheepofdoom has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<jhass> RN is terrible :P
stormpack_ has quit [Quit: Leaving]
matcouto has quit [Remote host closed the connection]
<sheepofdoom> jhass react native?
matcouto has joined #ruby
<jhass> yeah
<sheepofdoom> yeah, it is
ramfjord has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<sheepofdoom> I was wondering how complicated it might be to migrate a project from using celluloid to concurrent-ruby? I know it depends on the project but some best practices, hints or advices would be appreciated.
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
marmorkreb has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
yohji has joined #ruby
matcouto has joined #ruby
ramfjord has quit [Ping timeout: 252 seconds]
conta has quit [Ping timeout: 240 seconds]
conta has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<kspencer> Is there an easyish way to read files that are in a installed gems src, like Thor long_desc files for options
matcouto has quit [Remote host closed the connection]
<jhass> pry
<jhass> show-source / $
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
devil_tu1 has quit [Ping timeout: 240 seconds]
vondruch_ has joined #ruby
<kspencer> pry doesn't quite help me inside a running script without debugging it
matcouto has quit [Remote host closed the connection]
devil_tu1 has joined #ruby
slyphon has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<dminuoso> jhass: You should try Clojure =P
matcouto has joined #ruby
<dminuoso> With homoiconicity you get the power of macros but as a first class feature!
matcouto has quit [Remote host closed the connection]
vyorkin has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
vondruch has quit [Ping timeout: 240 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
slyphon has quit [Ping timeout: 264 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 240 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
raynold has quit [Quit: Connection closed for inactivity]
matcouto has joined #ruby
TomyWork has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
vyorkin has quit [Ping timeout: 264 seconds]
matcouto has quit [Remote host closed the connection]
dextrey has joined #ruby
matcouto has joined #ruby
krawchyk has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<kspencer> ok got it
<kspencer> long_desc File.read(Pathname("#{File.dirname(__FILE__)}/page.txt").realdirpath)
jeffreylevesque has joined #ruby
matcouto has quit [Remote host closed the connection]
amatas_ has joined #ruby
matcouto has joined #ruby
devil_tux has quit [Ping timeout: 240 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
matcouto has quit [Remote host closed the connection]
devil_tu1 has quit [Ping timeout: 260 seconds]
matcouto has joined #ruby
konsolebox has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
_aeris_ has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
_aeris_ has joined #ruby
DLSteve_ has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
tcopeland has joined #ruby
shinnya has quit [Ping timeout: 255 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
yohji has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<zleap> can someone better explain the yield instruction please
matcouto has joined #ruby
yohji has joined #ruby
<jhass> better than who? :D
<zleap> so far i codecademy
matcouto has quit [Remote host closed the connection]
<jhass> ah
<jhass> did you get blocks yet?
matcouto has joined #ruby
<zleap> yea
matcouto has quit [Remote host closed the connection]
<jhass> so yield is just how your own methods can take and invoke a block
matcouto has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
<zleap> ah ok so i invoke(call) a block from within a block
matcouto has quit [Remote host closed the connection]
<jhass> a method is not a block
<zleap> ok
matcouto has joined #ruby
<jhass> similar granted, but not the same
<zleap> method is like y*2
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<zleap> i am trying to work out where the variable num is created in that code example
<jhass> a method definition is the def foo(x); end thing
<zleap> ah ok
<jhass> it's the argument, (num)
SecretNINJA is now known as Psybur
<zleap> and the block is the bit in themiddle
matcouto has quit [Remote host closed the connection]
<jhass> the block in your example is {|x| puts x * 2}
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
<zleap> yeah
matcouto has joined #ruby
<zleap> i guess i am thinking python where num is the variable holding what ever value you are passing to the block and back to the code that called it
matcouto has quit [Remote host closed the connection]
anisha_ has quit [Ping timeout: 248 seconds]
matcouto has joined #ruby
<zleap> as in that code it calls num, but then does nto use num explicitally in the method
<jhass> num is nothing you can call, it's just a variable holding the integer 16
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<elomatreb> It effectively works like a method argument, you cannot change a in the method from the block
* kspencer also wised up and put the descriptions into a file and made them part of the module
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
h00d has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
lxsameer has quit [Quit: WeeChat 1.9.1]
matcouto has quit [Remote host closed the connection]
wandering_vagran has joined #ruby
<h00d> Hi guyz[
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
konsolebox has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<zleap> jhass: thanks,
<zleap> i need to do more reading, i have nearly 70 pages of copy / paste notes for this
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
LastWhisper____ has joined #ruby
apparition47 has quit [Quit: Bye]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
workmad3 has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
cdg has joined #ruby
matcouto has quit [Remote host closed the connection]
alex`` has quit [Ping timeout: 252 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
jobewan has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
behraaang has quit [Ping timeout: 260 seconds]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
claudiuinberlin has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
sindork_ has quit [Quit: ZNC - http://znc.in]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
tlaxkit has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
mtkd has quit [Ping timeout: 255 seconds]
kliq has quit [Ping timeout: 255 seconds]
terens2 has joined #ruby
matcouto has quit [Remote host closed the connection]
terens has quit [Remote host closed the connection]
matcouto has joined #ruby
ramfjord has joined #ruby
matcouto has quit [Remote host closed the connection]
mtkd has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
wandering_vagran has left #ruby ["Leaving"]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
chouhoulis has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
banisterfiend has joined #ruby
terens2 has quit [Quit: Leaving]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
slyphon has joined #ruby
matcouto has quit [Remote host closed the connection]
banisterfiend has quit [Client Quit]
matcouto has joined #ruby
cdg has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
leitz has quit [Remote host closed the connection]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
Rapture has joined #ruby
matcouto has quit [Remote host closed the connection]
k0mpa has quit [Remote host closed the connection]
schneide_ has quit [Remote host closed the connection]
matcouto has joined #ruby
schneide_ has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
schneide_ has quit [Read error: Connection reset by peer]
matcouto has quit [Remote host closed the connection]
slyphon has quit [Ping timeout: 264 seconds]
matcouto has joined #ruby
leitz has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
sheepofdoom has quit [Quit: Going offline, see ya! (www.adiirc.com)]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
Quentinius has joined #ruby
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
ta_ has quit [Read error: Connection reset by peer]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
ta_ has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
Quentinius has quit [Client Quit]
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
schneide_ has joined #ruby
netherwolfe has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
Mrgoose2 has quit [Ping timeout: 276 seconds]
roonsauce has joined #ruby
chouhoulis has quit [Remote host closed the connection]
matcouto has quit [Ping timeout: 255 seconds]
goatish has quit [Quit: Hibernating]
chouhoulis has joined #ruby
qba73 has joined #ruby
Mrgoose2 has joined #ruby
qba73 has quit [Ping timeout: 265 seconds]
Cavallari has joined #ruby
lxsameer has joined #ruby
McSoFake has joined #ruby
qba73 has joined #ruby
rippa has joined #ruby
dviola has joined #ruby
tomphp has joined #ruby
Gnut has joined #ruby
f3ttX] has joined #ruby
n0m4d1c has joined #ruby
tomphp has quit [Client Quit]
marmorkreb has joined #ruby
marmorkreb has quit [Remote host closed the connection]
marmorkreb has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
rikkipitt has quit [Quit: Leaving...]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
s2013 has joined #ruby
regedit has joined #ruby
f3ttX] has quit [Ping timeout: 276 seconds]
drona6 has joined #ruby
schneide_ has quit [Remote host closed the connection]
schneide_ has joined #ruby
rabajaj has quit [Remote host closed the connection]
banisterfiend has joined #ruby
spiette_ has joined #ruby
schneide_ has quit [Remote host closed the connection]
schneide_ has joined #ruby
milardovich has quit []
schneide_ has quit [Ping timeout: 252 seconds]
schneide_ has joined #ruby
aufi has quit [Quit: Leaving]
sanscoeur has quit [Remote host closed the connection]
karl___ has joined #ruby
slyphon has joined #ruby
schneide_ has quit [Remote host closed the connection]
<karl___> I'm using Net/Http to send a web request. The webserver is replying with a messed up header in the response, and I can't access the header via response.header. Is is possible to get the raw http response from net/http?
<jhass> I doubt it, but I could imagine you can get the raw request and fire it to your own TCPSocket
jokke1 has quit [Ping timeout: 256 seconds]
jokke1 has joined #ruby
jokke1 has quit [Client Quit]
conta has quit [Ping timeout: 248 seconds]
schneide_ has joined #ruby
tobiasvl has quit [Ping timeout: 240 seconds]
<headius> arahael: you'll get used to it :-)
<headius> although Matz prefers people say "CRuby" now
n0m4d1c has quit [Remote host closed the connection]
synthroid has quit [Remote host closed the connection]
mikecmpbll has joined #ruby
qba73 has quit [Remote host closed the connection]
schneide_ has quit [Ping timeout: 248 seconds]
<mikecmpbll> bit of a silly question, but in this article why does tenderlove delimit his heredoc with EORUBY? what does the EO mean? http://tenderlovemaking.com/2013/03/03/dynamic_method_definitions.html
qba73 has joined #ruby
<adaedra> End Of
GodFather has quit [Ping timeout: 256 seconds]
<adaedra> Because heredocs are often delimited with EOF, End of file
<mikecmpbll> ahh. :)
<mikecmpbll> ty
tvl has joined #ruby
tvl is now known as tobiasvl
spuk has joined #ruby
minimalism has quit [Quit: minimalism]
ledestin has joined #ruby
pastorinni has joined #ruby
synthroid has joined #ruby
marmorkreb has quit [Ping timeout: 276 seconds]
Cavallari has quit [Quit: Cavallari]
troys has joined #ruby
n0m4d1c has joined #ruby
yoru has joined #ruby
qba73 has quit []
desperek has joined #ruby
nowhereman_ has joined #ruby
jcarl43 has joined #ruby
nowhere_man has quit [Ping timeout: 256 seconds]
orbyt_ has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
alex`` has joined #ruby
RougeR has quit [Ping timeout: 248 seconds]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jpterry has quit [*.net *.split]
brainslug has quit [*.net *.split]
jpterry has joined #ruby
akhkharu has joined #ruby
ahrs has joined #ruby
brixen_ has quit [Quit: ZNC - http://znc.in]
apeiros has joined #ruby
[Butch] has joined #ruby
suhdood has joined #ruby
conta has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dimik has joined #ruby
luna_x has quit [Quit: WeeChat 2.0.1]
haylon has joined #ruby
roonsauce has quit [Remote host closed the connection]
John_Ivan has joined #ruby
John_Ivan has joined #ruby
John_Ivan has quit [Changing host]
orbyt_ has joined #ruby
yoru has quit [Quit: Lost terminal]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
karl___ has quit [Ping timeout: 260 seconds]
<banisterfiend> anyone here have experiences shipping a binary in a ruby gem?
<banisterfiend> i mean an actual binary, not just an executable ruby file, and something i don't want on the load path, just a binary to be used internally by the gem
roonsauce has joined #ruby
<havenwood> banisterfiend: the wkhtmltopdf-binary gem is one that comes to mind - but I'm not sure how nicely they've done it
<banisterfiend> thanks i'll check it out
DigitallyBorn has joined #ruby
<banisterfiend> havenwood cool they hvae a libexec/ folder
<banisterfiend> i'll try tht
<banisterfiend> fucking 'etags' is different on different platforms and linux versions, it results in differenly formatted output :/
<banisterfiend> so i have to ship my own etags binary
oroborous has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
alex`` has quit [Quit: WeeChat 2.0.1]
quobo has joined #ruby
kies has quit [Ping timeout: 265 seconds]
roonsauce has quit [Remote host closed the connection]
krawchyk has quit [Quit: krawchyk]
darkhanb has joined #ruby
krawchyk[away] has joined #ruby
yohji has quit [Remote host closed the connection]
Serpent7776 has quit [Quit: Leaving]
mikecmpbll has quit [Ping timeout: 256 seconds]
krawchyk[away] has quit [Client Quit]
aeyxa has joined #ruby
<aeyxa> I'm using this .each thing on a list divided by a number, how can I check for remainders with it?
Silmarilion has joined #ruby
<apeiros> &ri Integer#% aeyxa
<apeiros> % is the modulo method in ruby. returns the remainder.
banisterfiend has quit [Quit: Textual IRC Client: www.textualapp.com]
stormpack has joined #ruby
<aeyxa> yeah but how do I do remainder of the .each iteration?
<aeyxa> inside the loop?
<aeyxa> do I do it on the variable the split array is assigned to?
krawchyk has joined #ruby
krawchyk is now known as krawchyk[away]
jcarl43 has quit [Quit: WeeChat 2.0.1]
krawchyk[away] has quit [Client Quit]
conceivably has joined #ruby
<aeyxa> gonna just do a try except when it fails instead...
drakko has joined #ruby
xenops has joined #ruby
DigitallyBorn has quit [Quit: leaving]
drakko has quit [Remote host closed the connection]
<conceivably> Hi there. I would like to do some transformations on an object that internally has a structure that resembles a tree (i.e. it may have children and it may have a parent reference). At the same time I would like to keep a copy of the original object intact. Since the object is nested, clone won't do. I've tried using Marshal to duplicate the object, but that doesn't work under some circumstances. Given how difficult/hacky it seems to
<conceivably> properly deep copy an object in Ruby, I'm assuming that this simply is not the correct approach, and that there must be a better way. What other approach would be better? Requirements: I'd like to transform an arbitrarily deeply nested object, and also keep a copy of the original. Thanks :)
krawchyk has joined #ruby
desperek has quit [Ping timeout: 248 seconds]
krawchyk has quit [Client Quit]
kliq has joined #ruby
sanscoeur has joined #ruby
sanscoeur has quit [Remote host closed the connection]
krawchyk has joined #ruby
krawchyk has quit [Client Quit]
sanscoeur has joined #ruby
Beams has quit [Quit: .]
roonsauce has joined #ruby
hackeron has joined #ruby
aeyxa has left #ruby [#ruby]
krawchyk has joined #ruby
dextrey has quit [Ping timeout: 264 seconds]
ren0v0 has quit [Ping timeout: 248 seconds]
krawchyk has quit [Client Quit]
ren0v0 has joined #ruby
conta has quit [Ping timeout: 248 seconds]
mikecmpbll has joined #ruby
<hackeron> hey there, quick question about sementic logger - is there any easy way to have semanticlogger log when a process exits or otherwise dies with an exception? - I can't find anything built in, I take it I need to use at_exit or similar?
jaequery has joined #ruby
raynold has joined #ruby
cagomez has joined #ruby
krawchyk has joined #ruby
hahuang65 has joined #ruby
jerikl has joined #ruby
<hackeron> I guess this is an easy enough solution: at_exit { err = $!; logger.error(error) if err }
yonahw has quit [Read error: Connection reset by peer]
eckhardt has joined #ruby
devil_tux has joined #ruby
cagomez has quit [Remote host closed the connection]
suhdood_ has joined #ruby
SeepingN has joined #ruby
suhdood has quit [Ping timeout: 255 seconds]
kies has joined #ruby
suhdood_ has quit [Read error: Connection reset by peer]
marxarelli|afk is now known as marxarelli
alex`` has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
alex`` is now known as alexherbo2
alexherbo2 is now known as alex``
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
despai has joined #ruby
andy___ has joined #ruby
andy___ is now known as andydna
alfiemax has joined #ruby
cagomez has joined #ruby
tvw has quit [Remote host closed the connection]
Guest82678 has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
DTZUZO has quit [Ping timeout: 255 seconds]
RougeR has quit [Ping timeout: 276 seconds]
morenoh149 has joined #ruby
sameerynho has joined #ruby
AndBobsYourUncle has joined #ruby
cagomez has quit [Ping timeout: 256 seconds]
kapil___ has joined #ruby
tlaxkit has quit [Quit: Saliendo...]
despai has quit [Ping timeout: 240 seconds]
jerikl has joined #ruby
stormpack has quit [Quit: Leaving]
despai has joined #ruby
cagomez has joined #ruby
Gnut has quit [Ping timeout: 248 seconds]
despai has quit [Ping timeout: 256 seconds]
Gnut has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
Silmarilion has quit [Read error: Connection reset by peer]
despai has joined #ruby
cagomez has joined #ruby
Gnut has quit [Ping timeout: 255 seconds]
gr33n7007h has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Gnut has joined #ruby
gr33n7007h is now known as al2o3-cr
alfiemax_ has joined #ruby
alfiemax has quit [Read error: Connection reset by peer]
jeffreylevesque_ has joined #ruby
drewmcmillan has joined #ruby
krawchyk has quit [Quit: krawchyk]
<havenwood> I wrote an article on Ruby's new JIT. I'd love any feedback!: https://medium.com/square-corner-blog/rubys-new-jit-91a5c864dd10
<havenwood> It's not super technical, but any corrections are welcome.
<guacamole> its amazing! my fav article of the year
jeffreylevesque has quit [Ping timeout: 260 seconds]
guille-moe has quit [Ping timeout: 256 seconds]
<havenwood> ¯\_(ツ)_/¯ success!
<havenwood> ha
jeffreylevesque_ has quit [Ping timeout: 248 seconds]
marmorkreb has joined #ruby
<hackeron> havenwood: fantastic stuff, thank you for that, I didn't know about this :)
<hackeron> shame will have to wait till Christmas for this though :(
mostlybadfly has quit [Quit: Connection closed for inactivity]
<havenwood> hackeron: Here's a little script to install Ruby nightly where chruby will autodetect it: https://gist.github.com/havenwood/823382815cbdcfddadd798d4042023a8
Ali_ has joined #ruby
<havenwood> iir on RVM it's: rvm install ruby-head
<Ali_> I'll be glad to have your feedback: https://github.com/AliSepehri/rails-live-app
morenoh149 has quit [Ping timeout: 256 seconds]
cdg has quit [Remote host closed the connection]
marmorkreb has quit [Ping timeout: 248 seconds]
mtkd has quit [Ping timeout: 276 seconds]
workmad3 has quit [Ping timeout: 252 seconds]
mtkd has joined #ruby
<havenwood> Ali_: I'd vote use an ordered list for your points so it's easier to discuss a number.
<havenwood> Ali_: Since Rails prefers `rails db:...` to `rake db:...` I'd say use "rails".
<havenwood> Ali_: I think the ideal command for a new setup is: rails db:setup
m has joined #ruby
<havenwood> Which is the two steps you mentioned, plus a seed.
m is now known as Guest12077
<havenwood> I definitely agree on not ignoring schema.rb and Gemfile.lock. (People ignore the Gemfile.lock in Rails apps?? Yikes!)
desperek has joined #ruby
hahuang65 has quit [Quit: WeeChat 2.0.1]
amatas_ has quit [Quit: amatas_]
<havenwood> Ali_: I would add to seeds being idempotent and having necessary data changes that when there are data changes there should be an #up and #down and the #down should revert them.
<Guest12077> I would never ignore Gemfile.lock, i've been involved with discussions around schema.rb
drakko has joined #ruby
mgraf has joined #ruby
Guest12077 has quit [Client Quit]
drakko has quit [Client Quit]
<Ali_> havenwood: also db:setup command uses db:schema:load
<havenwood> Ali_: Aye, I like that.
<havenwood> Faster.
desperek has quit [Ping timeout: 260 seconds]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Ali_> havenmood: thanks +1
n0m4d1c has quit [Remote host closed the connection]
drewmcmillan has joined #ruby
terens has joined #ruby
<Ali_> havenmood: I put them in numeric order
<terens> How can I efficiently keep a map with blocks but expire them after some time ?
LocaMocha has quit [Read error: Connection reset by peer]
johnjoseph___ has joined #ruby
<havenwood> terens: I'm curious, can you say more about what you're wanting to do?
Ali_ has left #ruby [#ruby]
<terens> I want to do some kind of high level async request/response
Ali_ has joined #ruby
Ali_ has left #ruby [#ruby]
<terens> send_msg(msg) { #cb }
Ali_ has joined #ruby
ramfjord has joined #ruby
Ali_ has left #ruby [#ruby]
<johnjoseph___> Hi! I have what seems to be a simple question but I can't find anyone discussing it, maybe I'm googling the wrong thing. From my understanding of RUBY_GC_HEAP_GROWTH_FACTOR, it will effect the behavior of ruby's initial acquisition of memory, and then once a process is started up and settled into its memory size, it doesn't effect behavior after that (because ruby doesn't give back OS memory). so, it seems that it
<johnjoseph___> will esentially always make sense to set this quite low for web apps (or other servers/daemons), because the benefit of having the process take as little memory as possible far outweighs the cost of the process taking a few seconds longer to start. Does this sound right?
<baweaver> terens: sounds like an XY problem
<baweaver> ?xy
<ruby[bot]> it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<mgraf> "RUBY_GC_HEAP_GROWTH_FACTOR
<mgraf> The factor by which the size of the heap grows when it needs to be expanded. Default value is 1.8. This has a direct influence on GC.stat[:heap_increment] since it is the relevant factor for heap resizing."
xfbs has joined #ruby
<johnjoseph___> i'm not asking for a specific solution to a problem, and i have read the one-sentence description of the config variable, and i have looked at that blog post and it doesn't address my question.
<terens> baweaver, What I want to do is socket communication between a rails app and ruby app. And I was examining whether it is possible to do a request response thing
<terens> I use actioncable - websocket with rails already
<baweaver> Probably, though I'd have to look into how on ActionCable
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quobo has quit [Quit: Connection closed for inactivity]
<johnjoseph___> @terens if you want to communicate between two ruby processes, actioncable is almost certainly not what you want. You can do inter-process communication using "pipes" https://www.jstorimer.com/blogs/workingwithcode/7766091-introduction-to-ipc-in-ruby
<johnjoseph___> (or maybe i'm incorrectly assuming your apps are on the same machine)
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<terens> baweaver, yes but it doesnt have acks like socket io. However in socket io seems pretty simple
reber has quit [Remote host closed the connection]
guacamole has joined #ruby
alfiemax_ has quit [Read error: Connection reset by peer]
alfiemax has joined #ruby
shinnya has joined #ruby
jamiejackson has joined #ruby
psychicist__ has quit [Ping timeout: 256 seconds]
pastorinni has quit [Remote host closed the connection]
cagomez has quit [Remote host closed the connection]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
nowhere_man has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<darkhanb> I have an SSL error in my Ruby 2.1.3 installation on Debian 9: "OpenSSL::SSL::SSLError: SSL_connect returned=1 errno=0 state=error: certificate verify failed".
<darkhanb> My ruby installation procedure was:
<darkhanb> 1) Manually compiled openssl-1.0.2n and installed to a special folder under /opt/...
<darkhanb> 2) Properly updated ldconfig for openssl-1.0.2n
<darkhanb> 3) Manually compiled Ruby 2.1.3 (with correct CPPFLAGS, LDFLAGS to openssl-1.0.2n)
<darkhanb> Everything seems to be working, gem installations over HTTPS is working. However a simple open('https://www.google.com/') fails.
nowhereman_ has quit [Ping timeout: 256 seconds]
cagomez has quit [Remote host closed the connection]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hahuang65 has joined #ruby
d10n-work has joined #ruby
Gnut has quit [Ping timeout: 256 seconds]
morenoh149 has joined #ruby
Gnut has joined #ruby
alfiemax_ has joined #ruby
Rapture has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xenops has quit [Remote host closed the connection]
schneide_ has joined #ruby
<terens> darkhanb, do you have correct system time
<terens> ?\
tvw has joined #ruby
<darkhanb> terens yes, I have ntp installed and running
<terens> seems it doesnt trust google cert
alfiemax has quit [Ping timeout: 240 seconds]
morenoh149 has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
<darkhanb> terens I just have a feeling, that maybe since my openssl installation was not in the standard location, I have to let ruby know of the location of certificates
Rapture has joined #ruby
<darkhanb> but some certificates in /usr/local/lib/ruby/2.1.0/rubygems/ssl_certs
<darkhanb> *but I see some certificates
<darkhanb> maybe it's used just for gem
<terens> maybe
<terens> why not using a newer ruby ?
<mgraf> darkhanb, could you just sym link to the normal install location?
<darkhanb> terens current application requirement
<terens> dunno I would try some net http directly and set cert store
<terens> you can disable ssl verification but I do not recommend it
<darkhanb> Ah
<darkhanb> that was it
Vapez has joined #ruby
claudiuinberlin has joined #ruby
<darkhanb> I symlinked /opt/.deps_ruby-2.1.3/ssl/certs to /etc/ssl/certs, and it worked
<mgraf> :)
<darkhanb> thanks mgraf
<darkhanb> thanks terens for your responses
<darkhanb> good to have an IRC channel where people listen to your problems :)
<zleap> darkhanb: yup, this is why i like IRC
Mike11 has joined #ruby
cagomez has quit [Remote host closed the connection]
ldnunes has quit [Quit: Leaving]
desperek has joined #ruby
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roonsauce has quit [Remote host closed the connection]
h00d has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Psybur has quit [Ping timeout: 255 seconds]
clemens3 has quit [Ping timeout: 268 seconds]
roonsauce has joined #ruby
roonsauce has quit [Remote host closed the connection]
roonsauce has joined #ruby
chat_ has joined #ruby
ams__ has quit [Quit: Connection closed for inactivity]
tomphp has joined #ruby
roonsauce has quit [Remote host closed the connection]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pastorinni has joined #ruby
terens has quit [Ping timeout: 264 seconds]
jamiejackson has quit [Ping timeout: 240 seconds]
morenoh149 has joined #ruby
drona6 has quit []
pastorinni has quit [Ping timeout: 248 seconds]
<mgraf> Anyone here in Austin ?
morenoh149 has quit [Ping timeout: 248 seconds]
clemens3 has joined #ruby
spuk has quit [Quit: Human beings were created by water to transport it uphill.]
claudiuinberlin has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
roonsauce has joined #ruby
vyorkin has joined #ruby
netherwolfe_ has joined #ruby
netherwolfe has quit [Ping timeout: 265 seconds]
eckhardt has joined #ruby
Ltem has joined #ruby
marmorkreb has joined #ruby
workmad3 has joined #ruby
agent_white has joined #ruby
Dimik has quit []
marmorkreb has quit [Ping timeout: 260 seconds]
Mike111 has joined #ruby
Mike111 has quit [Max SendQ exceeded]
workmad3 has quit [Ping timeout: 248 seconds]
<mikkel-> What would you do: `(array1.count + array2.count) > 10` or `(array1 + array2).count > 10`
<mikkel-> And would there be a performance difference?
Mike11 has quit [Ping timeout: 248 seconds]
Mike11 has joined #ruby
Mike11 has quit [Max SendQ exceeded]
cdg has joined #ruby
Mike11 has joined #ruby
Mike11 has quit [Max SendQ exceeded]
<apeiros> first one. also use .size, not .count
tcopeland has quit [Quit: tcopeland]
jamesaxl has joined #ruby
<mgraf> The second one is adding all of the items together to create a (potentially) massive array, and then counting the items
Mike11 has joined #ruby
<mgraf> PEMDAS
Mike11 has quit [Max SendQ exceeded]
<apeiros> is that a pajamas brand?
<mgraf> It's something that you may have learned while wearing pajamas :)
<apeiros> (despite its name, count without arg or block doesn't actually count the items)
cagomez has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conceivably has left #ruby ["ERC (IRC client for Emacs 25.3.1)"]
pastorinni has joined #ruby
pastorinni has quit [Remote host closed the connection]
pastorinni has joined #ruby
jamesaxl has joined #ruby
ledestin has joined #ruby
Matt2843 has joined #ruby
TinkerTyper has joined #ruby
netherwolfe__ has joined #ruby
netherwolfe_ has quit [Ping timeout: 240 seconds]
<Matt2843> Hey Ruby rookie here o/ trying to print cli args if they belong to my array A.. so I defined A = [ 'a', 'b', 'c' ] and attempt: for i in ARGV puts i if i.in?A
<apeiros> ARGV.each do |item| puts item if A.include?(item) end # raw translation of yours
<apeiros> puts(ARGV & A) # the short version
jamiejackson has joined #ruby
schneide_ has quit [Remote host closed the connection]
amatas has quit [Quit: amatas]
<Matt2843> Okay thanks, what is the difference of ARGV.each do and for i in ARGV ? arent they both for-each like structures?
<apeiros> for/in is a syntax construct and mostly for reasons of convention barely anybody uses it (internally uses .each anyway)
matcouto has joined #ruby
claudiuinberlin has joined #ruby
<Matt2843> Ah okay thanks for clarifying =)
kapil___ has quit [Quit: Connection closed for inactivity]
<apeiros> i.in?(A) does not exist because it's not really reasonable for all objects to know how to check against all collection types whether they're part of it. i.e. any sane implementation would end up doing A.include?(i) internally anyway.
cjs226 has joined #ruby
<Matt2843> I see, another issue I have, if I define a field in a file, say my array A, how do I access that field from inside a method? seems like im getting a runtime error when trying to access it currently
<Matt2843> A = [] def something puts A end
cagomez has quit [Remote host closed the connection]
<apeiros> that's a matter of how you make it available. `A` is a constant and globally visible. it should not be a problem to access `A` from everywhere (and through that, the object it references)
<Matt2843> currently I have: A = [ 'a', 'b', 'c' ] and def method() puts(ARGV & A) end method(), and I get undefined local variable or method "A"
<apeiros> `end method()`?
<Matt2843> method() is on the next line to invoke the method
<apeiros> ah. use ; to indicate newlines.
<Matt2843> oh yes
<apeiros> ruby treats them the same, so it even works.
<Matt2843> oh is it normal to end lines in ruby with ;?
<Matt2843> or statements rather
<apeiros> hell no
<apeiros> but it's useful for single-line mediums like irc
<Matt2843> okay I get you yeah
<apeiros> also in some rare cases to keep code more compact & readable
<Matt2843> A = [ 'a', 'b', 'c' ]; def method() puts (ARGV & A) end; method()
<apeiros> you should paste the real code
<apeiros> because if you get "undefined local variable or method", then your variable is *definitively* not named "A"
<Matt2843> making paste brb
morenoh149 has joined #ruby
vyorkin has quit [Ping timeout: 240 seconds]
tcopeland has joined #ruby
cagomez has joined #ruby
despai has quit [Quit: ...]
<Matt2843> apeiros: http://ix.io/K8n (ignore the rest of the lines also just for testing)
<apeiros> familiar_tags is a local variable. it does not share the scope of local variables within your method.
<apeiros> FamiliarTags would be a constant. the first letter being uppercase making the difference.
<Matt2843> wait
<Matt2843> snake case makes a variable local?
<apeiros> first letter decides
<apeiros> iAmALocalToo
<Matt2843> upper case = global, lower = local?
<apeiros> but nobody (hopefully) uses camelCase for variables in ruby
<apeiros> constant, not global
<Matt2843> oh
<apeiros> $globals
<apeiros> $globals, @instance_variables, @@class_variables, Constants, locals
<apeiros> those are the variable types ruby provides
<Matt2843> ah okay
<guacamole> is CONSTANTS a rails thing? as opposed to ruby?
<Matt2843> really gotta get used to that =)
<apeiros> and never define your own globals, never use @@class_variables.
synthroid has quit []
<apeiros> (obviously not never, but… yeah, no, never :D)
desperek has quit [Quit: xoxo]
morenoh149 has quit [Ping timeout: 260 seconds]
<Matt2843> used to a convention of camelcase variables and functions and all capital constants
<apeiros> guacamole: it's a style thing. I vastly prefer PascalCase over SCREAMING_HELLFIRE
<guacamole> lol cool, i've only used SCREAMING_HELLFIRE
<guacamole> good to know there are options
<apeiros> I don't like my code screaming at me
<apeiros> maybe I'm weird that way?
<guacamole> do you feel like its stabbing your eyes?
<apeiros> it can't. I'm faster at deleting it!
TinkerTyper has quit [Quit: ZNC 1.7.x-nightly-20180120-fcc710b4 - https://znc.in]
TinkerTyper has joined #ruby
marxarelli is now known as marxarelli|afk
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<guacamole> the war on HELLFIRE is being won
<Matt2843> apeiros: can you explain a bit about the ARGV & A ?
mgraf has quit [Ping timeout: 255 seconds]
<Matt2843> puts(ARGV & [])*
<apeiros> Array#& returns the intersection of the two arrays
<apeiros> &ri Array#&
tomphp has joined #ruby
<Matt2843> Ah that is awesome thanks
<apeiros> it will drop duplicates, though. so strictly speaking not equivalent to your original code.
<apeiros> >> [1,1,1,2] & [1,3]
<ruby[bot]> apeiros: # => [1] (https://eval.in/956464)
s2013 has joined #ruby
<Matt2843> I see, but that is kind of what I want here as all my "familiar tags" will be distinct
<apeiros> your input might not be distinct
tomphp has quit [Client Quit]
<Matt2843> no but I will prepend a "-" to all the tags, for the CLI
ahrs has quit [Ping timeout: 248 seconds]
tomphp has joined #ruby
drewmcmillan has joined #ruby
<Matt2843> trying to create a CLI for printing some data from a json response of a rest API
jcalla has quit [Quit: Leaving]
<Matt2843> so depending on the ARGV provided to the program the uri will change
<Matt2843> there should actually be a standard way of doing exactly that any good papers? (i.e. handling cli tags in ruby and reacting accordingly)
AndBobsYourUncle has quit [Ping timeout: 256 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<Matt2843> and by tags II mean when I run a ruby program "ruby program.rb" react on the "-tags" provided to the program so "ruby program.rb -a -b -c"
jnollette has quit [Ping timeout: 255 seconds]
<apeiros> there's optparse in the stdlib, and the slop gem which is quite often used and arguably more convenient.
<Matt2843> thanks will check these =)
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sameerynho has quit [Ping timeout: 260 seconds]
tomphp has joined #ruby
<Matt2843> wow slop seems nice
<apeiros> btw., in case it didn't click: class names are constants.
<apeiros> (well usually at least - nothing stops you from assigning a class to any other kind of variable)
clemens3 has quit [Ping timeout: 240 seconds]
jnollette has joined #ruby
cdg_ has joined #ruby
alex`` has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 240 seconds]
plexigras has quit [Ping timeout: 276 seconds]
plexigras has joined #ruby
rocx has joined #ruby
vutral|kali has quit [Ping timeout: 256 seconds]
Azure has joined #ruby
<cagomez> what is this doing? `foo = Struct.new(:user) do; def do_this(&block); yield(user); end; end;`
<Matt2843> apeiros: I used Slop and it works like a charm, however when I pass a param as a string I currently have to surround the param with "" or '' any way around this say if I want to call ruby program.rb -o Hello World -b Goodbye World instead of program.rb -o "Hello World" -b "Goodbye World"
<cagomez> Is it defining a method on the struct called `do_this` that accepts a block, then passes the `user` to the block?
<apeiros> cagomez: correct
<apeiros> cagomez: and it should drop the (&block) part
<apeiros> (it doesn't change how the method works, but it makes it slower by forcing ruby to turn the passed block into a Proc instance - without actually using it)
<cagomez> why apeiros? is this incorrect if I pass in blocks like so: `foo.do_this(user).do_this(user)`
<cagomez> when doing the above, I get `ArgumentError: wrong number of arguments (given 1, expected 0)`
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<apeiros> Matt2843: that'd be non-standard. it might still be possible to do it with slop, I don't know. but it'd work differently than about every other cli app.
<apeiros> cagomez: foo is the struct class. at least in the code you showed. so first thing you'd have to do is call new. foo_instance = foo.new
<Matt2843> apeiros: okay i'll stick to the standard then thanks
<apeiros> and then on foo_instance you can invoke do_this. but do_this(value) does *not* pass a block to do_this, it passes a normal argument.
<cagomez> ah right, I didn't include the `new`. But I do get that error. How do I pass a block?
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<apeiros> by using block syntax. either `do_thing do … end` or `do_thing { … }`
<apeiros> where … is your code
<cagomez> ah, how about this: `Foo.new(user).do_this(say_hi).do_this(say_bye)`
<cagomez> where say_hi, say_bye are methods?
<apeiros> again, you are not passing any block.
<apeiros> {} or do/end. those are blocks.
<apeiros> and since the do_this you've shown does not return self, you can't chain another do_this on the result either.
eckhardt has joined #ruby
<baweaver> my my, so busy today
<baweaver> Also I did bad things to Ruby again: https://gist.github.com/baweaver/611389c41c9005d025fb8e55448bf5f5
<apeiros> again? :D
machinewar has joined #ruby
<machinewar> is there any way to hoook into something so I know anytime *any* message is sent to an object
jerikl has joined #ruby
<cagomez> apeiros, where can I learn more about this syntax? Not sure what to google
<apeiros> machinewar: for debugging: yes. for production: better use a proxy object.
<apeiros> cagomez: any ruby book I'd say
<apeiros> ?books
<ruby[bot]> You can find a list of recommended books at http://ruby-community.com/pages/links
<apeiros> huh? baweaver, didn't you relink that to your site?
<baweaver> Nope
<baweaver> Just in the topic
<machinewar> apeiros: then on the proxy would you use something like method_missing?
<apeiros> not something like. you'd use exactly method_missing ;-)
<machinewar> apeiros: lol kk thank you
marxarelli|afk is now known as marxarelli
<apeiros> BasicObject is your friend for building proxies. just remember that you can't use anything directly in there. e.g. even puts will be ::Kernel.puts in there (or $stdout.puts)
<apeiros> or I guess what I needed more often: raise is ::Kernel.raise, p is ::Kernel.p (not even just `Kernel`, constant lookup won't work like that either)
Ltem has quit [Quit: good night]
AJA4350 has quit [Ping timeout: 260 seconds]
jcarl43 has joined #ruby
<machinewar> very interesting
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Matt2843> anyone used Slop before? i've created my opts = Slop.parse do |o|, but where do I rescue the errors?
alfiemax_ has quit [Remote host closed the connection]
alfiemax has joined #ruby
morenoh149 has joined #ruby
<Matt2843> nevermind figured it
machinewar has quit []
Puffball has joined #ruby
alfiemax_ has joined #ruby
alfiemax has quit [Ping timeout: 252 seconds]
jamiejackson has quit [Ping timeout: 256 seconds]
alfiemax_ has quit [Ping timeout: 248 seconds]
devil_tux has quit [Ping timeout: 265 seconds]
matcouto has quit [Remote host closed the connection]
cjs226 has quit [Quit: Textual IRC Client: www.textualapp.com]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
matcouto has joined #ruby
AJA4350 has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
weaksauce has quit [Read error: Connection reset by peer]
devil_tux has joined #ruby
mgraf has joined #ruby
sanscoeu_ has joined #ruby
matcouto has quit [Ping timeout: 248 seconds]
sanscoeur has quit [Ping timeout: 248 seconds]
weaksauce has joined #ruby
mostlybadfly has joined #ruby
DLSteve_ has quit [Quit: All rise, the honorable DLSteve has left the channel.]
matcouto has joined #ruby
nwm has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
chouhoul_ has joined #ruby
morenoh149 has quit [Ping timeout: 256 seconds]
mtkd has quit []
<Matt2843> apeiros: http://ix.io/KaZ when I define my opts like so using Slop I can no longer access the params via the last line in the paste, any idea why? (this raises an error)
chouhoulis has quit [Ping timeout: 256 seconds]
chouhoul_ has quit [Ping timeout: 256 seconds]
matcouto has quit [Ping timeout: 268 seconds]
marmorkreb has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
workmad3 has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has quit [Remote host closed the connection]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
netherwolfe__ has quit [Ping timeout: 276 seconds]
marmorkreb has quit [Ping timeout: 248 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
goatish has joined #ruby
tcopeland has quit [Quit: tcopeland]
johnjoseph___ has quit [Quit: Connection closed for inactivity]
blackmesa has joined #ruby
cdg_ has quit [Ping timeout: 240 seconds]
nowhereman_ has joined #ruby
nowhere_man has quit [Ping timeout: 248 seconds]
cthulchu_ has joined #ruby
devil_tux has quit [Quit: leaving]
<Matt2843> im really stuck with this slop issue
cthulchu has quit [Ping timeout: 240 seconds]
roonsauce has quit [Remote host closed the connection]
RougeR has quit [Read error: No route to host]
GodFather has joined #ruby
Azure has quit [Quit: Oops.]
cdg has joined #ruby
morenoh149 has joined #ruby
<cagomez> `foo = Struct.new(:user) do; def do_this(&block); yield(user); end; end`. How do I set the value of the struct's `user` attribute inside of `do_this`?
alfiemax has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
jnollette has quit [Remote host closed the connection]
jnollette has joined #ruby
minimalism has joined #ruby
bigblind has joined #ruby
morenoh149 has quit [Ping timeout: 256 seconds]
cdg has quit [Ping timeout: 276 seconds]
brendan- has quit [Quit: Textual IRC Client: www.textualapp.com]
alfiemax has quit [Ping timeout: 256 seconds]
<Matt2843> do I need to declare prototypes in ruby?
tvw has quit [Remote host closed the connection]
<havenwood> cagomez: You'll see &block *or* yield, but usually not both used together.
<havenwood> cagomez: `def do_this; yield(user) end` or `def do_this &bock; block.call(user) end`
<havenwood> Matt2843: there aren't prototypes, per se
<cagomez> what if my block returns another block? How do I call that?
alfiemax has joined #ruby
dviola has quit [Quit: WeeChat 2.0.1]
<Matt2843> havenwood: hmm so the order of my methods matter? I cannot call a method that I define later?
<havenwood> cagomez: Say more?
RougeR has joined #ruby
<havenwood> Matt2843: Non-duplicate method order doesn't matter within a class or module.
<havenwood> Matt2843: I'd suggest trying out the code you're wondering about in IRB or Pry.
<havenwood> ?irb
<ruby[bot]> irb is "interactive ruby", it is part of ruby. You can run ruby code and see results immediately. it's useful for testing code. Also see ?pry, a gem which is a popular alternative to irb.
<havenwood> ?pry
<ruby[bot]> Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<cagomez> for example, `def do_this; Proc.new { |x| x }; end;` and `foo = Struct.new(:user) do; def do_that(&block); # call do_this with User here #; end; end` . if
shinnya has quit [Ping timeout: 240 seconds]
<cagomez> I'd like to do `foo.do_that { do_ this }`
<havenwood> cagomez: foo.do_that &do_this
jamesaxl has quit [Quit: WeeChat 2.0.1]
govg has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 248 seconds]
matcouto has joined #ruby
jerryskye has quit [Quit: Ping timeout (120 seconds)]
marahin has quit [Ping timeout: 276 seconds]
aguestuser has quit [Ping timeout: 255 seconds]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jerryskye has joined #ruby
marahin has joined #ruby
n008f4g_ has joined #ruby
marahin is now known as Guest99434
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
cagomez has quit []