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
aguestuser has joined #ruby
aguestuser has quit [Remote host closed the connection]
aguestuser has joined #ruby
xfbs has quit []
PaulCapestany has quit [Ping timeout: 248 seconds]
jobewan has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 260 seconds]
<mgraf> \leave
mgraf has left #ruby [#ruby]
McSoFake has quit [Quit: McSoFake]
ramfjord has joined #ruby
PaulCapestany has joined #ruby
jnollette has quit [Remote host closed the connection]
jnollette has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
tcopeland has joined #ruby
ResidentBiscuit has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
ramfjord has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.0.1]
goatish has quit [Ping timeout: 265 seconds]
marxarelli is now known as marxarelli|afk
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
matcouto has quit [Remote host closed the connection]
cdg has quit [Ping timeout: 248 seconds]
matcouto has joined #ruby
sanscoeu_ has quit [Remote host closed the connection]
sanscoeur has joined #ruby
arescorpio has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
AJA4350 has quit [Ping timeout: 252 seconds]
ramfjord has joined #ruby
matcouto has quit [Ping timeout: 264 seconds]
<pragmatism> Bruh, this is IRC no Slack
<pragmatism> /part
sanscoeur has quit [Ping timeout: 264 seconds]
alfiemax has joined #ruby
AJA4350 has joined #ruby
gr33n7007h has joined #ruby
gr33n7007h is now known as al2o3-cr
ramfjord has quit [Ping timeout: 248 seconds]
drewmcmillan has joined #ruby
morenoh149 has joined #ruby
<andydna> is there any good way already to test shelling out?
AJA4350 has quit [Remote host closed the connection]
AJA4350 has joined #ruby
alfiemax has quit [Ping timeout: 276 seconds]
suhdood has joined #ruby
AJA4350 has quit [Remote host closed the connection]
morenoh149 has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
AJA4350 has joined #ruby
alfiemax has joined #ruby
<cagomez> I have an array of hashes and I need to perform the same mutations on each hash. what's the idiomatic ruby way for doing this?
alfiemax has quit [Ping timeout: 276 seconds]
<guacamole> cagomez #map?
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ResidentBiscuit is now known as jready
matcouto has joined #ruby
ramfjord has joined #ruby
roonsauce has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.0.1]
roonsauce has quit [Ping timeout: 255 seconds]
<matcouto> Convert decimal to integer. Sounds like a silly question, but how do I get the result of this calculation as an integer(8325)? https://gist.github.com/matcouto/d01d29ddba74bf1ab6480385bb3506d2
jaequery has joined #ruby
<matcouto> without gsub and converting to int
<Matt2843> trying to append a list to another list, when printing the resulting list, I just get an entry followed by a new line, followed by an entry followed by a new line etc. no square brackets
<guacamole> matcouto where is 0.15 coming from? can you use 1.5 and then just to_i?
<Matt2843> iterating a json object, list = []; object.each do |x| list << [ x['something'] ] end; puts list
pastorinni has quit [Remote host closed the connection]
<matcouto> guacamole: 0.15 is actually the percentage amount. What I'm doing there is calculating the percentage of the amount in cents(5550)
<matcouto> guacamole: and the return must be in cents too
alfiemax has joined #ruby
<guacamole> so can you convert the percentage value to something that will give you an integer, or easily convert to an integer instead of focusing on converting the result of the equation?
<Matt2843> oh.. im doing puts instead of print.. gah
Vapez has quit [Read error: Connection reset by peer]
jeffreylevesque has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
<matcouto> guacamole: Yeah should be fine. I've just updated the gist https://gist.github.com/matcouto/d01d29ddba74bf1ab6480385bb3506d2
<guacamole> what if you used 1.5 and then to_i on the result? that'll drop the zero because the result will be 8325.0
<guacamole> not sure if thats sturdy enough for all of your use cases though
jeffreylevesque has quit [Ping timeout: 268 seconds]
workmad3 has joined #ruby
<Matt2843> how do I output unicode chars in ruby?
<matcouto> guacamole: right. Will play a bit with it. Thanks :)
<guacamole> matcouto np!
alfiemax has joined #ruby
cagomez has quit [Remote host closed the connection]
jeffreylevesque has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
<matcouto> guacamole: yeah just found a use case where it would fail. if you replace 1.5 to 2.5. That would give you 13875 which if you convert that to dollars we'll get 138.75 instead of 13.875
<guacamole> yeah i didn't know if the 1.5 was a hardcoded thing or variable
<Matt2843> anyone knows a good CLI table output library? to output some fancy tables
<matcouto> guacamole: I can't believe that I'm struggling to make a percentage calc hahah
morenoh149 has joined #ruby
cdg has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
morenoh149 has quit [Ping timeout: 240 seconds]
cdg has quit [Ping timeout: 255 seconds]
kapil___ has joined #ruby
dviola has joined #ruby
axsuul has quit [Quit: Peace]
rubycoder37 has joined #ruby
<rubycoder37> I need to find a way to change my nick, I'm 38 now
<rubycoder37> hi
<rubycoder37> 38 and still learning ruby to this day, what a great language it is!
d10n-work has quit [Quit: Connection closed for inactivity]
<rubycoder37> I have a question, when raising an exception, is there a default exception that is raised or that I have to specify? for example, I want to stop my program if the amount is zero or negative
<rubycoder37> some code here:
<rubycoder37> I'm curious if some of you have a better idea of how I can write this code
<nwm> check in irb
<rubycoder37> check what exactly?
rubycoder37 is now known as rubycoder38
<havenwood> rubycoder38: Consider: raise 'Amount insufficient' if from_amount.negative?
<havenwood> rubycoder38: then no else/end - just carry on with wallets
<nwm> I sort of think error handling in ruby is somewhat broken
<havenwood> rubycoder38: shouldn't those changes be in a transaction?
<nwm> exceptions are nasty
<havenwood> rubycoder38: if the amount isn't deducted from the first account, it shouldn't make it into the second
<havenwood> nwm: Have another lang in mind that does exceptions better?
<havenwood> nwm: What about them don't you like?
<nwm> sort of an inflammatory topic but everything
<rubycoder38> havenwood: you're right
schneide_ has joined #ruby
<rubycoder38> havenwood: do you have an idea of how I can achieve that? I'm a bit of a noob with sequel also
<rubycoder38> let me share my entire file
agent_white has quit [Quit: brb]
<havenwood> rubycoder38: DB.transaction do
Asher has quit [Quit: Leaving.]
<rubycoder38> oh!
<rubycoder38> havenwood: thank you so much!
<havenwood> rubycoder38: you're welcome
jnyw has joined #ruby
<rubycoder38> :-)
agent_white has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
b100s has joined #ruby
schneide_ has quit [Ping timeout: 256 seconds]
jnollette has quit [Ping timeout: 255 seconds]
<b100s> hi2all; is it possible to send headers in sinatra before send body? I mean I would like to send 100 header and start do something (some busines logic), finally i will send a body, but it will happen not imediately
Matt2843 has quit [Quit: Page closed]
morenoh149 has joined #ruby
Asher has joined #ruby
alfiemax has joined #ruby
matcouto has quit [Remote host closed the connection]
matcouto has joined #ruby
<rubycoder38> does the program stops executing if the raise occurs?
<havenwood> rubycoder38: check those transaction docs, but by default it rolls back the transaction and proceeds outside the transaction block
jnollette has joined #ruby
spiette_ has quit [Quit: :qa!]
<havenwood> b100s: I'd think you could use an enumerator with a delay as the third, body element of the response tuple.
<rubycoder38> ok, thanks
alfiemax has quit [Ping timeout: 248 seconds]
marr has quit [Ping timeout: 240 seconds]
matcouto has quit [Ping timeout: 260 seconds]
<b100s> havenwood, could you provide an example?
<havenwood> b100s: you can't provide a content type with 100 though
<havenwood> b100s: i could but have to run out the door - one sec i'll try
<havenwood> b100s: gotta run but i'll be back later!
<b100s> havenwood, thank you
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jready has quit []
bmurt has joined #ruby
matcouto has joined #ruby
tjbp has quit [Ping timeout: 260 seconds]
marmorkreb has joined #ruby
chouhoulis has joined #ruby
matcouto has quit [Client Quit]
alfiemax has joined #ruby
apparition has quit [Quit: Bye]
sameerynho has joined #ruby
tjbp has joined #ruby
alfiemax has quit [Ping timeout: 265 seconds]
mrush has joined #ruby
<mrush> can anyone recommend a superior, classic text on category theory
gizmore has joined #ruby
AJA4350 has quit [Quit: AJA4350]
aguestuser has quit [Ping timeout: 255 seconds]
roonsauce has joined #ruby
gizmore|2 has quit [Ping timeout: 265 seconds]
aguestuser has joined #ruby
hackeron has quit [Quit: Lost terminal]
tefa has joined #ruby
roonsauce has quit [Ping timeout: 240 seconds]
<rubycoder38> sometimes my from_amount will be nil so it won't respond to .negative? is it ok to use &. in such case like I'm doing? https://gist.github.com/anonymous/b2c0dee44282ad91b5e72bc7b12c2841#file-wallet_central-rb-L6
Azure has joined #ruby
sameerynho has quit [Ping timeout: 265 seconds]
<tefa> goodnight, question.. i got a this type of hash : announcements = [{city: 'Tandil', company: 'Plasmar', platform: 12 },{city: 'Buenos Aires', company: 'El lento', platform: 13 },{city: 'Azcochinga', company: 'Artazar', platform: 18 },{city: 'Tandil', company: 'Johnny Tur', platform: 12 }] how do i get the last value ? i want to get from the last one only the value of platform...
bigblind has quit [Remote host closed the connection]
<leitz> tefa, announcements is an array. Do you know how to get the last item from an array?
bmurt has quit [Quit: Textual IRC Client: www.textualapp.com]
alfiemax has joined #ruby
<tefa> i usually do announcements[:4] for example..
<tefa> but wont work :S
<leitz> would announcements[-1] work?
kliq has quit [Ping timeout: 256 seconds]
pastorinni has joined #ruby
<tefa> it didt
<tefa> thanks
<leitz> NP.
andydna11 has joined #ruby
<tefa> may i do another question ?
alfiemax has quit [Ping timeout: 264 seconds]
<leitz> tefa, you just did. :)
bigblind has joined #ruby
<tefa> plus the last one xd
<leitz> And the real answer is that as long as you ask good questions and try to figure things out you will find a lot of smart folks here to help you.
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has quit [Remote host closed the connection]
bmurt has joined #ruby
darkhanb has joined #ruby
<tefa> from annoucemts arrays.. its a list of bus... from wich city.. the company and the platforms.. lets suppose the departure of the bus are from x -> x2 -> x3 ... i mean.. in the list.. the first one.. is the first to departure.. the 2nd the 2nd.. and continues.. now.. knowing that.. i need to know only the last one of departure... but i dont know the real array.. it could be random... i only know
<tefa> that i need to know the last bus from tandil.. and output his platform... the array changes.. it could be any form.. so in the last example.. the last but to tandil its from company johnny tur platform 12... so to output that i do...
<leitz> tefa, is this a class assignment?
<tefa> annoucements[-1][:platform] and i get the value platform of the last of the list... but i dont know if its tandil...
dreaduo has joined #ruby
<tefa> how to know if its tandil ? scan... and determinate if its tandil... i would scan the array for tandil.. create a new array and from that one get the last one...
<tefa> i guess i would use something like... annoucements.each { |x| seek tandil..} now that i got tandil.. use the last code.. but i dont know how to config my ".each" or whatever i should use
bigblind has joined #ruby
<leitz> Look at array.index. tandil_index = announcements.index('tandil')
nwm has quit [Ping timeout: 276 seconds]
<al2o3-cr> tefa: announcements.find { |h| h.key('Tandil') }[:platform]
<tefa> i can use find.. but i cannot use .key ...
<tefa> i can only use map, find, select, any?, all?, each, and im not sure about index...
bigblind has quit [Remote host closed the connection]
* leitz sees that it is way past nappy time.
leitz has quit [Quit: Nappy time]
<al2o3-cr> tefa: then use the key :city to compare
Vivekananda has joined #ruby
<al2o3-cr> tefa: announcements.find { |h| h[:city] == 'Tandil' }
Vivekananda has quit [Max SendQ exceeded]
John_Ivan has quit [Read error: Connection reset by peer]
Vivekananda has joined #ruby
yokel has quit [Ping timeout: 248 seconds]
arescorpio has quit [Quit: Leaving.]
bigblind has joined #ruby
jeffreylevesque has quit [Ping timeout: 248 seconds]
andydna11 has quit [Quit: Lost terminal]
andydna has quit [Quit: Lost terminal]
kies has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
<al2o3-cr> andydna11: you're not closing stdin.
<rubycoder38> is it acceptable to use || this way? raise 'Amount insufficient' if from_amount&.negative? || amount > from_amount
<rubycoder38> or should I use or?
<al2o3-cr> rubycoder38: use ||
<rubycoder38> any reasons for that? just curious
ramfjord has quit [Ping timeout: 260 seconds]
<al2o3-cr> precedence, that's all.
<rubycoder38> not sure what you mean
<rubycoder38> sorry
workmad3 has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
<rubycoder38> thanks, reading
<rubycoder38> I see, nice
<al2o3-cr> i'll give you an example
<rubycoder38> ok
<al2o3-cr> np :)
tefa has quit []
workmad3 has quit [Ping timeout: 256 seconds]
pastorinni has quit [Remote host closed the connection]
alfiemax has joined #ruby
blackmesa has quit [Quit: WeeChat 2.0.1]
jerikl has joined #ruby
govg has joined #ruby
alfiemax has quit [Ping timeout: 268 seconds]
RougeR has quit [Ping timeout: 248 seconds]
pastorinni has joined #ruby
halt has joined #ruby
jaequery has joined #ruby
halt is now known as Guest48858
Dimik has joined #ruby
nowhereman_ has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
alfiemax has joined #ruby
<rubycoder38> amount > from_amount <-- just noticed my from_amount can be nil sometimes, I guess adding a unless from_amount.nil? will do
suhdood has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 256 seconds]
<rubycoder38> laters
<rubycoder38> happy hacking
rubycoder38 has quit [Quit: Lost terminal]
alfiemax has joined #ruby
aguestuser has quit [Remote host closed the connection]
aguestuser has joined #ruby
ghoti has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jeffreylevesque has joined #ruby
Vivekananda has quit [Quit: Leaving]
kent\n has quit [Ping timeout: 276 seconds]
kent\n has joined #ruby
alfiemax has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
kent\n has quit [Ping timeout: 276 seconds]
kies has joined #ruby
kent\n has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
alfiemax has quit [Ping timeout: 256 seconds]
Vivekananda has joined #ruby
Puffball has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 276 seconds]
gix has joined #ruby
jnollette has quit [Ping timeout: 255 seconds]
kapil___ has quit [Quit: Connection closed for inactivity]
gix- has quit [Ping timeout: 260 seconds]
jnollette has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nwm has joined #ruby
cagomez has joined #ruby
alfiemax has joined #ruby
roonsauce has joined #ruby
GodFather has quit [Ping timeout: 256 seconds]
dreaduo has quit [Ping timeout: 260 seconds]
xhoy has quit [Ping timeout: 240 seconds]
Vivekananda has quit [Quit: Leaving]
alfiemax has quit [Ping timeout: 248 seconds]
roonsauce has quit [Ping timeout: 264 seconds]
cdg has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
dviola has quit [Quit: WeeChat 2.0.1]
trautwein has quit [Quit: ZNC 1.6.5 - http://znc.in]
trautwein has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
haylon has quit [Quit: Leaving]
slyphon has quit [Quit: WeeChat 2.0.1]
alfiemax has joined #ruby
gary___ has joined #ruby
orbyt_ has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
pastorinni has quit [Remote host closed the connection]
bigblind has quit [Remote host closed the connection]
bigblind has joined #ruby
ogres has joined #ruby
jeffreylevesque has quit [Ping timeout: 256 seconds]
alfiemax has joined #ruby
vutral|kali has quit [Ping timeout: 255 seconds]
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
vutral|kali has joined #ruby
edwardly has quit [Ping timeout: 248 seconds]
alfiemax has quit [Ping timeout: 240 seconds]
nowhereman_ has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has quit [Ping timeout: 240 seconds]
bigblind has quit [Ping timeout: 255 seconds]
alfiemax has joined #ruby
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
alfiemax has quit [Ping timeout: 256 seconds]
luna_x has joined #ruby
learning-ruby has joined #ruby
<learning-ruby> Is there a method in Ruby that I can use to figure out whether a certain class comes from the ruby core or from a library?
jnollette has quit [Ping timeout: 255 seconds]
gary___ has quit [Quit: leaving]
jnollette has joined #ruby
workmad3 has joined #ruby
jaequery has joined #ruby
jordanm has quit [Remote host closed the connection]
suhdood has joined #ruby
workmad3 has quit [Ping timeout: 268 seconds]
cagomez has quit [Remote host closed the connection]
anisha has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneide_ has joined #ruby
alfiemax has joined #ruby
Guest36431 has joined #ruby
aguestuser has quit [Remote host closed the connection]
aguestuser has joined #ruby
_aeris_ has quit [Ping timeout: 255 seconds]
Guest36431 is now known as hairui
_aeris_ has joined #ruby
morenoh149 has quit [Ping timeout: 264 seconds]
alfiemax has quit [Ping timeout: 276 seconds]
schneide_ has quit [Ping timeout: 276 seconds]
learning-ruby has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
sundhell_away is now known as sundhell
xcrot has joined #ruby
BTRE has quit [Quit: Leaving]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BTRE has joined #ruby
Matthew1 has joined #ruby
nwm_ has joined #ruby
marmorkreb has quit [Remote host closed the connection]
xcrot has left #ruby [#ruby]
nwm has quit [Ping timeout: 240 seconds]
tefa has joined #ruby
vondruch_ has quit [Quit: vondruch_]
vondruch has joined #ruby
<tefa> can someone exaplain me whats happening here ? https://gist.github.com/tefanga/a74fd484e0c123d19e80b0f3b2b03e6a
<tefa> im new to ruby, so please soft words... or a soft guide ?
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aguestuser has quit [Remote host closed the connection]
jaequery has joined #ruby
aguestuser has joined #ruby
jaequery has quit [Client Quit]
alfiemax has joined #ruby
<havenwood> tefa: In Ruby there didn't used to be a #sum method already defined. So it was a popular exercise to define one. Now there is one.
<havenwood> tefa: So the code you're showing actually stomps on the new Array#sum method.
<havenwood> [].method(:sum).owner #=> Array
<havenwood> tefa: That said, this would redefine Array#sum.
<tefa> i think i got that part..its just definig sum on array... but i dont understand how that it works that block
<tefa> inject(0) { |accum, it| accum + it }
<havenwood> gotcha
<havenwood> tefa: #inject is an alias for #reduce
<havenwood> tefa: the 0 is is the initial value
<havenwood> that's where things start
<havenwood> 0
nwm_ has quit [Ping timeout: 256 seconds]
<havenwood> inside the pipes || are the block arguments
<havenwood> `accum` starts as the initial value, 0
jaequery has joined #ruby
<havenwood> each iteration, accum will become the new return value of the block
morenoh149 has joined #ruby
alfiemax has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> the second block argument, `it`, will be the current array iteration item
nwm has joined #ruby
alfiemax has joined #ruby
<havenwood> tefa: so starting with 0 as the accumulator value, this method will iterate over the array, and add each element of the array to the accumulator
nwm_ has joined #ruby
cdg has joined #ruby
dinfuehr has quit [Ping timeout: 248 seconds]
<havenwood> tefa: basically, it sums the array values, starting with 0 and adding each one as it goes through the array
<havenwood> tefa: does that make any sense? i know it's a bit abstract.
<havenwood> it's hard to explain without using loaded terms
morenoh149 has quit [Ping timeout: 268 seconds]
ledestin has joined #ruby
dinfuehr has joined #ruby
tcopeland_ has joined #ruby
tcopeland has quit [Ping timeout: 265 seconds]
tcopeland_ is now known as tcopeland
nwm has quit [Ping timeout: 260 seconds]
<tefa> i got half of it... this is what i understand.. if i do array.select { |x| x > 10 } it will look up inside the array for values over 10... the x its every value evaluated.... so when i see |accum, it| i dont understand...exactly.. if its looking up for 1 item and use it in accum.. and other using it.. for example... array = [10, 34, 8, 6, 22] if i do arrray.map { |x| x > 10} i will get 34
<tefa> 22... so it look up inside for each one and analize using x... if its bigger than 10.. so if i use the same.. .map.. and insted x, i use |accum, it| (i know it wont work...) but ccan you tell me what will try to do there ?
nwm_ has quit [Ping timeout: 260 seconds]
suhdood has quit [Remote host closed the connection]
<havenwood> tefa: map and reduce are different
<tefa> (with you explanation i understand what it does, but i dont understand how it does it)
cdg has quit [Ping timeout: 265 seconds]
<havenwood> tefa: you're spot on with select
<tefa> reduce aparently can look up for 2 values...
luna_x[m] has joined #ruby
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramfjord has joined #ruby
konsolebox has quit [Ping timeout: 268 seconds]
konsolebox has joined #ruby
<havenwood> tefa: So the first block argument is an accumulator. It's the thing that reduce will return.
jordanm has joined #ruby
<havenwood> tefa: map returns 1-to-1 values for each item in the collection
<havenwood> tefa: map may map to anything, but it'll be the same number of items
<havenwood> tefa: select will be at max the same number of items, but may be fewer
<havenwood> tefa: select will never change the items, it just may remove some from the collection
<havenwood> tefa: reduce on the other hand will not return a collection necessarily, it often just return a single item
<havenwood> tefa: the accumulator is the thing that will be returned
naprimer2 has quit [Ping timeout: 276 seconds]
<havenwood> that's the first block argument for reduce
naprimer has joined #ruby
<havenwood> the second is the value for each iteration, like the single block argument for select or map
jaequery has quit [Read error: Connection timed out]
<havenwood> the new accumulator value is set to the return value for each iteration
<havenwood> and returned at the end of the iterations
<havenwood> tefa: Does any of that make sense?
ramfjord has quit [Ping timeout: 264 seconds]
<havenwood> It's often easier to understand with examples
<tefa> i understood the it value... working like map and static..
<tefa> i got half of accum... exaplanation
<tefa> and dont get it whats exactly the value inside the () for reduce
<tefa> example here.. [1,2,3].reduce(0)
<tefa> (not static *select)
troys has quit [Quit: Bye]
<havenwood> >> [1,2,3].reduce(0, :+)
<ruby[bot]> havenwood: # => 6 (https://eval.in/956567)
<havenwood> tefa: ^ starting at zero, add one, then two, then three - resulting in six
<havenwood> >> [1,2,3].reduce(42, :+)
<ruby[bot]> havenwood: # => 48 (https://eval.in/956568)
alfiemax has quit [Ping timeout: 265 seconds]
<havenwood> tefa: ^ starting at 42, add one, then two, then three - resulting in fourty-eight
roshanavand has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
<tefa> i got that perfectly.... but what it means exactly :+
<tefa> just telling it... do a sum?
<havenwood> you can alternatively write that:
<havenwood> >> [1,2,3].reduce(42) { |acc, n| acc + n }
<ruby[bot]> havenwood: # => 48 (https://eval.in/956569)
<havenwood> or in modern Ruby, just: [1,2,3].sum(42) #=> 48
marmorkreb has joined #ruby
<tefa> [1,2,3].reduce(42)i understand till here now.... then from here... { |acc, n| acc + n } only that n will be 1 or 2 or 3... wright ?
<havenwood> tefa: they ^ all do the same thing, they start with 42 then add each item in the array and return the result
ahrs has joined #ruby
alfiemax has joined #ruby
ahrs has quit [Remote host closed the connection]
<tefa> oh i think i got it
<tefa> [1,2,3].reduce(42) { |acc, n| acc + n }.... its doing something like this... |acc=42, n= 1 or 2 or 3 | acc + n.. every time it executes till it array every value.. will do... 42 + 1 now acc isnt anymore 42 now its 43... so |acc=43, n = 2 or 3| acc + 2... now execute rest of the values.. 43 + 2 = 45... now the same till 3.. and get 48 right ?
<havenwood> tefa: yup, correct
<tefa> iujuu
<tefa> ^^
<tefa> ty for your time
<havenwood> tefa: you're welcome, happy coding!
<tefa> and the explanation obviously :D
konsolebox has quit [Ping timeout: 256 seconds]
jordanm has quit [Quit: Konversation terminated!]
konsolebox has joined #ruby
snickers has joined #ruby
LocaMocha has joined #ruby
LocaMocha has quit [Max SendQ exceeded]
rabajaj has joined #ruby
Sifrael884 has joined #ruby
alfiemax has quit [Ping timeout: 256 seconds]
marmorkreb has quit [Remote host closed the connection]
alfiemax has joined #ruby
LocaMocha has joined #ruby
benjen has quit [Ping timeout: 240 seconds]
anisha_ has joined #ruby
Gnut has quit [Ping timeout: 260 seconds]
eroux has joined #ruby
anisha has quit [Ping timeout: 260 seconds]
roonsauce has joined #ruby
konsolebox has quit [Ping timeout: 252 seconds]
konsolebox has joined #ruby
alfiemax has quit [Remote host closed the connection]
darkhanb has joined #ruby
alfiemax has joined #ruby
roonsauce has quit [Ping timeout: 268 seconds]
alfiemax has quit [Ping timeout: 248 seconds]
morenoh149 has joined #ruby
anisha__ has joined #ruby
anisha_ has quit [Ping timeout: 268 seconds]
morenoh149 has quit [Ping timeout: 240 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
konsolebox has joined #ruby
jordanm has joined #ruby
alfiemax has joined #ruby
marmorkreb has joined #ruby
jud has quit [Read error: Connection reset by peer]
jud has joined #ruby
yonahw has joined #ruby
konsolebox has quit [Ping timeout: 256 seconds]
alex`` has joined #ruby
jamesaxl has joined #ruby
<tefa> any help here? exaplanation inside gist https://gist.github.com/tefanga/960676c6e78b37804452302daf4a2b77
konsolebox has joined #ruby
Dimik has quit [Ping timeout: 260 seconds]
conta has joined #ruby
nowhereman_ has quit [Quit: Konversation terminated!]
nowhereman_ has joined #ruby
konsolebox has quit [Ping timeout: 255 seconds]
mtkd has joined #ruby
terens has joined #ruby
vyorkin has joined #ruby
konsolebox has joined #ruby
learning-ruby has joined #ruby
<terens> Hello. Theoriticaly speaking what is the best way for a ruby program to make most concurrent http requests and wait for response ?
learning-ruby has quit [Client Quit]
nowhereman_ has quit [Ping timeout: 256 seconds]
ogres has quit [Quit: Connection closed for inactivity]
guardianx has joined #ruby
ledestin has quit [Read error: Connection reset by peer]
n008f4g_ has quit [Ping timeout: 260 seconds]
tefa has quit []
guardianx has quit [Ping timeout: 276 seconds]
guardianx has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
terens2 has joined #ruby
guardianxx has joined #ruby
guardianx has quit [Read error: Connection reset by peer]
terens has quit [Ping timeout: 264 seconds]
darkhanb has joined #ruby
konsolebox has quit [Ping timeout: 256 seconds]
morenoh149 has joined #ruby
konsolebox has joined #ruby
aufi has joined #ruby
dionysus69 has joined #ruby
hairui has quit [Ping timeout: 276 seconds]
morenoh149 has quit [Ping timeout: 240 seconds]
marmorkreb has quit [Ping timeout: 240 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
schneide_ has joined #ruby
konsolebox has joined #ruby
nowhereman_ has joined #ruby
schneide_ has quit [Ping timeout: 260 seconds]
clemens3 has joined #ruby
hairui has joined #ruby
TomyWork has joined #ruby
benjen has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
schneide_ has joined #ruby
alex`` has quit [Quit: WeeChat 2.0.1]
hairui has quit [Ping timeout: 265 seconds]
hairui has joined #ruby
ramfjord has joined #ruby
konsolebox has quit [Ping timeout: 264 seconds]
prutheus has joined #ruby
<prutheus> I am on rails and want to make a file upload. I have described my error here https://stackoverflow.com/questions/48802589/rails-form-with-file-input-field-file-just-name-as-string can someone help me please?
<zenspider> nope. please go to #rubyonrails
konsolebox has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
hairui has quit [Ping timeout: 276 seconds]
cdg has joined #ruby
<Matthew1> oh snap
guardianx has joined #ruby
guardianxx has quit [Ping timeout: 240 seconds]
<dionysus69> hey ruby folks
guardianx has quit [Client Quit]
konsolebox has quit [Ping timeout: 260 seconds]
cdg has quit [Ping timeout: 276 seconds]
<prutheus> yoooo dionysus69
hairui has joined #ruby
marr has joined #ruby
konsolebox has joined #ruby
_asqrd_ has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
hairui has quit [Ping timeout: 248 seconds]
hairui has joined #ruby
_asqrd_ has quit [Client Quit]
<zenspider> that's some excitin' dialog right there...
prutheus has quit [Ping timeout: 260 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
oroborous has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
<dionysus69> :D
<dionysus69> I had a question :)
<zenspider> and yet...
<dionysus69> I am developing API for lnd in ruby
aupadhye has joined #ruby
roshanavand has quit [Ping timeout: 256 seconds]
konsolebox has quit [Ping timeout: 255 seconds]
konsolebox has joined #ruby
<dionysus69> as you can see I am parsing the output of bash call
<dionysus69> is there a better way to do this? this somehow doesn't seem ruby neat
morenoh149 has joined #ruby
roonsauce has joined #ruby
morenoh149 has quit [Ping timeout: 248 seconds]
jaruga has joined #ruby
roonsauce has quit [Ping timeout: 252 seconds]
hairui has quit [Ping timeout: 240 seconds]
<zenspider> ?question
<ruby[bot]> zenspider: I don't know anything about question
<zenspider> ?questions
<ruby[bot]> zenspider: I don't know anything about questions
<zenspider> argh
hairui has joined #ruby
<Matthew1> ?question what do women want
<ruby[bot]> Matthew1: I don't see no what, whom should I tell about question?
<zenspider> ?answers dionysus69
<ruby[bot]> dionysus69: How to ask the right questions to get you the right answer: https://www.mikeash.com/getting_answers.html
<dionysus69> :D
<dionysus69> I meant more like rubocop type optimization but with human help :) no specific question xD
<zenspider> then you probably get no specific answer... vagueries like "better" and "neat" are subjective at best.
mikecmpbll has joined #ruby
<dionysus69> ok I guess I'll take it as it is good enough :D
guille-moe has joined #ruby
workmad3 has joined #ruby
mello has joined #ruby
hairui has quit [Ping timeout: 256 seconds]
hairui has joined #ruby
tomlukeywood has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
tomlukeywood has quit [Remote host closed the connection]
ramfjord has joined #ruby
tomlukeywood has joined #ruby
alex`` has joined #ruby
<zenspider> released flog, ruby_parser, sexp_processor, and soon: ruby2ruby
<dminuoso> TIL
<dminuoso> > p a: b = 2
<dminuoso> This is valid syntax.
<zenspider> yup
<zenspider> s(:call, nil, :p, s(:hash, s(:lit, :a), s(:lasgn, :b, s(:lit, 2))))
kliq has joined #ruby
dextrey has joined #ruby
tomlukeywood has quit [Remote host closed the connection]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
guille-moe has quit [Quit: guille-moe]
hairui has quit [Remote host closed the connection]
konsolebox has quit [Ping timeout: 240 seconds]
schneide_ has quit [Read error: Connection reset by peer]
ramfjord has quit [Ping timeout: 248 seconds]
schneide_ has joined #ruby
tvw has joined #ruby
morenoh149 has joined #ruby
<dminuoso> ast>> p a: b = 2
<ruby[bot]> dminuoso: I have parsed your code, the result is at https://eval.in/956676
<dminuoso> zenspider: What representation is yours?
<zenspider> mine comes from ruby_parser
<zenspider> + sexp_processor
konsolebox has joined #ruby
alfiemax has quit [Remote host closed the connection]
tjbp has quit [Ping timeout: 265 seconds]
morenoh149 has quit [Ping timeout: 240 seconds]
hairui has joined #ruby
<zenspider> ruby2ruby released
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
learning-ruby has joined #ruby
learning-ruby has quit [Client Quit]
mtkd has quit [Ping timeout: 264 seconds]
mtkd has joined #ruby
alfiemax has joined #ruby
terens2 is now known as terens
<dminuoso> ast>> [f b]
<ruby[bot]> dminuoso: I have parsed your code, the result is at https://eval.in/956687
<dminuoso> Yeah. I wish you would parse this Ruby.
hairui has quit [Ping timeout: 264 seconds]
<terens> is there any reason to use windows xp still ?
<terens> when there is no need to run any special software
konsolebox has quit [Ping timeout: 248 seconds]
mello has quit [Ping timeout: 248 seconds]
tjbp has joined #ruby
workmad3 has joined #ruby
konsolebox has joined #ruby
mello has joined #ruby
mello is now known as Guest20819
ledestin has joined #ruby
hairui has joined #ruby
Guest74089 has quit [Ping timeout: 260 seconds]
Beams has joined #ruby
Guest20819 is now known as mello
mello has quit [Changing host]
mello has joined #ruby
konsolebox has quit [Ping timeout: 255 seconds]
konsolebox has joined #ruby
hairui has quit [Ping timeout: 268 seconds]
<Bish> anyone else having problems building ffi?
<Bish> looks like ubuntu doesn't want me to build it right now
qba73 has joined #ruby
mtkd has quit [Ping timeout: 248 seconds]
ianfleeton has joined #ruby
mtkd has joined #ruby
marmorkreb has joined #ruby
konsolebox has quit [Ping timeout: 256 seconds]
<Bish> terens: never change a running system?
Serpent7776 has joined #ruby
<jhass> terens: yeah, as a honeypot to catch malware
konsolebox has joined #ruby
<jhass> or maybe you like running a botnet node
<jhass> but I didn't know XP was written in Ruby!
Cavallari has joined #ruby
marmorkreb has quit [Ping timeout: 240 seconds]
kies has quit [Remote host closed the connection]
hairui has joined #ruby
<guardian> hello I have a syntax question. Is there an elegant way to write something like: map[:foo] ||= ...
<guardian> where "..." is a multi line statements that returns an array
<guardian> when "..." returns a map, I would use ||= {}.tap
<Bish> guardian: im guessing you can use .update for that
<Bish> when provided with a block, you can choose the update behaviour so that, old values will be kept
hairui has quit [Remote host closed the connection]
hairui has joined #ruby
<Bish> >> {v:1}.update(v:2) { |old,new| p [old,new]; false; }
<Bish> >> {v:1}.update(v:2) { |old,new| p [old,new]; false; }
<ruby[bot]> Bish: # => [:v, 1] ...check link for more (https://eval.in/956748)
<Bish> >> {v:1}.update(v:2) { |old,new,moar| p [old,new,moar]; false; }
<ruby[bot]> Bish: # => [:v, 1, 2] ...check link for more (https://eval.in/956750)
<Bish> or you do it the other way around, you have a Hash with default values, and update it with your new values
qba73 has quit []
<Bish> sounds clean to me
<guardian> thanks will try playing with .update
qba73 has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
hairui has quit [Ping timeout: 264 seconds]
hairui has joined #ruby
amatas has joined #ruby
bijan_ has joined #ruby
SebastianThorn has quit [Ping timeout: 256 seconds]
ldnunes has joined #ruby
hairui has quit [Ping timeout: 260 seconds]
schneide_ has quit [Remote host closed the connection]
konsolebox has quit [Ping timeout: 256 seconds]
lukeyb has joined #ruby
hairui has joined #ruby
<lukeyb> Say I have a number 33, and I need to go up in increments of 2, is there a ruby method that will round up or down to the nearest x? i.e. 33.round(:down, 2)
konsolebox has joined #ruby
schneide_ has joined #ruby
<lukeyb> or 2.41.round(:up, 0.02)
workmad3 has quit [Ping timeout: 255 seconds]
<dminuoso> Who thinks ruby should allow this? https://eval.in/956791
nowhereman_ has quit [Ping timeout: 276 seconds]
roonsauce has joined #ruby
<dminuoso> lukeyb: multiply, round, divide.
<Bish> dminuoso: i don't
<dminuoso> Bish: Why not? It allows for much more consistent indention.
<Bish> i just don't sorry, i don't have an argument, just looks ugly as hell :D
schneide_ has quit [Ping timeout: 248 seconds]
vutral|kali has quit [Ping timeout: 240 seconds]
vutral|kali_ has joined #ruby
rabajaj has quit [Ping timeout: 276 seconds]
hairui has quit [Ping timeout: 260 seconds]
rabajaj has joined #ruby
hairui has joined #ruby
Guest99434 is now known as marahin
marahin has quit [Changing host]
marahin has joined #ruby
roonsauce has quit [Ping timeout: 252 seconds]
workmad3 has joined #ruby
vutral|kali_ has quit [Ping timeout: 240 seconds]
roshanavand has joined #ruby
konsolebox has quit [Ping timeout: 256 seconds]
<dminuoso> Bish: Let me make a better example
konsolebox has joined #ruby
yohji has joined #ruby
Matthew1 is now known as ComboBreaker
ComboBreaker is now known as Matthew1
<dminuoso> Bish: https://eval.in/956793
tjbp has quit [Ping timeout: 260 seconds]
bijan_ is now known as bijan_awaaaay
goatish has joined #ruby
hairui has quit [Ping timeout: 256 seconds]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
<dminuoso> lukeyb: depending on what you do you could also use enumerators
mtkd has quit [Ping timeout: 276 seconds]
<dminuoso> >> 2.step(33).lazy.take(10)
<ruby[bot]> dminuoso: # => #<Enumerator::Lazy: #<Enumerator::Lazy: #<Enumerator: 2:step(33)>>:take(10)> (https://eval.in/956801)
<dminuoso> >> 2.step(33).lazy.take(10).force
<ruby[bot]> dminuoso: # => [2, 3, 4, 5, 6, 7, 8, 9, 10, 11] (https://eval.in/956802)
<dminuoso> err
<dminuoso> >> 33.step(2).lazy.take(10).force
<ruby[bot]> dminuoso: # => [] (https://eval.in/956803)
rabajaj has quit [Remote host closed the connection]
mtkd has joined #ruby
schneide_ has joined #ruby
<dminuoso> >> 33.step(by: 2).drop(1).take(10).force
<ruby[bot]> dminuoso: # => failed to allocate memory (NoMemoryError) ...check link for more (https://eval.in/956806)
<dminuoso> >> 33.step(by: 2).lazy.drop(1).take(10).force
<ruby[bot]> dminuoso: # => [35, 37, 39, 41, 43, 45, 47, 49, 51, 53] (https://eval.in/956808)
<lukeyb> dminuoso, thanks
<dminuoso> lukeyb: Ideally you wouldn't force it, but instead just chain more things into the lazy enum (enabling loop fusion)
<dminuoso> e.g: 33.step(by: 2).lazy.map { |e| "Magic #{e}" }.map { |e| http.request(e) }.take(10)
<lukeyb> dminuoso my problem is a little different, see here https://eval.in/956810
xfbs has joined #ruby
xfbs has quit [Client Quit]
<dminuoso> lukeyb: There's a flaw in there already. =)
<lukeyb> I need to work out the nearest odds based on the case statement, i.e. if I have odds of 33, it should give odds off 34
<dminuoso> lukeyb: What happens if odd == 20.005 ?
hairui has joined #ruby
<dionysus69> hey dminuoso
<lukeyb> 2.01 should return 2.02 etc
<dminuoso> lukeyb: and 2.005 ? =)
<dionysus69> can you please help me port a python project to ruby? just give me an advise on where to start ? :)
<lukeyb> I need to return the next closest float by the increment in the returned from the case
<dminuoso> lukeyb: that wont do the job what you are trying
<lukeyb> I know, I am just trying out a few things, then got frustrated and jumped on here for guidance
osvico has quit [Read error: Connection reset by peer]
<lukeyb> any thoughts
<lukeyb> also just trying to frame/simplify my problem and what I need to acheive
osvico has joined #ruby
<dionysus69> so I basically want to do exactly this in ruby as this thing does in python https://gist.github.com/takinbo/27b58c84dcb58abf8c556caad3949aea any kind of help appreciated :) just don't know where to start
<dionysus69> I have installed grpc gem
alfiemax has quit [Remote host closed the connection]
hairui has quit [Ping timeout: 264 seconds]
bijan_awaaaay is now known as bijan_
<lukeyb> dminuoso this gem does what I need https://github.com/brianhempel/rounding
mikecmpb_ has joined #ruby
tjbp has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
John_Ivan has joined #ruby
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
konsolebox has quit [Ping timeout: 240 seconds]
<dminuoso> lukeyb: https://eval.in/956824
konsolebox has joined #ruby
alfiemax has joined #ruby
<dminuoso> lukeyb: I think you're just overthinking this. ;-)
<lukeyb> probably, but that gem works really well
rabajaj has joined #ruby
hairui has joined #ruby
<dminuoso> lukeyb: You're just thinking way too hard. You dont need a gem for it, you just need 1 line of code.
<dminuoso> lukeyb: And the way I see it, its not rounding to two according to the map you have given
<Bish> reminds me of lpad in npm
<Bish> is there a gem that increments an integer?
<dminuoso> Bish: technically lpad has a reason for existing though, but thats a different story
<Bish> i love that joke
<dminuoso> lukeyb: and if you truly just want to round to "nearest", I told you -> divide, round, multiply
<lukeyb> dminuoso appreciate the assistance
alfiemax has quit [Ping timeout: 268 seconds]
<zenspider> dminuoso: only haskellers want that syntax. go code over there. :P
drewmcmillan has joined #ruby
<dminuoso> >> to = -> (t, n) { (n / t).round * t }.curry; (0..20).map(&to[5])
<ruby[bot]> dminuoso: # => [0, 0, 0, 0, 0, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 20] (https://eval.in/956825)
<dminuoso> zenspider: Already doing just that! :P
<Bish> >> r=0.02;result=2.0;loop { x = rand*10; break if rand == result+r }
<ruby[bot]> Bish: # => (https://eval.in/956826)
<dminuoso> The distinct usage of curry and lambdas everywhere should have been an indicator.
<Bish> >> r=0.02;result=2.0;loop { x = rand*10; break x if rand == result+r }
<ruby[bot]> Bish: # => (https://eval.in/956827)
<zenspider> doesn't mean we need their syntax preferences
<Bish> >> r=0.02;result=2.0;p loop { x = rand*10; break x if rand == result+r }
<ruby[bot]> Bish: # => (https://eval.in/956828)
<dminuoso> lukeyb: And if you want to shift that to round upwards, you also throw some (... + t) in there.
<Bish> :(
<dminuoso> or I should have written
Jose__ has joined #ruby
<dminuoso> >> to = -> (t, n) { (n / t).round * t }.curry; 1.step.lazy.map(&to[5]).take(10).force
<ruby[bot]> dminuoso: # => [0, 0, 0, 0, 5, 5, 5, 5, 5, 10] (https://eval.in/956829)
spastorino has left #ruby [#ruby]
konsolebox has quit [Ping timeout: 260 seconds]
<dminuoso> >> to = -> (t, n) { (n / t).round * t }.curry; 1.step.lazy.map(&to[5]).take(20).force
<ruby[bot]> dminuoso: # => [0, 0, 0, 0, 5, 5, 5, 5, 5, 10, 10, 10, 10, 10, 15, 15, 15, 15, 15, 20] (https://eval.in/956830)
<Bish> that explains it really really well
<zenspider> dionysus69: you're starting to sound like a help vampire... write some code. when you have *specific* problems, ask *good* questions and we'll be happy to help.
<dminuoso> Anyway. Hello zenspider by the way. You're a rare sight nowadays, what keeps you busy? :0
<zenspider> life. just not hanging out on irc much these days
konsolebox has joined #ruby
catphish has joined #ruby
Jose__ has quit [Client Quit]
rabajaj has quit [Ping timeout: 268 seconds]
<catphish> is there a simple way to parse a fairly language-generic string into an appropriate object? for example "1" => 1, "'hello'" => "hello", "\"world\"" => "world", "true" => true, "FALSE" => false, etc
<catphish> essentially the opposite of inspect for the most common types
<zenspider> EVAL!
<dminuoso> >> to = -> (t, n) { (n / t).round * t }.curry; 1.step.lazy.map(&to[5]).take(20).zip(1.step.lazy).force # havenwood cool, you can alzo zip lazy enums =)
<ruby[bot]> dminuoso: # => [[0, 1], [0, 2], [0, 3], [0, 4], [5, 5], [5, 6], [5, 7], [5, 8], [5, 9], [10, 10], [10, 11], [10, 12 ...check link for more (https://eval.in/956833)
<catphish> zenspider: lol, yes, but no :)
<zenspider> awwwww
<dminuoso> catphish: What kind of objects do you want to support?
<catphish> to be more specific, i want to handle untrusted strings, and they will only be strings, integers and booleans
<zenspider> you could try ruby_parser or ripper, I guess... but it'll be a lot of mechanism for little payoff
<catphish> maybe better just to use a couple of regexes
<catphish> since it's quite a narrow range of possibilities
<dminuoso> catphish: you could use YAML.load if that fits your bill
<dminuoso> the cases you mentioned would be YAML parseable
<dminuoso> >> YAML.load("false")
<ruby[bot]> dminuoso: # => uninitialized constant YAML (NameError) ...check link for more (https://eval.in/956834)
tvw has quit [Read error: Connection reset by peer]
konsolebox has quit [Ping timeout: 240 seconds]
<dminuoso> >> require 'yaml'; YAML.load("")
<ruby[bot]> dminuoso: # => false (https://eval.in/956835)
<dminuoso> >> require 'yaml'; YAML.load("false")
<ruby[bot]> dminuoso: # => false (https://eval.in/956836)
<dminuoso> >> require 'yaml'; YAML.load("\"false\"")
<catphish> ah yes, that might work,
drewmcmillan has quit [Read error: Connection reset by peer]
bijan_ has quit [Quit: Shutting Down Interwebs...Done.]
<zenspider> or RubyParser.for_current_ruby "42" => s(:lit, 42)
<dionysus69> didn't mean to be a help vampire :D :S
<zenspider> but again, lots of work
drewmcmillan has joined #ruby
<zenspider> YAML could fit the bill... but can invoke oddities on load
konsolebox has joined #ruby
<dminuoso> zenspider: if its just those few cases, zenspider would just need a simpler evaluator for :lit nodes though
lukeyb has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> that doesnt sound like too much work
<zenspider> >> require "ripper"; Ripper.sexp "42"
<ruby[bot]> zenspider: # => [:program, [[:@int, "42", [1, 0]]]] (https://eval.in/956837)
<zenspider> >> require "ripper"; Ripper.sexp "true"
<ruby[bot]> zenspider: # => [:program, [[:var_ref, [:@kw, "true", [1, 0]]]]] (https://eval.in/956838)
<zenspider> that's just so... bleh
<dminuoso> Well its more of a CST than an AST
<dminuoso> RubyParse seems much nicer
<zenspider> and that's the clean one!
<zenspider> >> require "ripper"; Ripper.raw_sexp "true"
<ruby[bot]> zenspider: # => undefined method `raw_sexp' for Ripper:Class (NoMethodError) ...check link for more (https://eval.in/956839)
<zenspider> >> require "ripper"; Ripper.sexp_raw "true"
<ruby[bot]> zenspider: # => [:program, [:stmts_add, [:stmts_new], [:var_ref, [:@kw, "true", [1, 0]]]]] (https://eval.in/956840)
<dminuoso> o.o
Cavallari1 has joined #ruby
<catphish> looks like YAML is plenty good enough for now
<catphish> thanks
<zenspider> again, think about security issues. yaml lets you specify the type and goes through dump/load code
hairui has quit [Ping timeout: 256 seconds]
<zenspider> json might be a better choice, depending...
* zenspider goes to bed...
<dminuoso> zenspider: I thought about it, but that wont parse "FALSE" sadly :(
<dminuoso> Good night o/
alfiemax has joined #ruby
Cavallari has quit [Ping timeout: 276 seconds]
Cavallari1 is now known as Cavallari
cdg_ has joined #ruby
dextrey has quit [Ping timeout: 268 seconds]
alfiemax has quit [Ping timeout: 255 seconds]
cdg_ has quit [Remote host closed the connection]
jnyw has quit [Quit: WeeChat 2.0.1]
hairui has joined #ruby
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mrush has quit [Ping timeout: 276 seconds]
mikecmpb_ has quit [Read error: Connection reset by peer]
hairui has quit [Ping timeout: 248 seconds]
ocher has joined #ruby
mikecmpbll has joined #ruby
tomlukeywood has joined #ruby
<ocher> hi. I wonder if there is a way of creating a "view" of a file. I want to read some part of the file, but I don't want to read all of it into memory, but rather provide that "view" to the component which then sends data further
mikecmpbll has quit [Client Quit]
<ocher> that "view" is a stream, which points to a given range of bytes in the file. and then some other object may read data from that stream
AJA4350 has joined #ruby
mikecmpbll has joined #ruby
hairui has joined #ruby
mikecmpbll has quit [Client Quit]
tjbp has quit [Ping timeout: 255 seconds]
alfiemax has joined #ruby
konsolebox has quit [Ping timeout: 276 seconds]
konsolebox has joined #ruby
tomeaton17 has joined #ruby
qba73 has quit [Remote host closed the connection]
<tomeaton17> I have never worked with ruby before and trying to maintain some one elses code. Can somebody please explain what this line does? real_code = "%010d" % entry_code[1..-2].to_i(2)
<ocher> basically, I would be interested in something which works like this: IO.binread(path, length, offset) but instead of returning String, it returns stream (Enumerable)
qba73 has joined #ruby
<havenwood> tomeaton17: You could alternatively write that: sprintf("%010d", entry_code[1..-2].to_i(2))
tjbp has joined #ruby
<apeiros> tomeaton17: what parts do you understand and what parts do you have trouble with?
alfiemax has quit [Ping timeout: 264 seconds]
tomlukeywood has quit [Remote host closed the connection]
<RougeR> heya
<RougeR> im doing a ruby bootcamp and i think ive got a bit lost here
<RougeR> it seems like my bookingsystem.tables array isnt holding onto the reservations
<tomeaton17> apeiros: I get its being converted into binary, I don't understand the "%010d" % entry_code[1..-2]
workmad3 has quit [Ping timeout: 248 seconds]
Gnut has joined #ruby
<apeiros> >> "%010d" % 21
<ruby[bot]> apeiros: # => "0000000021" (https://eval.in/956858)
<havenwood> >> 'tomeaton17'[1..-2]
<ruby[bot]> havenwood: # => "omeaton1" (https://eval.in/956859)
<apeiros> and it's not converted *into* binary
<apeiros> it's converted *from*
<havenwood> >> sprintf("%010d", 21)
<apeiros> >> "1011".to_i(2)
<ruby[bot]> havenwood: # => "0000000021" (https://eval.in/956860)
<ruby[bot]> apeiros: # => 11 (https://eval.in/956861)
<apeiros> meh, 2 cooks is 1 too many
* apeiros lets havenwood explain it :D
konsolebox has quit [Ping timeout: 240 seconds]
nowhereman_ has joined #ruby
<tomeaton17> Okay so it basically just strips the first and last characters and displays as decimal
dreaduo has joined #ruby
dreaduo has quit [Client Quit]
konsolebox has joined #ruby
mjolnird has quit [Remote host closed the connection]
mjolnird has joined #ruby
j`ey has joined #ruby
<j`ey> I forgot by-value/reference stuff works in ruby. anyone know a good site that explains that?
learning-ruby has joined #ruby
<zleap> hi larissa
konsolebox has quit [Ping timeout: 248 seconds]
<zleap> hi learning-ruby
hairui has quit [Ping timeout: 240 seconds]
<zleap> sorry larissa auto complete and pressing enter too quick
hairui has joined #ruby
konsolebox has joined #ruby
c0ncealed has quit [Remote host closed the connection]
achen has joined #ruby
apparition has joined #ruby
c0ncealed has joined #ruby
achen has left #ruby [#ruby]
KevinSjoberg has quit [Ping timeout: 256 seconds]
konsolebox has quit [Ping timeout: 248 seconds]
learning-ruby has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
konsolebox has joined #ruby
<havenwood> j`ey: Short answer, by value--the value being an object reference.
Dimik has joined #ruby
<j`ey> hm, thanks
goatish has quit [Quit: Hibernating]
MyMind has joined #ruby
Gnut has quit [Ping timeout: 256 seconds]
Sembei has quit [Ping timeout: 260 seconds]
konsolebox has quit [Ping timeout: 260 seconds]
marmorkreb has joined #ruby
konsolebox has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
kapil___ has joined #ruby
reber has joined #ruby
leitz has joined #ruby
marmorkreb has quit []
hairui has quit [Ping timeout: 260 seconds]
Gnut has joined #ruby
Lyubo1 has quit [Ping timeout: 260 seconds]
Lyubo1 has joined #ruby
shinnya has joined #ruby
<dminuoso> j`ey: We have neither.
govg has quit [Ping timeout: 264 seconds]
<dminuoso> j`ey: The correct name is call by sharing.
EG^ has joined #ruby
<j`ey> turned out me thinking about that was a red herring
<j`ey> the issue was something else
<dminuoso> j`ey: https://eval.in/956893
rabajaj has joined #ruby
<j`ey> but say you have x = blah.find{|a| some_condition(a)}. then if you do x << 10. you'd expect blah to also be changed right?
<dminuoso> j`ey: No.
<dminuoso> j`ey: It's the underlying objects that get changed.
ocher has quit [Ping timeout: 260 seconds]
<dminuoso> j`ey: The thing is << does not mutate.
<dminuoso> Or idk. apparently it does
<dminuoso> havenwood: I suck.
<j`ey> I think it does
<dminuoso> >> a = [1]; x = [a].find(&:itself); x << 1; p a
hairui has joined #ruby
<ruby[bot]> dminuoso: # => [1, 1] ...check link for more (https://eval.in/956894)
<dminuoso> j`ey: As you can see the underlying object is mutated.
<havenwood> dminuoso: Pass by caring!
<dminuoso> Hah
<j`ey> thanks, yeah that makes sense
<apeiros> it depends on what you call << on too
Gnut has quit [Ping timeout: 255 seconds]
<apeiros> >> a = [1,2,3]; x = a.find(&:even?); x << 1; a
<ruby[bot]> apeiros: # => [1, 2, 3] (https://eval.in/956895)
rahul_bajaj has joined #ruby
<dminuoso> Heh.
synthroid has joined #ruby
konsolebox has quit [Ping timeout: 260 seconds]
rabajaj has quit [Ping timeout: 276 seconds]
konsolebox has joined #ruby
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
hairui has quit [Ping timeout: 268 seconds]
ianfleeton has joined #ruby
GodFather has joined #ruby
rahul_bajaj has quit [Remote host closed the connection]
bmurt has joined #ruby
KeyJoo has joined #ruby
alfiemax has joined #ruby
bigblind has joined #ruby
EG^ has quit [Ping timeout: 260 seconds]
<Bish> dminuoso: is there something like infintite lists in ruby?
<Bish> with lazy evaluation?
hairui has joined #ruby
spectrum has quit [Ping timeout: 240 seconds]
tomeaton17 has left #ruby ["WeeChat 2.0.1"]
Guest1471 has joined #ruby
Guest1471 is now known as beauby
alfiemax has quit [Ping timeout: 240 seconds]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
nadir has joined #ruby
<tobiasvl> dminuoso: yes, Enumerable::Lazy
dviola has joined #ruby
Psybur has joined #ruby
tvw has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<tobiasvl> hmm, this is neat
<tobiasvl> >> (1..(1.0/0)).take(10)
<ruby[bot]> tobiasvl: # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/956898)
nowhereman_ has quit [Ping timeout: 256 seconds]
<havenwood> >> 1.step.first(10)
<ruby[bot]> havenwood: # => [1, 2, 3, 4, 5, 6, 7, 8, 9, 10] (https://eval.in/956899)
<havenwood> >> 1.step.lazy
<ruby[bot]> havenwood: # => #<Enumerator::Lazy: #<Enumerator: 1:step>> (https://eval.in/956900)
EG^ has joined #ruby
hairui has quit [Ping timeout: 256 seconds]
blackmesa has quit [Ping timeout: 240 seconds]
qba73 has quit [Ping timeout: 256 seconds]
damasceno has joined #ruby
hairui has joined #ruby
<damasceno> Hi! Does anyone know how to check the latest release of a github repo? I want to show the latest version available when the user executes the application with the version "-v". Is it possible?
<tobiasvl> damasceno: usually, that kind of thing is done when releasing. so you run a command to make a new release, which creates the git(hub) "version" as a tag and gem version at the same time
<tobiasvl> I don't know if it's commonly used, but something like this thing does: https://github.com/svenfuchs/gem-release
<damasceno> thanks tobiasvl
tcopeland has quit [Quit: tcopeland]
hairui has quit [Ping timeout: 248 seconds]
k0mpa has joined #ruby
jeffreylevesque has joined #ruby
KeyJoo has quit [Ping timeout: 260 seconds]
osvico has quit [Read error: Connection reset by peer]
osvico has joined #ruby
shinnya has quit [Ping timeout: 255 seconds]
hairui has joined #ruby
konsolebox has quit [Ping timeout: 240 seconds]
konsolebox has joined #ruby
bmurt has joined #ruby
alfiemax has joined #ruby
hairui has quit [Ping timeout: 264 seconds]
hairui has joined #ruby
spectrum has joined #ruby
<dionysus69> ok back with more data
<dionysus69> I am stuck at the part where I create channel
<dionysus69> but I can't figure out how to send commands to the rpc server
alfiemax has quit [Ping timeout: 240 seconds]
<dionysus69> this is the rpc_services_pb.rb file https://gist.github.com/4c553d2d8bfd1b419aaf9653dd44463e
qba73 has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dionysus69> I am trying to call Lnrpc::Lightning::Service.rpc WalletBalance for example
<dionysus69> in the first gist I included python template bellow, that's what I am trying to emulate, but the whole structure is different there :S
tcopeland has joined #ruby
bmurt has joined #ruby
hairui has quit [Read error: Connection reset by peer]
vondruch has quit [Ping timeout: 256 seconds]
jcalla has joined #ruby
EG^ has quit [Ping timeout: 276 seconds]
hairui has joined #ruby
Cavallari has quit [Quit: Cavallari]
workmad3 has joined #ruby
hairui has quit [Ping timeout: 248 seconds]
workmad3 has quit [Ping timeout: 240 seconds]
hairui has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hairui has quit [Ping timeout: 240 seconds]
banisterfiend has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hairui has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dviola has quit [Quit: WeeChat 2.0.1]
pastorinni has joined #ruby
mello has quit [Ping timeout: 240 seconds]
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hairui has quit [Ping timeout: 240 seconds]
stormpack has joined #ruby
bmurt has joined #ruby
drewmcmillan has joined #ruby
hairui has joined #ruby
mello has joined #ruby
mello is now known as Guest94326
<dionysus69> getting `define_method': bind argument must be a subclass of Module
<dionysus69> define_method :constants_of_module, Module.instance_method(:constants)
<dionysus69> need to make module constants accessible
<Bish> tobiasvl: but something like infinite lists isn't there, right?
<Bish> i would've to work with ranges
alfiemax has joined #ruby
DLSteve has joined #ruby
<havenwood> Bish: Say more about what you're asking?
<havenwood> Bish: There are infinite enumerators in Ruby, and they can be lazy.
<Bish> how would that look
<Bish> i don't have a real case
j`ey has left #ruby [#ruby]
tcopeland has quit [Quit: tcopeland]
hairui has quit [Ping timeout: 240 seconds]
Matthew1 has quit [Remote host closed the connection]
<havenwood> Bish: sec, I'll do a gist with a few examples
alfiemax has quit [Ping timeout: 264 seconds]
KeyJoo has joined #ruby
ghoti has joined #ruby
qba73 has quit [Remote host closed the connection]
Psybur is now known as SecretNINJA
qba73 has joined #ruby
hairui has joined #ruby
<havenwood> Bish: that's ^ one example
<havenwood> >> 0.step.lazy.map(&:abs2).map(&:succ).first(10)
<ruby[bot]> havenwood: # => [1, 2, 5, 10, 17, 26, 37, 50, 65, 82] (https://eval.in/956964)
<havenwood> >> 0.step.lazy.map(&:abs2).select(&:even?).first(10)
<ruby[bot]> havenwood: # => [0, 4, 16, 36, 64, 100, 144, 196, 256, 324] (https://eval.in/956965)
<havenwood> Bish: clock.size #=> Infinity
ldnunes has quit [Read error: Connection reset by peer]
ldnunes has joined #ruby
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
krawchyk has joined #ruby
cdg has joined #ruby
jerikl has joined #ruby
cdg_ has joined #ruby
dionysus69 has quit [Ping timeout: 256 seconds]
<havenwood> Bish: those ^ two basically do the same thing
<havenwood> Bish: they lazily report their size as: Infinity
<havenwood> Bish: and yield, `:tick` then `:tock` forever
<havenwood> Bish: If you chain `.lazy` on either it'll become a lazy enumerator
<havenwood> Enumerator::Lazy
govg has joined #ruby
<havenwood> &ri Enumerator::Lazy
cdg has quit [Ping timeout: 260 seconds]
tcopeland has joined #ruby
pastorinni has quit [Remote host closed the connection]
<Bish> havenwood: thanks
Ltem has joined #ruby
workmad3 has joined #ruby
cdg_ has quit [Remote host closed the connection]
cdg has joined #ruby
terens has quit [Quit: Leaving]
Rapture has joined #ruby
cdg has quit [Ping timeout: 276 seconds]
jamiejackson has joined #ruby
ramfjord has joined #ruby
chouhoulis has joined #ruby
mtkd has quit [Ping timeout: 240 seconds]
dviola has joined #ruby
rippa has joined #ruby
mtkd has joined #ruby
qba73 has quit [Remote host closed the connection]
hairui has quit [Ping timeout: 240 seconds]
qba73 has joined #ruby
hairui has joined #ruby
alfiemax has joined #ruby
ramfjord has quit [Ping timeout: 256 seconds]
schneide_ has quit [Remote host closed the connection]
roonsauce has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
alfiemax has quit [Ping timeout: 256 seconds]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
schneide_ has joined #ruby
kus_ubuntui686 has joined #ruby
kus_ubuntui686 has quit [Max SendQ exceeded]
drewmcmillan has joined #ruby
tomlukeywood has joined #ruby
hairui has quit [Ping timeout: 255 seconds]
SynSynack has quit [Quit: Не разучиться мечтать... любить...]
schneide_ has quit [Read error: Connection reset by peer]
tomlukeywood has quit [Remote host closed the connection]
schneide_ has joined #ruby
hairui has joined #ruby
k0mpa has quit [Ping timeout: 255 seconds]
anisha_ has joined #ruby
sagax has joined #ruby
<sagax> hi all!
<sagax> where i can read about syntax . and ::
anisha__ has quit [Ping timeout: 256 seconds]
<sagax> ?
<Bish> first is method calling, second is modules
<Bish> that probably didn't help
hairui has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
Cavallari has joined #ruby
Cavallari has quit [Client Quit]
hairui has joined #ruby
<sagax> :: got access to constant and class and methods, . got access to only method. true?
<sagax> :: got access to constant and class and modules, . got access to only method. true?*
synthroid has quit [Remote host closed the connection]
<Bish> they're much more different from each other than you think
rubycoder37 has joined #ruby
<Bish> they have nearly nothing in common
<Bish> :: is for seperating namespaces, and . is for calling methods on an object
rubycoder37 is now known as rubycoder38
alfiemax has joined #ruby
synthroid has joined #ruby
brendan- has joined #ruby
jerikl has joined #ruby
apparition has quit [Quit: Bye]
<sagax> thanks, got it
Silthias has joined #ruby
<Bish> when you name things, you might name things the same way in different projects, that's what you need modules for
<Bish> so that you can have the constant VERSION in multiple places
netherwolfe has joined #ruby
<Bish> :: is for navigating in those
<rubycoder38> sometimes I try to learn other languages but I always go back to ruby, ruby have caught my heart
<rubycoder38> anyone else feel the same?
<Bish> ruby is super pretty, in my head it just looks like "boxes with methods"
<Bish> with great syntax and fake-dsl which is appealing, yeah
<Bish> but it's too freakin slow
<Bish> and threading sucks
<rubycoder38> we need faster ruby with all of that fixed
<Bish> yeah, which rbx was good
<Bish> wish*
alfiemax has quit [Ping timeout: 255 seconds]
<rubycoder38> ruby 3 is supposed to fix all of that?
damasceno has quit [Quit: Page closed]
<Bish> with weird concepts, yeah maybe it will be good
<Bish> but i think it's not really fixable
<Bish> a whole new implementation is needed, which is a hard thing to do (imho)
<Bish> like rbx :D but good
<Bish> i don't know how good jruby performance is
ianfleeton has joined #ruby
<Bish> maybe i should give it a try, build a project with it, then rage about gems i can't have
s2013 has joined #ruby
teclator has joined #ruby
workmad3 has joined #ruby
pastorinni has joined #ruby
<rubycoder38> this is how I imagine matz is looking at me every time I have fun writing ruby code: https://siliconangle.com/files/2011/08/matz.jpg
<rubycoder38> <3
hairui has quit [Ping timeout: 240 seconds]
<rubycoder38> I think I'll frame that picture and put it on my desk
teclator is now known as teclator_laptop
RougeR has quit [Ping timeout: 240 seconds]
<sagax> i send method to other like as this way -> some_method( Class.method(:method_name) )
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sagax> but maybe we have other way?
Ltem has quit [Ping timeout: 248 seconds]
<sagax> method to other method*
hairui has joined #ruby
ianfleeton has joined #ruby
<dminuoso> sagax: Say what?
<dminuoso> sagax: If you want to pass functions as first class, use blocks/procs/lambdas
<sagax> i wont send method to other method as argument
qba73 has quit [Ping timeout: 268 seconds]
ruby-learning has joined #ruby
<ruby-learning> Why is that that ENV is listed as a class in ruby-doc.org, but when I do ENV.is_a? Class it returns false?
<rubycoder38> ENV.class #=> Object
miskatonic has joined #ruby
<rubycoder38> ENV.is_a? Object #=> true
<rubycoder38> I'm confused also
hairui has quit [Ping timeout: 252 seconds]
qba73 has joined #ruby
krawchyk has quit [Ping timeout: 276 seconds]
hairui has joined #ruby
ruby-lang177 has joined #ruby
<ruby-lang177> exit
troys has joined #ruby
willsams has joined #ruby
ruby-lang177 has quit [Ping timeout: 260 seconds]
eroux has quit [Ping timeout: 260 seconds]
SynSynack has joined #ruby
synthroid has quit [Remote host closed the connection]
aufi has quit [Read error: Connection reset by peer]
aufi_ has joined #ruby
tefa has joined #ruby
tomphp has joined #ruby
<dminuoso> ruby-learning: ENV is method.
<dminuoso> >> method(:ENV)
<ruby[bot]> dminuoso: # => undefined method `ENV' for class `#<Class:#<Object:0x40f2d344>>' (NameError) ...check link for more (https://eval.in/956998)
<dminuoso> Oh well
<dminuoso> Its a constant.
<dminuoso> to
<dminuoso> ruby-learning: Anyway. Upper case does not mean Class, it just means constant.
<dminuoso> >> MAGIC = 42
<ruby[bot]> dminuoso: # => 42 (https://eval.in/956999)
tomphp has quit [Client Quit]
<ruby-learning> dminuoso: yeah but if you go to ruby-doc.org/core-2.5.0 you see ENV listed as a class
hairui has quit [Ping timeout: 248 seconds]
willsams is now known as storminator16
dionysus69 has joined #ruby
<dminuoso> ruby-learning: Ah I remember this. That was just done as an rdoc hack to somehow display ENV.
<tefa> hello, question.. if i declare this sd = {la: 88, lo: 54}, how can i get the first value? usually sd[:la] but what happens when you dont know the name that will have... it could be fd... how to get the fisrt value or the seocnd etc ?
conta has quit [Ping timeout: 256 seconds]
rabajaj has joined #ruby
tvon has joined #ruby
hairui has joined #ruby
<ruby-learning> dminuoso: mm makes sense now... wow, thanks for that precise insight : )
tvon has quit [Client Quit]
synthroid has joined #ruby
Ltem has joined #ruby
stormpack has quit [Quit: Leaving]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
schneide_ has quit [Remote host closed the connection]
n008f4g_ has joined #ruby
hairui has quit [Ping timeout: 256 seconds]
hairui has joined #ruby
clemens3 has quit [Ping timeout: 265 seconds]
blackmesa has joined #ruby
<tefa> hello, question.. if i declare this sd = {la: 88, lo: 54}, how can i get the first value? usually sd[:la] but what happens when you dont know the name that will have... it could be fd... how to get the fisrt value or the seocnd etc ?
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
snickers has joined #ruby
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tefanga has joined #ruby
<tefanga> hello, question.. if i declare this sd = {la: 88, lo: 54}, how can i get the first value? usually sd[:la] but what happens when you dont know the name that will have... it could be fd... how to get the fisrt value or the seocnd etc ?
<mozzarella> tefanga: sd.first
pastorinni has quit [Remote host closed the connection]
tefa has quit [Ping timeout: 240 seconds]
ianfleeton has joined #ruby
hairui has quit [Ping timeout: 264 seconds]
jerikl has joined #ruby
krawchyk has joined #ruby
<tefanga> thaks, how do i get the second one ?
<mozzarella> hashes weren't guaranteed to be ordered in older versions of ruby
marxarelli|afk is now known as marxarelli
<mozzarella> I guess you'd have to turn it into an array first
<mozzarella> sd.to_a[1]
<mozzarella> why do you even need to do that
<mozzarella> are you sure hashes are the right fit for what you're trying to do?
<tefanga> haha
aufi_ has quit [Quit: Leaving]
rabajaj has quit [Quit: Leaving]
cagomez has joined #ruby
<tefanga> mozzarella here it is the gist with my explanation, if you could help me...
blackmesa has quit [Ping timeout: 276 seconds]
hairui has joined #ruby
pastorinni has joined #ruby
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ianfleeton has joined #ruby
<mozzarella> tefanga: "lat: %s\nlong: %s" % h.values
<mozzarella> h being the hash
hairui has quit [Ping timeout: 265 seconds]
<tefanga> i will try, but i dont know if im able to use .values :(
skweek has joined #ruby
<tefanga> i didnt learn that method %s
<tefanga> yet
nckpz has joined #ruby
<tefanga> ok.. it works.. but it does the same of doing :lat or :long
<tefanga> but my real problem is the following..
raynold has joined #ruby
jamiejackson has quit [Ping timeout: 240 seconds]
blahgh has joined #ruby
cagomez has quit [Remote host closed the connection]
<tefanga> the virtual class test me in 3 ways.... the first one it is : expected: "lat: 0\nlong: 0" got: "lat: 0\nlong: 0" perfect.... then the second its the same but with differents values... perfect... but the 3rd test... it is expected: "foo: 3\nbar: 5\ngoo: 6" got: "lat: 3\nlong: 5"
cagomez has joined #ruby
<tefanga> if the hash change.. im not getting not eigther the name of the values and the values.. none of them :S
blahgh has quit [Client Quit]
reaVer has quit [Ping timeout: 256 seconds]
krawchyk has quit [Quit: krawchyk]
TomyWork has quit [Ping timeout: 240 seconds]
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mozzarella> tefanga: h.map {|p| p.join(': ') }.join("\n")
krawchyk has joined #ruby
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
ianfleeton has joined #ruby
vutral|kali has quit [Ping timeout: 264 seconds]
rwb has joined #ruby
blackmesa has joined #ruby
mtkd has quit []
jaruga has quit [Quit: jaruga]
cagomez has quit [Ping timeout: 248 seconds]
hairui has joined #ruby
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
skweek has quit [Quit: Leaving]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
EG^ has joined #ruby
<tefanga> thanks mozzarella that solves it.. but may i know how does it works ? cause... im not pretty sure..
<mozzarella> are you familiar with map?
vutral|kali has quit [Excess Flood]
vutral|kali has joined #ruby
vutral|kali has joined #ruby
vutral|kali has quit [Changing host]
blackmesa has quit [Ping timeout: 276 seconds]
<mozzarella> I'm going to sleep, sorry
<tefanga> h.map {|p| p.join(': ') }.join("\n") map will scan h... and every key or value..(not sure) will name it p for his understanding... now.. will get the first value or key... and execute join... the parameters for join is ": " but cant understand 2 things... what its exactly mapping (using this example, if you can tell me so i can understand) and.. how does join is joining using ": "
hairui has quit [Ping timeout: 255 seconds]
<mozzarella> good night
<tefanga> ok, np, thanks
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<mozzarella> when you're mapping over an hash it's returning an array that's basically [key, value]
<tefanga> got it
apeiros has quit []
<mozzarella> >> sd = {la: 88, lo: 54}; p sd.to_a
<ruby[bot]> mozzarella: # => [[:la, 88], [:lo, 54]] ...check link for more (https://eval.in/957054)
<tefanga> and how joining its working
<tefanga> ok thats what im getting while mapping
<mozzarella> join inserts a string between every element
<mozzarella> and returns the resulting string
<tefanga> in this case ": "
<dminuoso> havenwood: arry.step.lazy.zip(1.step.lazy) should be a pattern. now I know why I hate .with_index. =P
guacamole has joined #ruby
guacamole has quit [Changing host]
guacamole has joined #ruby
<dminuoso> havenwood: I was so ruined that it felt wrong to do this in Haskell, just to realize that this is just the more explicit way of doing it - but giving more fine grained control.
jcarl43 has joined #ruby
<tefanga> so... join will do... this? la: 88:\nlo: 54
jaruga has joined #ruby
s2013 has quit [Read error: Connection reset by peer]
rubycoder38 has quit [Quit: Lost terminal]
banisterfiend has quit [Read error: Connection reset by peer]
jerikl has joined #ruby
guacamole has quit [Client Quit]
alfiemax has joined #ruby
jamiejackson has joined #ruby
jerikl has quit [Client Quit]
schneide_ has joined #ruby
teclator_laptop has quit [Remote host closed the connection]
alfiemax has quit [Ping timeout: 248 seconds]
roonsauce has quit [Remote host closed the connection]
hairui has joined #ruby
roonsauce has joined #ruby
za1b1tsu has joined #ruby
jaruga has quit [Quit: jaruga]
roonsauce has quit [Remote host closed the connection]
roonsauce has joined #ruby
jerikl has joined #ruby
schneide_ has quit [Ping timeout: 276 seconds]
armyriad has quit [Quit: Leaving]
garyserj has quit []
EG^ has quit [Ping timeout: 255 seconds]
krawchyk has quit [Quit: krawchyk]
hairui has quit [Ping timeout: 276 seconds]
yohji has quit [Remote host closed the connection]
aupadhye has quit [Quit: Leaving]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
bigblind has quit [Ping timeout: 240 seconds]
roonsauce has quit [Remote host closed the connection]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
conta has joined #ruby
jerikl has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
darkhanb has joined #ruby
jamesaxl has joined #ruby
bigblind has joined #ruby
mtkd has quit []
Serpent7776 has quit [Quit: Leaving]
hairui has joined #ruby
SeepingN has joined #ruby
blackmesa has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
minimalism has quit [Quit: minimalism]
hairui has quit [Ping timeout: 265 seconds]
mtkd has joined #ruby
morenoh149 has joined #ruby
snickers has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
qba73 has quit [Remote host closed the connection]
qba73 has joined #ruby
despai has joined #ruby
qba73 has quit [Client Quit]
jaruga has joined #ruby
sanscoeur has joined #ruby
Mrgoose2 has quit [Ping timeout: 255 seconds]
Beams has quit [Quit: .]
roonsauce has joined #ruby
catphish has quit [Quit: Leaving]
orbyt_ has joined #ruby
alfiemax has joined #ruby
jamiejackson has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
bigblind has quit [Ping timeout: 240 seconds]
jamiejackson has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
c_nick has joined #ruby
despai has quit [Quit: ...]
krawchyk has joined #ruby
graft has quit [Remote host closed the connection]
cagomez has quit [Ping timeout: 240 seconds]
<c_nick> while installing Ruby using the windows installer i was exploring the option of /s which silently installed it for me. Is it possible for me to give it an installation path too ?
despai has joined #ruby
Mrgoose has joined #ruby
despai has quit [Client Quit]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
beauby has quit [Ping timeout: 256 seconds]
za1b1tsu has quit [Quit: Leaving]
beauby has joined #ruby
hairui has joined #ruby
<tefanga> c_nick if im not wrong.. --f dir
sameerynho has joined #ruby
<tefanga> the directory should already exist
beauby has quit [Ping timeout: 248 seconds]
clemens3 has joined #ruby
<c_nick> tefanga, I think the directory gets created
<c_nick> tefanga, will check
<tefanga> example... if you have a setup.exe file... that contain compressed files.. if you do -f dir ... dir=c:\blabla\blabla
hairui has quit [Ping timeout: 248 seconds]
<tefanga> it will descompress every file on that directory.. but the directory should already exist.. to work..
<tefanga> on the other hand... if you want to change the directory from the installation wizzard... you should use -installdir="E:\Program\blabla"
<c_nick> i guess they have stripped it down to just /dir
<dminuoso> c_nick: It boils down to http://www.jrsoftware.org/isinfo.php
jaruga has quit [Quit: jaruga]
<c_nick> yes inno setup
<c_nick> so i presume it does create the directory because when you pass the directory location from the installer option (the regular installation process) it creates one
cliq has joined #ruby
<tefanga> yes it will create one
<c_nick> however like how tefanga mentioned, it will create the second level blabla while the first level blabla should exist ? or does it do it recursively
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kliq has quit [Ping timeout: 248 seconds]
jaruga has joined #ruby
tomlukeywood has joined #ruby
blackmesa has quit [Quit: WeeChat 2.0.1]
orbyt_ has joined #ruby
<tefanga> if i dont missunderstood you.. it will create first the first folder, when first exist, the second one..
marr has quit [Ping timeout: 256 seconds]
ruby-learning has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
ianfleeton has joined #ruby
k0mpa has joined #ruby
Thaelim has joined #ruby
Silthias has left #ruby [#ruby]
hairui has joined #ruby
reaVer has joined #ruby
miskatonic has quit [Quit: ERC (IRC client for Emacs 24.5.1)]
quobo has joined #ruby
hairui has quit [Ping timeout: 240 seconds]
suhdood_ has joined #ruby
anisha_ has quit [Quit: This computer has gone to sleep]
suhdood_ has quit [Remote host closed the connection]
Thaelimm has joined #ruby
Thaelim has quit [Ping timeout: 252 seconds]
luna_x has quit [Quit: WeeChat 2.0.1]
MrBusiness has quit [Ping timeout: 255 seconds]
nopolitica has joined #ruby
nopolitica has quit [Client Quit]
RougeR has quit [Ping timeout: 248 seconds]
morenoh149 has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has joined #ruby
alfiemax has quit [Ping timeout: 276 seconds]
My_Hearing has quit [Quit: WeeChat 2.0.1]
hairui has joined #ruby
n0m4d1c has joined #ruby
Thaelimmm has joined #ruby
tefanga has quit []
hairui has quit [Ping timeout: 240 seconds]
Thaelimm has quit [Ping timeout: 276 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<c_nick> tefanga, its creating them recursively .. if folder is existing it rewrites the contents in it same goes for hierarchy it just dumps the contents freshly
<c_nick> thanks all :-)
jaruga has quit [Quit: jaruga]
anjen has joined #ruby
orbyt_ has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
RougeR has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
bijan_ has joined #ruby
cthulchu has joined #ruby
troys has quit [Quit: Bye]
matchaw has joined #ruby
troys has joined #ruby
anjen has quit [Quit: anjen]
cthulchu_ has quit [Ping timeout: 240 seconds]
schneide_ has joined #ruby
EG^ has joined #ruby
alfiemax has joined #ruby
Thaelimmm has quit [Remote host closed the connection]
Thaelimmm has joined #ruby
tomlukeywood has quit [Remote host closed the connection]
morenoh149 has joined #ruby
brendan- has quit [Read error: Connection reset by peer]
c_nick has quit [Quit: ciaos]
bigblind has joined #ruby
brendan- has joined #ruby
Thaelimmm has quit [Remote host closed the connection]
marr has joined #ruby
ramfjord has joined #ruby
LocaMocha has quit [Read error: Connection reset by peer]
bmurt has quit [Quit: Textual IRC Client: www.textualapp.com]
hairui has joined #ruby
alfiemax has quit [Ping timeout: 248 seconds]
bmurt has joined #ruby
hairui has quit [Ping timeout: 268 seconds]
netherwolfe has quit [Ping timeout: 256 seconds]
netherwolfe has joined #ruby
rubycoder37 has joined #ruby
<rubycoder37> hi
roonsauce has quit [Remote host closed the connection]
roonsauce has joined #ruby
cdg has joined #ruby
<havenwood> rubycoder37: your age has reverted
rubycoder37 is now known as rubycoder38
roonsauce has quit [Remote host closed the connection]
roonsauce has joined #ruby
EG^ has quit [Ping timeout: 248 seconds]
cdg has quit [Ping timeout: 276 seconds]
mtkd has quit [Ping timeout: 260 seconds]
mtkd has joined #ruby
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
cthulchu_ has joined #ruby
<guacamole> benjaminbuttoncoder
Mon_Ouie has joined #ruby
cagomez has joined #ruby
<rubycoder38> this reminds me I'm close to 40, ah these fears of getting older...
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cthulchu has quit [Ping timeout: 248 seconds]
pastorinni has quit [Remote host closed the connection]
Asher has quit [Quit: Leaving.]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Asher has joined #ruby
<rubycoder38> I have a question about a problem that I don't know how to solve, it's about this part of my code: https://gist.github.com/anonymous/b4245e3fc200826a85264db3aef4bfb5#file-wallet_central-rb-L26-L29
<rubycoder38> the question is: if I do WalletCentral.transfer('jon', 'jaime', 'USD', 100.0) and jaime doesn't take USD, I want to convert the amount automagically, so I might create a Currency#convert class/method for this
<rubycoder38> and then return the value to the amount variable
hairui has joined #ruby
<rubycoder38> but I have no idea how, should I use a sequel hook for that or?
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SpeakerToMeat has joined #ruby
cagomez has quit [Read error: Connection reset by peer]
Mrgoose has quit [Ping timeout: 256 seconds]
* SpeakerToMeat see snone of his old friends here and goes away sad
cagomez has joined #ruby
nadir has joined #ruby
<SpeakerToMeat> Oh well it's ok, I use better languages now like VB.net
<rubycoder38> SpeakerToMeat: :(
hairui has quit [Ping timeout: 248 seconds]
<SpeakerToMeat> rubycoder38: Actually I don't use ruby much anymore it's true but at leats it's not vb.net.. or was it for the friends? there's one I miss
Mrgoose2 has joined #ruby
<rubycoder38> who do you miss?
<SpeakerToMeat> He went by Slyphon int he ruby community.
bmurt has joined #ruby
k0mpa has quit [Ping timeout: 255 seconds]
hinbody has quit [Quit: leaving]
cagomez has quit [Ping timeout: 255 seconds]
<Eiam> SpeakerToMeat: https://github.com/slyphon ?
hinbody has joined #ruby
ldnunes has quit [Quit: Leaving]
jaruga has joined #ruby
marxarelli is now known as marxarelli|afk
<SpeakerToMeat> Eiam: yeah
marxarelli|afk is now known as marxarelli
apeiros_ has joined #ruby
reber has quit [Remote host closed the connection]
Vapez has joined #ruby
bijan_ is now known as bijan_awaaaay
troulouliou_dev has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kus_ubuntui686 has joined #ruby
kus_ubuntui686 has quit [Max SendQ exceeded]
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
Mrgoose2 has quit [Ping timeout: 240 seconds]
cagomez has joined #ruby
chouhoul_ has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mrgoose2 has joined #ruby
chouhoulis has quit [Ping timeout: 268 seconds]
ianfleeton has joined #ruby
jeffreylevesque_ has joined #ruby
cagomez has quit [Ping timeout: 264 seconds]
bigblind has quit [Ping timeout: 240 seconds]
bijan_ has joined #ruby
jeffreylevesque has quit [Ping timeout: 256 seconds]
iNs has joined #ruby
Gnut has joined #ruby
Ltem has quit [Ping timeout: 256 seconds]
SecretNINJA has quit [Ping timeout: 256 seconds]
jeffreylevesque_ has quit [Ping timeout: 248 seconds]
drewmcmillan has joined #ruby
jaruga has quit [Quit: jaruga]
jamiejackson has quit [Ping timeout: 268 seconds]
Han has joined #ruby
conta has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
<Han> I just installed ruby-2.4.3 on Redhat6, ran gem install thin, started thin and got the error: Could not find i18n-0.7.0 in any of the sources
Puffball has joined #ruby
<Han> That's because i18n-1.0.0 is installed.
<Han> How do I fix that?
n0m4d1c has quit []
aguestuser has quit [Remote host closed the connection]
<havenwood> Han: Do you have a Gemfile.lock?
<havenwood> Han: If so, prefix the command you're running with: bundle exec
bijan_ is now known as bijan_awaaaay
Ltem has joined #ruby
aguestuser has joined #ruby
hairui has joined #ruby
<Han> Like this: bundle exec gem install thin? Then I get the error: Could not find thin-1.7.2 in any of the sources
cagomez has quit [Ping timeout: 268 seconds]
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cpruitt has quit []
<havenwood> Han: What command are you running that's resulting in the error?
hairui has quit [Ping timeout: 240 seconds]
sundhell is now known as sundhell_away
lagweezle has joined #ruby
cagomez has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
cagomez has quit [Ping timeout: 256 seconds]
despai has joined #ruby
linduxed has quit [Quit: WeeChat 2.0.1]
linduxed has joined #ruby
eckhardt has joined #ruby
pastorinni has joined #ruby
n008f4g_ has quit [Ping timeout: 256 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
n008f4g_ has joined #ruby
cagomez has joined #ruby
bigblind has joined #ruby
pastorinni has quit [Ping timeout: 276 seconds]
workmad3 has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroid has joined #ruby
aguestuser has quit [Remote host closed the connection]
aguestuser has joined #ruby
pastorinni has joined #ruby
cagomez has quit [Ping timeout: 240 seconds]
synthroid has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 260 seconds]
chouhoul_ has quit [Remote host closed the connection]
hairui has joined #ruby
chouhoulis has joined #ruby
<baweaver> >> {a: {b: [{c: 1}, {c: 3}]}}.dig(:a, :b, 0) # TIL
<ruby[bot]> baweaver: # => {:c=>1} (https://eval.in/957127)
<sagax> howto save block in variable ?
dionysus69 has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
<sagax> like this - foo = {puts "baz"}; foo.call
hairui has quit [Ping timeout: 276 seconds]
<wnd> you want to look at proc and lambda (or even ->), e.g. foo = lambda { puts 'baz' }
<havenwood> >> require 'ostruct'; Dig = Struct.new(:ostruct); Dig.new(OpenStruct.new(hash: {array: [42]})).dig(:ostruct, :hash, :array, 0)
<ruby[bot]> havenwood: # => 42 (https://eval.in/957128)
<havenwood> baweaver: ^
<baweaver> ...does that work on classes?
<havenwood> >> foo = -> { puts 'baz' }; foo.call #=> sagax
<ruby[bot]> havenwood: # => baz ...check link for more (https://eval.in/957133)
Gnut has quit [Ping timeout: 240 seconds]
<baweaver> Ah wait, wants hash coercion probably
jerikl has joined #ruby
<baweaver> or rather wants it to act like a hash
cagomez has quit [Remote host closed the connection]
Gnut has joined #ruby
cagomez has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<havenwood> baweaver: yeah, no class
<havenwood> baweaver: they added it to struct and ostruct
<havenwood> baweaver: i don't see why it couldn't be used for classes or modules
<havenwood> baweaver: I saw someone was even proposing Proc#dig: https://bugs.ruby-lang.org/issues/14468
rwb has quit [Ping timeout: 248 seconds]
<baweaver> >>class Object;def dig(*ps) ps.reduce(self){|s,p|s.public_send(p)} end;end; '5'.dig(:to_i, :even?)
<ruby[bot]> baweaver: # => false (https://eval.in/957135)
<baweaver> :D
cagomez has quit [Remote host closed the connection]
bigblind has quit [Ping timeout: 276 seconds]
cagomez has joined #ruby
jeffreylevesque has joined #ruby
Gnut has quit [Read error: Connection reset by peer]
jeffreylevesque has quit [Remote host closed the connection]
jeffreylevesque has joined #ruby
synthroid has joined #ruby
<Han> When you start doing stuff like echo liquid-2.6.3| sed -e 's|\(.*\)-\(.*\)|gem "\1", "=\2"|' >> Gemfile
<Han> you know you're missing something
jeffreylevesque has quit [Ping timeout: 248 seconds]
<Han> bundler update;rm -f /var/redmine/log/thin.*.log; /usr/bin/thin -C /etc/thin/redmine.yml start; cat /var/redmine/log/thin.0.log
hairui has joined #ruby
<Han> And every time yet another missed dependency I have to add to the Gemfile, it's more than 40 lines long by now.
d10n-work has joined #ruby
hairui has quit [Ping timeout: 248 seconds]
synthroid has quit []
nowhereman_ has joined #ruby
aguestuser has quit [Remote host closed the connection]
aguestuser has joined #ruby
Ltem has quit [Quit: good night]
bigblind has joined #ruby
jcalla has quit [Quit: Leaving]
despai has quit [Quit: ...]
jerikl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has quit [Ping timeout: 248 seconds]
Rvampire has joined #ruby
<Rvampire> hii I am sorry I have a quick question..I have a string all upper case. How can I build something that IF a letter is a duplicate..it should lowercase the duplicate letter ?
bigblind has joined #ruby
hairui has joined #ruby
despai has joined #ruby
<Rvampire> ah come on anyone willing to help a vampire ?
<Rvampire> :D
<Rvampire> woah this channel used to be way more fun back in the days
<Rvampire> now everyone got so serious and just ghosting
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
shinnya has joined #ruby
bmurt has joined #ruby
al2o3-cr has joined #ruby
hairui has quit [Ping timeout: 265 seconds]
<Rvampire> this is scary on so many levels
<weaksauce> Rvampire keep track of the last letter and build up a string with it if the last letter == the current letter then downcase it and if not don't
schneide_ has quit [Remote host closed the connection]
<Rvampire> weaksauce thanks! this is the spirit
<miah> no response in ~1 minute. channel is dead. =)
schneide_ has joined #ruby
guacamole has joined #ruby
guacamole has joined #ruby
guacamole has quit [Changing host]
nowhere_man has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
bijan_awaaaay is now known as bijan_
krawchyk has quit [Quit: krawchyk]
drewmcmillan has joined #ruby
tomphp has joined #ruby
drewmcmillan has quit [Client Quit]
drewmcmillan has joined #ruby
hairui has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bigblind has quit [Ping timeout: 268 seconds]
bmurt has joined #ruby
banisterfiend has joined #ruby
hairui has quit [Ping timeout: 256 seconds]
n008f4g_ has quit [Ping timeout: 260 seconds]
mtkd has quit []
roonsauce has quit [Remote host closed the connection]
hairui has joined #ruby
roonsauce has joined #ruby
rwb has joined #ruby
vyorkin has quit [Ping timeout: 265 seconds]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
despai has quit [Quit: ...]
hairui has quit [Ping timeout: 248 seconds]
roshanavand has quit [Ping timeout: 256 seconds]
bijan_ is now known as bijan_awaaaay
bijan_awaaaay has quit [Quit: System has gone to sleep. ZZZzzz…]
roonsauce has quit [Ping timeout: 276 seconds]
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
drewmcmillan has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ruby[bot] has quit [Remote host closed the connection]
bmurt has joined #ruby
ruby[bot] has joined #ruby
bmurt has quit [Client Quit]
bmurt has joined #ruby
bmurt has quit [Client Quit]
raynold has quit [Quit: Connection closed for inactivity]
<zenspider> damn... JUMP TO or I'll declare you all dead
ramfjord has quit [Ping timeout: 256 seconds]
<al2o3-cr> sup zenspider?
<rubycoder38> I'm afraid to die
workmad3 has joined #ruby
milardovich has joined #ruby
<zenspider> Han: perhaps you're adding from the bottom instead of the top? makes it seem like more deps than you need to declare.
<al2o3-cr> rubycoder38: don't wish time away
milardovich has quit [Remote host closed the connection]
<zenspider> al2o3-cr: not much. you?
<rubycoder38> al2o3-cr: ?
Badman703 has joined #ruby
<al2o3-cr> zenspider: cool beans =)
<miah> i am un-dead
<al2o3-cr> rubycoder38: being afraid is wishing time away =)
_aeris_ has quit [Remote host closed the connection]
milardovich has joined #ruby
<rubycoder38> I see
<rubycoder38> al2o3-cr: you mean in the sense that you could be doing something with your time rather than worrying?
<al2o3-cr> rubycoder38: spot on ;)
<rubycoder38> nice, good point
<miah> i wish it were that easy some times
<rubycoder38> al2o3-cr: thanks
<al2o3-cr> no worries :)
_aeris_ has joined #ruby
ramfjord has joined #ruby
banisterfiend has joined #ruby
SkyFire has quit [Ping timeout: 264 seconds]
<al2o3-cr> why worry when you can laugh
banisterfiend has quit [Remote host closed the connection]
<miah> sometimes that is also difficult
workmad3 has quit [Ping timeout: 248 seconds]
starseed0000 has joined #ruby
<al2o3-cr> miah: sometimes...
<al2o3-cr> worrying is what makes people ill.
<al2o3-cr> if this, if that... and so on
<miah> i had my confidence crushed and i didnt touch ruby for a few years. coming back to it i've had to deal with anxiety. its been hard to laugh. but i'm getting better.
jeffreylevesque has joined #ruby
<miah> sorry, kinda offtopic <3
ramfjord has quit [Ping timeout: 248 seconds]
<al2o3-cr> miah: all i can say times a healer and it will get better (no matter how low you are) pinky promise ;)
cliq has quit [Ping timeout: 240 seconds]
<miah> yup. agreed. i had to quit my job and start fresh and now im doing ruby dev full time so i'm healing =)
ianfleeton has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> miah: ruby will bring up your spirits =)
<rubycoder38> last year I worked at a company as a python developer, I was fired for reasons but when I was fired the boss threatened me with actual violence and screamed at me, I still have nightmares to this day
jnollette has quit [Quit: ZNC 1.6.5 - http://znc.in]
ramfjord has joined #ruby
<miah> im sorry that happened, i can relate.
jnollette has joined #ruby
<zenspider> miah: that sucks. :/
bmurt has joined #ruby
bmurt has quit [Client Quit]
<rubycoder38> the good thing is that I recorded all the audio so I can release it anytime I want
<rubycoder38> they better don't annoy the heck of me
<al2o3-cr> rubycoder38: shit happens in life (people can be dicks) sorry about the swearing.
<al2o3-cr> it's a funny old world
<miah> ya it does suck. but im getting better. i just feel like i should have left that job sooner but hindsight..
<al2o3-cr> miah: you in a good place now?
ramfjord has quit [Ping timeout: 268 seconds]
ramfjord has joined #ruby
<miah> yes =)
<miah> doing open source dev on a ruby project
<al2o3-cr> miah: i have no regrets in life and never will. life is for living not existing.
<al2o3-cr> miah: awesome, glad to here that =)
<miah> i get to work on this: https://github.com/chef/inspec
<al2o3-cr> miah: ruby is better than medicine =)
<miah> yes
<rubycoder38> al2o3-cr: I agree, thanks
<al2o3-cr> rubycoder38: :P
<al2o3-cr> miah: keep ya head held high now =)
<miah> ya im trying! my new team is amazing so thats helping quite a bit.
hairui has joined #ruby
ramfjord has quit [Ping timeout: 252 seconds]
<al2o3-cr> miah: around good people it won't be to long
ramfjord has joined #ruby
schneide_ has quit [Remote host closed the connection]
_aeris_ has quit [Ping timeout: 255 seconds]
ghormoon has quit [Ping timeout: 240 seconds]
<miah> agreed. ive been through a lot and i've always been able to get through it. i know i'll get past this too =)
ghormoon has joined #ruby
<al2o3-cr> miah: strong people bounce back (it's true)
<al2o3-cr> it's just takes a little while thats all.
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
netherwolfe has quit [Ping timeout: 268 seconds]
hairui has quit [Ping timeout: 256 seconds]
_aeris_ has joined #ruby
<zenspider> "i have no regrets in life and never will" ?!? seriously?
milardovich has quit [Remote host closed the connection]
bigblind has joined #ruby
<al2o3-cr> zenspider: absolutley.
<rubycoder38> just listen to this every time you are sad: https://www.youtube.com/watch?v=kJa2kwoZ2a4
<al2o3-cr> why regret something, you can't change it.
<al2o3-cr> what is done is done.
konsolebox has quit [Ping timeout: 255 seconds]
<al2o3-cr> enjoy life.
<al2o3-cr> we are not here for a long time
<zenspider> not sure whether to chalk that up to some seriously zen views on life, not having actually lived, or some seriously machismo bullshit.
<al2o3-cr> zenspider: so you have regrets. no big deal. i **DON'T** regret a single thing in life.
<miah> i have plenty of regrets. and while its true you cant change those things, you can use them to influence your future in positive ways.
<al2o3-cr> like a said what's done is done.
AgentVenom has quit [Quit: Textual IRC Client: www.textualapp.com]
<al2o3-cr> move on with life.
<al2o3-cr> i've made a many of wrong choices but do i regret them, no.
<miah> some times its not about the choices you've made, but that others have made and being in the situation involving them
konsolebox has joined #ruby
<al2o3-cr> miah: this goes true for me, but i still don't regret anything
<al2o3-cr> and trust me i *never will* ever
<miah> well im glad for you, but also recognize that others have different experiences and that regret is a thing some of us go through <3
<miah> (im saying this without getting too deep into my history and the absolute bonkers things i've been through in my life)
ramfjord has quit [Ping timeout: 252 seconds]
milardovich has joined #ruby
<al2o3-cr> miah: i totally hear you, without treading in anyone elses footsteps... i leave it there =)
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<al2o3-cr> *i'll
<miah> <3
<al2o3-cr> all i was trying to say life's to short <3 <3
<al2o3-cr> for regrets.
milardovich has quit [Ping timeout: 256 seconds]
ramfjord has joined #ruby
tvw has quit [Remote host closed the connection]