baweaver changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.0, 2.3.3 & 2.2.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
montanonic has quit [Ping timeout: 255 seconds]
pacharanero has quit [Client Quit]
bkxd has quit [Ping timeout: 240 seconds]
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
last_staff has joined #ruby
aspiers has quit [Ping timeout: 268 seconds]
jsownz has quit []
last_staff has quit [Remote host closed the connection]
jdm has quit [Remote host closed the connection]
zeroDi has quit [Quit: WeeChat 1.7]
markholmes has quit [Remote host closed the connection]
dminuoso has quit [Ping timeout: 255 seconds]
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
dminuoso has joined #ruby
montanonic has joined #ruby
<croberts> Radar: is rubybot custom made or is it from a framework out there
* croberts wants to try to make a ircbot w ruby/rails
<Papierkorb> croberts: Rails has not much to do with an IRC bot per se. But there's `cinch`, which is a irc bot building library in Ruby
<baweaver> Just Google Ruby IRC gem
<baweaver> there are several around. I think Cinch and Lita are the leaders
<croberts> cool
<Radar> That's the framework I wrote.
<Radar> cinch is probably better maintained
harai_ has joined #ruby
harai_ has quit [Read error: Connection reset by peer]
montanonic has quit [Ping timeout: 260 seconds]
Sammichmaker has quit [Read error: Connection reset by peer]
<baweaver> So Summer has sunsetted?
<Radar> baweaver: badum tish
<Radar> It Just Works(tm)
* baweaver bows
marxarelli has quit [Read error: Connection reset by peer]
moei has quit [Quit: Leaving...]
hahuang65 has joined #ruby
harai_ has joined #ruby
msg has joined #ruby
msg is now known as Guest6571
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
DaleK5whr has joined #ruby
DaleK5whr has quit [Max SendQ exceeded]
harai_ has quit [Read error: Connection reset by peer]
Guest6571 has quit [Ping timeout: 260 seconds]
jhack has quit [Quit: jhack]
harai_ has joined #ruby
sniffer has joined #ruby
montanonic has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
harai_ has quit [Read error: Connection reset by peer]
coffeejunk has quit [Ping timeout: 240 seconds]
<Radar> Within 4 minutes of me saying "It Just Works", the bot crashed and restarted.
aglorei has quit [Ping timeout: 240 seconds]
sepp2k has quit [Read error: Connection reset by peer]
pilne has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
ur5us has joined #ruby
aglorei has joined #ruby
mwlang has joined #ruby
rindolf has quit [Quit: http://www.shlomifish.org/ ; Yay! I'm a llama again.]
Rodya_ has joined #ruby
_main_ has joined #ruby
pwnd_nsfw` has joined #ruby
jackjackdripper has joined #ruby
__main__ has quit [Read error: Connection reset by peer]
Synthead has quit [Remote host closed the connection]
Cohedrin_ has joined #ruby
gusrub has quit [Remote host closed the connection]
ledestin has joined #ruby
pwnd_nsfw has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Ping timeout: 260 seconds]
_main_ is now known as __main__
<Majost> I have a simple ruby script which comprises of some methods and no classes, for I am trying to write some rspec. The script has a method which checks for the existentence of an ENV key, and if nil raises an error. I am looking on the intarwebs on how to use the `raise_error` stuff, but all the examples I find seem to assume a class instance is created, and
<Majost> I am not sure how to test something like this script in which no class instance exists. How do I go about doing this?
mikecmpbll has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
s2013 has joined #ruby
<Radar> Majost: Can you show us what you have already?
bkxd has joined #ruby
mwlang has quit [Quit: mwlang]
JuliusDelta has joined #ruby
Burgestrand has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
mwlang has joined #ruby
Burgestrand has quit [Client Quit]
__Yiota has joined #ruby
linduxed has joined #ruby
mogaj has joined #ruby
chouhoulis has joined #ruby
mtkd has joined #ruby
montanonic has quit [Ping timeout: 255 seconds]
<Majost> For now, I am trying to suppress the raise at the moment.
<Majost> It seems to raise RuntimeError each time I try to run the spec
nettoweb has joined #ruby
<Majost> I was assuming I can just mock those two things to make it happy.... but there is something I am missing
cagomez has quit [Remote host closed the connection]
<Radar> Majost: Why not use ENV.fetch which has this behaviour already?
mogaj has quit [Ping timeout: 260 seconds]
sjums has quit [Quit: Connection reset by beer]
chouhoulis has quit [Ping timeout: 255 seconds]
dellavg has quit [Ping timeout: 255 seconds]
sjums has joined #ruby
cibs has quit [Ping timeout: 240 seconds]
<Majost> Doesn't `ENV.fetch` assume the variable is set?
camilasan has quit [Remote host closed the connection]
Caius has quit [Ping timeout: 255 seconds]
heftig has quit [Quit: No Ping reply in 180 seconds.]
<Radar> It will raise an error if it's not set. You're literally implementing the same behaviour as ENV.getch.
<Majost> Or do you mean with the method
<Radar> fetch*
<Majost> ah
cagomez has joined #ruby
crayfishx has quit [Ping timeout: 255 seconds]
cjk101010 has quit [Ping timeout: 255 seconds]
heftig has joined #ruby
cibs has joined #ruby
cjk101010 has joined #ruby
Caius has joined #ruby
camilasan has joined #ruby
crayfishx has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dellavg has joined #ruby
xzynx has joined #ruby
mwlang has quit [Quit: mwlang]
nettoweb1 has joined #ruby
mwlang has joined #ruby
Channel6 has joined #ruby
ecuanaso has joined #ruby
tau has quit [Remote host closed the connection]
nettoweb has quit [Ping timeout: 255 seconds]
SteenJobs_ has joined #ruby
<allisio> Why isn't ENV a Hash?
<Majost> It is
br0d1n has joined #ruby
<allisio> Is not.
<allisio> >> ENV.is_a? Hash
ruid_ has joined #ruby
<allisio> It's "hash-like", and I'm trying to make sense of that.
dellavg has quit [Ping timeout: 255 seconds]
<matthewd> It writes to the actual environment variables
camilasan has quit [Quit: No Ping reply in 180 seconds.]
<Majost> huh... `.class` returns 'Object'
<Majost> heh
heftig has quit [Quit: No Ping reply in 180 seconds.]
marxarelli has joined #ruby
camilasan has joined #ruby
heftig has joined #ruby
<allisio> matthewd: Makes sense. Thanks.
<allisio> Still, it could've just had its own #[]=.
dellavg has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<allisio> Radar: ENV.getch: https://eval.in/740740 😂
ujjain has quit [Ping timeout: 252 seconds]
msg has joined #ruby
msg is now known as Guest4073
mwlang has quit [Quit: mwlang]
xzynx has left #ruby [#ruby]
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
Guest4073 has quit [Ping timeout: 260 seconds]
ElDoggo has quit [Ping timeout: 260 seconds]
xall has joined #ruby
tau has joined #ruby
johnzorn has quit [Read error: Connection reset by peer]
johnzorn has joined #ruby
cagomez has quit []
johnzorn has quit [Read error: Connection reset by peer]
nettoweb has joined #ruby
nettoweb1 has quit [Ping timeout: 240 seconds]
mogaj has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has quit [Ping timeout: 240 seconds]
saneax is now known as saneax-_-|AFK
mogaj has quit [Ping timeout: 240 seconds]
Slinky_Pete has quit [Remote host closed the connection]
raspado has quit [Remote host closed the connection]
mim1k has joined #ruby
SteenJobs_ has quit [Quit: SteenJobs_]
johnzorn has joined #ruby
mim1k has quit [Ping timeout: 268 seconds]
jgnagy has joined #ruby
johnzorn has left #ruby [#ruby]
millerti has joined #ruby
AndrewIsHere has joined #ruby
redhedded1 has joined #ruby
jgnagy has quit [Ping timeout: 240 seconds]
AndrewIsHere has quit [Client Quit]
TheMoonMaster has quit [Ping timeout: 276 seconds]
brent__ has quit [Ping timeout: 268 seconds]
Rodya_ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
ruid_ has quit [Quit: Leaving]
_djbkd has quit [Quit: My people need me...]
charliesome has joined #ruby
funnel has quit [Ping timeout: 240 seconds]
ivanskie has quit [Remote host closed the connection]
Rodya_ has quit [Ping timeout: 240 seconds]
sylario has quit [Quit: Connection closed for inactivity]
xall has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
barnett has quit []
cdg has quit [Remote host closed the connection]
aryaching has quit [Ping timeout: 260 seconds]
cdg has joined #ruby
duderonomy has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marr has quit [Ping timeout: 260 seconds]
enterprisey has joined #ruby
_djbkd has joined #ruby
paradisaeidae has joined #ruby
paradisaeidae_ has joined #ruby
xall has joined #ruby
axsuul has joined #ruby
SeepingN has quit [Ping timeout: 260 seconds]
jphase has quit [Read error: Connection reset by peer]
jphase has joined #ruby
blackmes1 has quit [Ping timeout: 260 seconds]
xall has quit [Ping timeout: 240 seconds]
def_jam has joined #ruby
aryaching has joined #ruby
nobitanobi has joined #ruby
eb0t has quit [Ping timeout: 260 seconds]
jackjackdripper has quit [Quit: Leaving.]
eblip has quit [Ping timeout: 268 seconds]
nobitanobi has quit [Ping timeout: 260 seconds]
Slinky_Pete has joined #ruby
agent_white has joined #ruby
_djbkd has quit [Quit: My people need me...]
bovis has joined #ruby
browndawg has joined #ruby
Slinky_Pete has quit [Ping timeout: 240 seconds]
Xentil has joined #ruby
mwlang has joined #ruby
Xentil has quit [Client Quit]
pilne has quit [Quit: Quitting!]
tau has quit [Remote host closed the connection]
mmint has left #ruby ["Leaving"]
AKPWD has quit [Quit: じゃね。]
s2013 has joined #ruby
d^sh has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bkxd has joined #ruby
mwlang has quit [Quit: mwlang]
nettoweb has joined #ruby
Rodya_ has joined #ruby
jtdoncas has quit [Ping timeout: 268 seconds]
tyang has joined #ruby
eblip has joined #ruby
tyang_ has joined #ruby
protti has joined #ruby
xpt has quit [Ping timeout: 276 seconds]
xpt has joined #ruby
ccooke has quit [Ping timeout: 260 seconds]
ccooke has joined #ruby
tyang_ has quit [Read error: Connection reset by peer]
Rodya_ has quit [Ping timeout: 240 seconds]
protti has quit [Remote host closed the connection]
tyang has quit [Ping timeout: 240 seconds]
govg has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
bmurt has joined #ruby
cyphase has quit [Ping timeout: 255 seconds]
Vile` has joined #ruby
browndawg has quit [Ping timeout: 268 seconds]
SteenJobs_ has joined #ruby
sspreitz has quit [Ping timeout: 240 seconds]
hahuang65 has quit [Ping timeout: 260 seconds]
K1WIZ has quit [Quit: Leaving]
sspreitz has joined #ruby
cyphase has joined #ruby
TheMoonMaster has joined #ruby
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
singalaut has quit [Ping timeout: 240 seconds]
JuliusDelta has quit [Quit: Leaving...]
singalaut has joined #ruby
candelabra has joined #ruby
<candelabra> Say I've got a big text file (say 4mb), and I need execute a function once for each column of the file. I need to pass an array of of every character in the current column to the function. What's an efficient way to do this?
<Nilium> Are the characters all ASCII?
jackjackdripper has joined #ruby
<Radar> Is this file a CSV?
__Yiota has joined #ruby
mrgrieve1 has joined #ruby
browndawg has joined #ruby
BabyMario has joined #ruby
jenrzzz has joined #ruby
mrgrieves has quit [Ping timeout: 260 seconds]
mogaj has joined #ruby
cyphase has quit [Ping timeout: 240 seconds]
<baweaver> candelabra: break the functions into terms where they can operate on a single item
<baweaver> then just iterate the rows and independently transform each one with the single-item function
<baweaver> though real code helps to adjust for context
<candelabra> this is not a csv
mogaj has quit [Ping timeout: 240 seconds]
cyphase has joined #ruby
<candelabra> each line resembles: Underscored_word_here ?10001010101?10001?101010... (but length is 80,000+)
<candelabra> basically all the lines of ?100101?? together represent a matrix
TheWhip has quit [Remote host closed the connection]
<candelabra> baweaver, that approach seems like it would end up storing a lot in memory, almost the entire file
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
<candelabra> it may be the files end up being much bigger than 4mb
mim1k has joined #ruby
<baweaver> you're going to have to be a bit more descriptive with what transformations you're trying to do here
<baweaver> because it sounds a lot like you want Linear Algebra
<baweaver> remember that we have no idea what you're working on so we tend to answer very generically.
skweek has joined #ruby
<candelabra> so if you think of the file as a big matrix of 0?10010 (only ?, 0, and 1), with each row having a label, then what I need to do is, for each column in the matrix, is write a line to a new file that orders the column labels according to the 0, ?, or 1 in that specific matrix space... I'll create a gist
hahuang65 has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
EV3RYDAYPR0GRESS has quit [Read error: Connection reset by peer]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
EV3RYDAYPR0GRESS has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
cdg has quit [Remote host closed the connection]
arescorpio has joined #ruby
marxarelli is now known as marxarelli|afk
crankharder has quit [Quit: leaving]
crankharder has joined #ruby
govg has joined #ruby
br0d1n has quit [Quit: Leaving]
<candelabra> I guess one specific question I have is if there is a way in ruby to get the character from a certain position (line, column) in a text file
<candelabra> aside from file.split(/\n/)[row][col]
<nofxx> candelabra, I would do File.open().lines.map {}
<nofxx> a a def parse_line to receive each... just write to a file after
<candelabra> as of now I'm incrementally writing to the file after each column
<nofxx> candelabra, just change #map with #each and write after each line
<nofxx> inside the loop
nowhereman has joined #ruby
<nofxx> have a need for that? problaly faster going all to ram and flushing to disk in the end I imagine
<candelabra> but i'm just doing array = file.split(), and then array.each{|line| #write what i want }
opt9 has quit [Ping timeout: 240 seconds]
<candelabra> well I had originally it all in ram, but it crashed the guys pc when he tried to run it w/ a bigger file, may have been multiple gb
<baweaver> If you're getting into multiple GB files you might consider going with something like Rust or Go
<baweaver> If it gets into 100s of GBs, Spark.
<candelabra> thanks
Rodya_ has joined #ruby
<candelabra> i'll suggest that
<baweaver> Ruby doesn't do so hot after a few hundred megs of data in memory
<nofxx> but won't that be a matter of physical ram rather than lang? will need to work in chunks anyway
<nofxx> you can read a file with pointer in ruby no? [from, to] limited thing?
<baweaver> It will, but other languages tend to deal with that a bit better
<nofxx> and that being needed (work in chunks) won't ruby be the easiest to get ir running?
<nofxx> heheh =D
<candelabra> this is sort of a proof of concept at the moment for a larger thing he's writing a paper on
<candelabra> the script isn't the subject, it's the output that is the subject
<baweaver> &ri IO
<nofxx> nevermind, just write it in C
* baweaver doesn't feel like Googling
<baweaver> binread may work for partial reads
<candelabra> binread looks like a possibility
Rodya_ has quit [Ping timeout: 240 seconds]
<baweaver> File inherits from IO
<baweaver> binread / read
<allisio> Regular #read can do partial reads just fine.
<al2o3-cr> yep it can
braincrash has quit [Quit: bye bye]
rakm has joined #ruby
noan has quit [Read error: Connection reset by peer]
noan has joined #ruby
<allisio> candelabra: I think you think you want #seek and #getc, but you really don't.
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Moosashi has joined #ruby
Moosashi has quit [Client Quit]
nowhereman has quit [Ping timeout: 260 seconds]
bovis has quit [Quit: leaving]
Tech has joined #ruby
EV3RYDAYPR0GRESS has quit [Ping timeout: 240 seconds]
<candelabra> allisio, maybeso, are you saying I don't because it will have a negative affect on performance?
tau has joined #ruby
<candelabra> allisio, really I'm just curious to attempt different approaches
Slinky_Pete has joined #ruby
antoniobeyah has quit [Quit: Connection closed for inactivity]
<candelabra> I'm just wondering if I know the size of the matrix, if I can just for() and then use something like IO.read(, pos) to get the space in the matrix I want
<candelabra> and if that would be better than storing a bunch of things in memory
Tech has quit [Ping timeout: 240 seconds]
swistak35 has quit [Ping timeout: 240 seconds]
Slinky_Pete has quit [Ping timeout: 260 seconds]
jtdoncas has joined #ruby
electrostat has quit [Quit: uwotm8]
electrostat has joined #ruby
cibs has quit [Ping timeout: 260 seconds]
jtdoncas has quit [Ping timeout: 240 seconds]
hays has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
<allisio> candelabra: See above. :P
<allisio> It sounds suspiciously like you *want* to use a flat-file database, which is a special breed of masochistic.
<allisio> Consider finding a more efficient representation of your data, then stick them in a database for saner querying/processing.
opt9 has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<candelabra> allisio, unfortunately that's way outside the scope
<candelabra> the task was "here is this format of file, can you make it into this other format with a script for me?"
<candelabra> I've got it working, I was just curious if there was a more efficient way
DTZUZO has quit [Quit: WeeChat 1.5]
bkxd has joined #ruby
Mia has quit [Ping timeout: 268 seconds]
<allisio> candelabra: That's new information; at the outset, you indicated that you *needed* a more performant solution in order to process your actual inputs.
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
<allisio> In any case, I'm glad you got it sorted. I suspect I'm not the only one who'd be willing to nitpick your current code if you'd be willing to post it. :)
Cogitabundus has joined #ruby
Cogitabundus has quit [Max SendQ exceeded]
<candelabra> sorry I was unclear, what I meant by "I need to execute a function once for each column of this big text file" was that I have a file and I need to use the data in each column
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<allisio> Are all your columns of equal width?
xall has joined #ruby
<candelabra> I'll post a git here in a second
Cogitabundus has joined #ruby
Cogitabundus has quit [Max SendQ exceeded]
<candelabra> yes
Cogitabundus has joined #ruby
<candelabra> like an m*n matrix
<allisio> #tranpose would fit the bill very nicely if you didn't have so much data.
<candelabra> thats what I was thinking, although the matrix is offset by the column labels so that would be tricky
<candelabra> i'll post a gist, I'm just going to add some comments
TheWhip has joined #ruby
gix has quit [Ping timeout: 260 seconds]
xall has quit [Ping timeout: 240 seconds]
gix has joined #ruby
BabyMario has left #ruby ["bbl"]
Cogitabundus has quit [Read error: Connection reset by peer]
Cogitabundus has joined #ruby
Cogitabundus has quit [Max SendQ exceeded]
<candelabra> allisio, nitpick away
interki has quit [Ping timeout: 260 seconds]
brent__ has joined #ruby
browndawg has quit [Quit: Leaving]
arch___ has joined #ruby
paradisaeidae_ has quit [Quit: ChatZilla 0.9.93 [Firefox 51.0.1/20170125094131]]
paradisaeidae has quit [Quit: ChatZilla 0.9.93 [Firefox 51.0.1/20170125094131]]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xall has joined #ruby
braincrash has joined #ruby
arch___ has quit [Ping timeout: 240 seconds]
Slinky_Pete has joined #ruby
SteenJobs_ has quit [Quit: SteenJobs_]
Slinky_Pete has quit [Ping timeout: 255 seconds]
wilbert has joined #ruby
gnufied has quit [Ping timeout: 240 seconds]
Sammichmaker has joined #ruby
Channel6 has quit [Quit: Leaving]
khaki has quit [Quit: WeeChat 1.7]
<allisio> candelabra: Apologies for the delay. I went ahead and refactored: https://eval.in/740778
<allisio> It's a pretty thoroughly different approach, but do you see how to proceed from there?
enterprisey has quit [Read error: Connection reset by peer]
s2013 has joined #ruby
arescorpio has quit [Quit: Leaving.]
TheWhip has quit [Read error: Connection reset by peer]
TheWhip_ has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
squ has joined #ruby
_whitelogger has joined #ruby
mim1k has joined #ruby
benlieb has quit [Quit: benlieb]
brent__ has quit [Remote host closed the connection]
nowhereman has joined #ruby
cschneid_ has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 268 seconds]
renchan has joined #ruby
jgnagy has joined #ruby
saneax-_-|AFK is now known as saneax
mim1k has joined #ruby
jgnagy has quit [Ping timeout: 260 seconds]
xall has quit [Remote host closed the connection]
xall has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
benlieb has joined #ruby
tau has quit [Remote host closed the connection]
howdoi has joined #ruby
Rodya_ has joined #ruby
anisha has joined #ruby
Rodya_ has quit [Ping timeout: 255 seconds]
msg has joined #ruby
msg is now known as Guest6663
mradmacher has joined #ruby
davezd has joined #ruby
Vile` has quit [Ping timeout: 240 seconds]
ecuanaso has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
xen0fon has quit [Ping timeout: 268 seconds]
patarr has joined #ruby
amclain has quit [Quit: Leaving]
markholmes has joined #ruby
tildes has joined #ruby
Guest6663 has quit [Remote host closed the connection]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has quit [Ping timeout: 268 seconds]
nobitanobi has joined #ruby
watersoul has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
Cohedrin_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
nobitanobi has quit [Ping timeout: 240 seconds]
JoshS has joined #ruby
User458764 has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
TheWhip_ has quit [Read error: Connection reset by peer]
TheWhip has joined #ruby
jenrzzz has joined #ruby
rippa has joined #ruby
xen0fon has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
Cohedrin has joined #ruby
Qchmqs has joined #ruby
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Definity2 has quit [Ping timeout: 240 seconds]
rakm has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 240 seconds]
minimalism has quit [Ping timeout: 260 seconds]
last_staff has joined #ruby
mogaj has joined #ruby
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
dionysus69 has joined #ruby
nowhereman has quit [Quit: Konversation terminated!]
nowhereman has joined #ruby
AnoHito has quit [Ping timeout: 260 seconds]
Vile` has joined #ruby
djbkd has quit [Remote host closed the connection]
djbkd has joined #ruby
nowhereman has quit [Quit: Konversation terminated!]
nowhereman has joined #ruby
User458764 has joined #ruby
User458764 has quit [Client Quit]
xen0fon has quit [Quit: xen0fon]
xen0fon1 has joined #ruby
wilbert has quit [Quit: WeeChat 1.7]
bocaneri has joined #ruby
xen0fon1 has quit [Client Quit]
msg has joined #ruby
reverberations has joined #ruby
msg is now known as Guest68033
mwlang has joined #ruby
benlieb has quit [Quit: benlieb]
djbkd has quit [Ping timeout: 268 seconds]
xen0fon has joined #ruby
Slinky_Pete has joined #ruby
Anonymoose2 has quit [Ping timeout: 268 seconds]
Vile` has quit [Read error: Connection reset by peer]
Slinky_Pete has quit [Ping timeout: 255 seconds]
s0l__ has quit [Ping timeout: 252 seconds]
s0l__ has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
mwlang has quit [Quit: mwlang]
Guest68033 has quit [Remote host closed the connection]
mwlang has joined #ruby
User458764 has joined #ruby
charliesome has joined #ruby
<dionysus69> hello all
<dionysus69> I get error with this line output = UniMIDI::Output.open(:first). same happened on not just unimidi but just midi or micromidi gems.
mwlang has quit [Quit: mwlang]
bkxd has quit [Ping timeout: 260 seconds]
andikr has joined #ruby
mwlang has joined #ruby
jdm has joined #ruby
Tharbakim has quit [Read error: Connection reset by peer]
jenrzzz has quit [Ping timeout: 255 seconds]
milardovich has joined #ruby
braincrash has quit [Ping timeout: 260 seconds]
Tharbakim has joined #ruby
tildes has quit [Ping timeout: 255 seconds]
padi_ has quit []
mwlang has quit [Quit: mwlang]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
nertzy has quit [Ping timeout: 240 seconds]
conta has joined #ruby
TheWhip has quit [Remote host closed the connection]
<kke> i wonder if i could create a custom build option for a gem to overwrite the shebang in executables, something like the --with-mysql in mysql2 gem
<kke> such as gem build/install foofoo --with-ruby=/usr/local/bin/ruby
milardovich has quit [Ping timeout: 268 seconds]
milardovich has joined #ruby
<kke> let's see.
jgnagy has joined #ruby
nOwz has joined #ruby
neuraload has joined #ruby
sonne has quit [Quit: ZNC - http://znc.in]
opt9 has quit [Ping timeout: 260 seconds]
Silthias has quit [Ping timeout: 260 seconds]
cschneid_ has joined #ruby
TheWhip has joined #ruby
TheWhip has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
sonne has joined #ruby
hays has quit [Read error: Connection reset by peer]
markholmes has quit [Quit: Leaving]
cschneid_ has quit [Ping timeout: 240 seconds]
aganov has joined #ruby
aryaching_ has joined #ruby
Mortomes|Work has joined #ruby
Silthias has joined #ruby
hays has joined #ruby
hays has joined #ruby
hays has quit [Changing host]
opt9 has joined #ruby
kernelPaniq has joined #ruby
msg has joined #ruby
msg is now known as Guest71432
aryaching has quit [Ping timeout: 260 seconds]
aufi has joined #ruby
matcouto has joined #ruby
jcao219 has joined #ruby
Rodya_ has joined #ruby
andikr has quit [Remote host closed the connection]
<alex``> how convert string to regex?
toretore has joined #ruby
<alex``> '/foo/i' to /foo/i
<kke> Regex.new(string)
andikr has joined #ruby
<alex``> will produce /\/foo\/i/ regex
<alex``> not /foo/i regex
<kke> Regexp.new i mean
<kke> but yes it seems to escape /
<alex``> i have to parse the string myself?
josealobato has joined #ruby
<kke> Regexp.compile(string) maybe
<kke> nope
<alex``> currently i have something like that
rakm has joined #ruby
<alex``> def to_r
Rodya_ has quit [Ping timeout: 240 seconds]
<alex``> Regexp.new *begin
<alex``> scan(%r[/(?<string>.+)/(?<options>[#{Regexp::OPTIONS.keys.join}]+)]).map do |match|
<alex``> [ match['string'], match['options'].chars.uniq.inject(0) { |kcode, option| kcode + Regexp::OPTIONS[option] } ]
<alex``> end.first
<alex``> end rescue
<alex``> [self]
<alex``> end
<alex``> end
<alex``> with regex option to OPTIONS = { 'x' => Regexp::EXTENDED, 'i' => Regexp::IGNORECASE, 'm' => Regexp::MULTILINE, 'n' => Regexp::NOENCODING, }
<alex``> want 'foo' → /foo/
<Zarthus> please use a pastebin for pasting code
charliesome_ has joined #ruby
<alex``> Zarthus: oki
Guest71432 has quit [Remote host closed the connection]
ur5us has joined #ruby
<kke> not pastebin, isn't that frowned upon too
<alex``> but '/foo/gi' → /foo/gi
<kke> gists are preferred
<Zarthus> kke: hence "a pastebin", :)
<kke> right
<alex``> what mean frowned?
<kke> the channel does not like pastebin.com or whatever that is
milardovich has quit [Remote host closed the connection]
aryaching_ has quit [Ping timeout: 240 seconds]
charliesome_ has quit [Client Quit]
<alex``> why?
<kke> the display is super ugly
braincrash has joined #ruby
charliesome has quit [Ping timeout: 260 seconds]
<ruby[bot]> herwin: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<herwin> alex``: ^^
<User458764> Hi how to display in CLI an Array or Hash with human readable display (indentation and breakline)
<kke> User458764: there's pp. require 'pp'; pp hash
<kke> pp = pretty print
<User458764> kke thanks
<kke> not very pretty still.
haxrbyte has joined #ruby
tvw has joined #ruby
<alex``> why stri.scan doesn’t handle groups?
<alex``> would like scan being this default https://gist.github.com/alexherbo2/5f080fb4015289188464
xall_ has joined #ruby
charliesome has joined #ruby
xall has quit [Ping timeout: 260 seconds]
tonini has joined #ruby
blaxter has joined #ruby
singalaut has quit [Remote host closed the connection]
singalaut has joined #ruby
rafadc has joined #ruby
matcouto has quit [Quit: Textual IRC Client: www.textualapp.com]
iqiqwi has joined #ruby
bkxd has joined #ruby
matcouto has joined #ruby
charliesome_ has joined #ruby
def_jam is now known as eb0t
patarr has joined #ruby
TomyWork has joined #ruby
milardovich has joined #ruby
TheWhip has joined #ruby
<hays> I am updating my gems and I am getting this error saying did_you_mean requires ruby >=2.4.0dev
<hays> is that supposed to be happening?
aryaching has joined #ruby
charliesome has quit [Ping timeout: 240 seconds]
patarr has quit [Ping timeout: 255 seconds]
haxrbyte has quit [Remote host closed the connection]
nobitanobi has joined #ruby
haxrbyte has joined #ruby
mark_66 has joined #ruby
Lyubo1 has joined #ruby
Burgestrand has joined #ruby
mogaj has quit [Remote host closed the connection]
haxrbyte has quit [Remote host closed the connection]
haxrbyte has joined #ruby
sarbs has quit [Ping timeout: 240 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
nicltest has joined #ruby
mogaj has joined #ruby
nicltest has quit [Remote host closed the connection]
sarbs has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
nofxxx has joined #ruby
troulouliou_div2 has joined #ruby
interki has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
milardov_ has joined #ruby
nofxx has quit [Ping timeout: 260 seconds]
aupadhye has joined #ruby
TomyWork has joined #ruby
milardovich has quit [Ping timeout: 255 seconds]
Pumukel has joined #ruby
xen0fon has quit [Ping timeout: 268 seconds]
teclator has joined #ruby
Slinky_Pete has joined #ruby
sami has joined #ruby
sami has left #ruby [#ruby]
msg has joined #ruby
msg is now known as Guest31912
Slinky_Pete has quit [Ping timeout: 268 seconds]
larcara has joined #ruby
AnoHito has joined #ruby
Rodya_ has joined #ruby
arch___ has joined #ruby
arch___ has quit [Excess Flood]
gloscombe_ has joined #ruby
arch___ has joined #ruby
arch___ has quit [Excess Flood]
conta has quit [Quit: conta]
interki has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Ping timeout: 260 seconds]
josealobato has quit [Ping timeout: 260 seconds]
interki has joined #ruby
mikecmpbll has joined #ruby
Noxid_ has quit [Quit: Oops. My brain just hit a bad sector]
gloscombe_ has quit [Quit: gloscombe_]
tomphp has joined #ruby
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
bkxd has quit [Ping timeout: 260 seconds]
tomphp has quit [Client Quit]
anonymus has joined #ruby
<anonymus> hi
yeticry_ has joined #ruby
al2o3-cr has quit [Ping timeout: 268 seconds]
conta has joined #ruby
<anonymus> guys please tell me some cheap way to delete several strings from some text beginning from X substring and to Y substring
<anonymus> like delete_all_between('BEGIN', 'END')
nettoweb has joined #ruby
falconer has joined #ruby
<dminuoso> anonymus: gsub(/BEGIN(.*)END/, "") ?
mim1k has joined #ruby
User458764 has joined #ruby
<anonymus> maybe. I'll try. thanks
Xiti has quit [Quit: Xiti]
yeticry has quit [Ping timeout: 268 seconds]
jlebrech has joined #ruby
biberu has joined #ruby
milardov_ has quit [Remote host closed the connection]
Guest31912 has quit [Remote host closed the connection]
tomphp has joined #ruby
<Cork> i'm trying to run a command through Net::SSH, the command doesn't respect --color=always
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
<Cork> anyone know if there is a way to get the color to not be stripped in that case?
mtkd has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
mtkd has joined #ruby
interki has quit [Quit: Going offline, see ya! (www.adiirc.com)]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Silthias1 has joined #ruby
<falconer> I don't know anything about Net:SSH, but for some use-cases, I'd look at setting the color yourself. The low hanging branch there is Fazibear's Colorize gem.
troulouliou_div2 has quit [Quit: Leaving]
Silthias has quit [Ping timeout: 240 seconds]
ifctj has joined #ruby
Silthias has joined #ruby
jgnagy has quit [Remote host closed the connection]
Silthias2 has joined #ruby
troulouliou_div2 has joined #ruby
Silthias1 has quit [Ping timeout: 260 seconds]
sylario has joined #ruby
<Cork> falconer: the command colors things based on if it is an error or things like that
<Cork> i can't really colorize it my self in all cases as some of the state isn't in the pure text
ddffg has quit [Ping timeout: 240 seconds]
nowhereman has quit [Ping timeout: 260 seconds]
milardovich has quit [Remote host closed the connection]
Silthias has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
cibs has quit [Ping timeout: 240 seconds]
ifctj has quit [Ping timeout: 255 seconds]
cibs has joined #ruby
charliesome_ has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
charliesome has quit [Ping timeout: 260 seconds]
Puffball has quit [Quit: No Ping reply in 180 seconds.]
<kke> Cork: maybe the TERM is not something that supports colors?
Puffball has joined #ruby
charliesome_ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<Cork> kke: sshv1, not the current v4.x
<Cork> yes there are a ton of features for the very old v1 and v2
<Cork> current net::ssh http://net-ssh.github.io/net-ssh/
ddffg has joined #ruby
jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
Beams has joined #ruby
mogaj has quit [Remote host closed the connection]
haxrbyte has quit [Read error: Connection reset by peer]
haxrbyte has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mogaj has joined #ruby
aryaching_ has joined #ruby
aryaching has quit [Ping timeout: 240 seconds]
guardian has joined #ruby
psychicist__ has joined #ruby
blackmes1 has joined #ruby
<guardian> hello, what is more idiomatic in Ruby? "foo".match(/bar/) or /bar/.match("foo")
hays has quit [Remote host closed the connection]
msg has joined #ruby
<falconer> Guardian: I'd have expected the former.
msg is now known as Guest22659
mwlang has joined #ruby
squ has quit [Read error: Connection reset by peer]
squ has joined #ruby
squ has quit [Remote host closed the connection]
ur5us has quit [Remote host closed the connection]
aryaching has joined #ruby
ferr1 has joined #ruby
aryaching_ has quit [Ping timeout: 240 seconds]
aryaching_ has joined #ruby
jameser has joined #ruby
workmad3 has joined #ruby
psychicist__ has quit [Remote host closed the connection]
<dminuoso> guardian: the former.
<dminuoso> Though they are not the same if memory serves right.
<dminuoso> There's a subtle difference with respect to.. things.
aryaching has quit [Ping timeout: 240 seconds]
psychicist__ has joined #ruby
mwlang has quit [Quit: mwlang]
bkxd has joined #ruby
mwlang has joined #ruby
interki has joined #ruby
coffeejunk has joined #ruby
gregf_ has quit [Quit: Page closed]
itarato has joined #ruby
vuoto has joined #ruby
jcao219 has quit [Ping timeout: 260 seconds]
dasher00 has quit [Ping timeout: 240 seconds]
mwlang has quit [Quit: mwlang]
psychicist__ has quit [Quit: leaving]
<anonymus> mystring = "XXXXXXXXXXX\n;; begin domain\naosdasdaofafaf\n;; end domain\nYYYYY"
<anonymus> mystring.gsub(/begin(.*)end/, "")
<anonymus> => "XXXXXXXXXXX\n;; begin domain\naosdasdaofafaf\n;; end domain\nYYYYY"
<anonymus> wtf
<anonymus> ?
patarr has joined #ruby
bigkevmcd has joined #ruby
dionysus70 has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
dionysus70 is now known as dionysus69
blackwind_123 has quit [Ping timeout: 260 seconds]
braincrash has quit [Ping timeout: 260 seconds]
ledestin has quit [Quit: Textual IRC Client: www.textualapp.com]
<herwin> mystring.gsub(/begin(.*)end/m, "")
<herwin> to enable multiline regex
patarr has quit [Ping timeout: 240 seconds]
<dminuoso> guardian: actually nevermind. the difference is only relevant when you use =~
<dminuoso> (i.e. str =~ regex is subtly different from regexp =~ str)
nettoweb has quit [Ping timeout: 255 seconds]
blackmesa has joined #ruby
<anonymus> dminuoso: bingo!
<anonymus> thats it/ thank you
marr has joined #ruby
blackmes1 has quit [Ping timeout: 268 seconds]
dasher00 has joined #ruby
psychicist__ has joined #ruby
ecuanaso has joined #ruby
Slinky_Pete has joined #ruby
troulouliou_div2 has quit [Quit: Leaving]
<guardian> dminuoso: what subtle differnce would that be?
<guardian> and thanks for the reply falconer & dminuoso
<falconer> :thumbsup:
cibs has quit [Ping timeout: 260 seconds]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
nettoweb has joined #ruby
cibs has joined #ruby
Slinky_Pete has quit [Ping timeout: 240 seconds]
<dminuoso> guardian: if regex has named captures, then regex =~ str will expose these named captures in local variables.
<dminuoso> for example: /(?<foo>.*/ =~ "quux"; puts foo #=> "quux
mogaj has quit [Remote host closed the connection]
pandaant has joined #ruby
xall_ has quit [Ping timeout: 255 seconds]
<guardian> what's the proper way to loop over matches?
<dminuoso> guardian: What do you mean by loop?
mogaj has joined #ruby
<guardian> I know the string contains multiple matches
<dminuoso> guardian: use String#scan
<dminuoso> &ri String#scan
<guardian> is #scan what Rubular likely uses?
<dminuoso> I have no idea.
<guardian> k
jameser has quit [Ping timeout: 240 seconds]
mogaj has quit [Remote host closed the connection]
User458764 has joined #ruby
devyn has quit [Ping timeout: 240 seconds]
mogaj has joined #ruby
bruce_lee has joined #ruby
jcao219 has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
TheWhip has quit [Read error: Connection reset by peer]
TheWhip has joined #ruby
noan has quit [Remote host closed the connection]
ecuanaso has quit [Quit: Textual IRC Client: www.textualapp.com]
noan has joined #ruby
Fernando-Basso has joined #ruby
d^sh has quit [Ping timeout: 240 seconds]
Lord_of_Life has quit [Excess Flood]
d^sh has joined #ruby
watersoul has joined #ruby
TheWhip has quit [Remote host closed the connection]
Lord_of_Life has joined #ruby
Guest22659 has quit [Remote host closed the connection]
msg has joined #ruby
Rodya_ has joined #ruby
mogaj has quit [Remote host closed the connection]
flying has joined #ruby
msg is now known as Guest17266
mogaj has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
cibs has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
cibs has joined #ruby
Rodya_ has quit [Ping timeout: 255 seconds]
opt9 has quit [Quit: Bye bye]
prestorium has quit [Ping timeout: 255 seconds]
vasilakisfil has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
<vasilakisfil> how can you have a class called like that Foobar[:something] ? I saw rails 5 migrations have something like that and I am wondering how you can build it and how you can use it
sarbs has quit [Ping timeout: 240 seconds]
arup_r has joined #ruby
<toretore> >> class Foobar; def self.[](key); key; end; end; Foobar[:something]
<ruby[bot]> toretore: # => :something (https://eval.in/740937)
nowhereman has joined #ruby
<arup_r> I have 1 style guide question. How do you write this long arithmetic expression in your codebase? https://gist.github.com/aruprakshit/c44553a41659c1b548c9f3d989e2119a
opt9 has joined #ruby
<toretore> first of all, lose the selfs
sarbs has joined #ruby
patarr has joined #ruby
<arup_r> ok
shwouchk has joined #ruby
<toretore> how many of your values are actually floats?
mim1k has quit [Ping timeout: 260 seconds]
<vasilakisfil> toretore do you find any practical use of it ?
patarr has quit [Ping timeout: 268 seconds]
Guest17266 has quit [Remote host closed the connection]
braincrash has joined #ruby
<arup_r> all the columns are float
TheWhip has joined #ruby
prestorium has joined #ruby
jaruga______ has joined #ruby
jaruga______ is now known as jaruga
<guardian> it seems I can't mix named and unnamed capture groups in a regex, is this expected?
<toretore> arup_r: then why are you doing to_f all over the place?
<arup_r> because sometimes they are nil
<toretore> and nil is the same as 0.0?
jcao219 has quit [Ping timeout: 240 seconds]
<arup_r> no.
<arup_r> but adding 0.0 will not change result, so I did that way. Just to avoid error, I added .to_f method to all of them
<toretore> >> /(?<name>.)(.)/
<ruby[bot]> toretore: # => /(?<name>.)(.)/ (https://eval.in/740939)
<arup_r> because any of them can be `nil`
<arup_r> what is that? ^ :D
<guardian> I'm getting Numbered backref/call is not allowed. (use name).
<toretore> where?
<guardian> when trying to match a previous group and regexp contains both named and unnamed groups
<toretore> code?
<vasilakisfil> which one would you use in your code? STATES = [:intro, :connect, :download, :buy].freeze or STATES = [:intro, :connect, :download, :buy].map(&:freeze).freeze
braincrash has quit [Ping timeout: 240 seconds]
<toretore> :intro.freeze is meaningless
<vasilakisfil> toretore because :freeze is a symbol ?
<toretore> yes
<vasilakisfil> sorry I meant :intro
<vasilakisfil> ok
<toretore> symbols are immutable
mim1k has joined #ruby
<vasilakisfil> but the thing is that I have more complex constants like arrays of hashes
<vasilakisfil> should I freeze everything recursively ?
<toretore> well then use real code in your examples
<vasilakisfil> no I meant I also have more complex constants
<ruby[bot]> guardian: # => /tmp/execpad-0e58f4798fdc/source-0e58f4798fdc:2: numbered backref/call is not allowed. (use name): / ...check link for more (https://eval.in/740941)
<guardian> >> "---- x ----".scan(/(?<sep>-{4,})(.*?)(\1)/)
nowhereman has quit [Ping timeout: 260 seconds]
<guardian> >> "---- x ----".scan(/(-{4,})(.*?)(\1)/)
<ruby[bot]> guardian: # => [["----", " x ", "----"]] (https://eval.in/740943)
<vasilakisfil> toretore like this one: https://eval.in/private/a481b64edc68dc does it make sense to go through the items and freeze them ?
aryaching_ has quit [Ping timeout: 268 seconds]
<toretore> arup_r: i don't really see anything wrong with it then; depending on what exactly the domain is, you could refactor parts of it
<dminuoso> vasilakisfil: a class is just an object
<dminuoso> >> foo = Class.new
<arup_r> toretore: yes that is what I am thinking ..
<toretore> vasilakisfil: i wouldn't bother
<arup_r> but thanks for your reviewing my gist
<dminuoso> 12:08 < vasilakisfil> how can you have a class called like that Foobar[:something] ? I saw rails 5 migrations have something like that and I am wondering how you can build it and how you can use it
Macaveli has joined #ruby
<dminuoso> vasilakisfil: Foremost "Foobar" is just a constant.
<vasilakisfil> I see
jgnagy has joined #ruby
<dminuoso> vasilakisfil: If it points at a class, then even that class can have methods
<dminuoso> Those are commonly called class methods
<toretore> guardian: it would be better if you explained what you're trying to achieve
charliesome has joined #ruby
<guardian> toretore: using back references in a regexp that contains both named and unnamed groups
go|dfish has joined #ruby
<guardian> toretore: it seems as soon as 1 of the groups is named, all back references must refer to named groups
arup_r has quit []
fusta has joined #ruby
jgnagy has quit [Ping timeout: 255 seconds]
<toretore> guardian: is that a problem?
<guardian> it's a discovery :)
cajone has left #ruby [#ruby]
psychicist__ has quit [Ping timeout: 255 seconds]
ldnunes has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
Mortomes|Work has quit [Ping timeout: 260 seconds]
milardovich has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
candelabra has quit [Quit: Leaving]
Mortomes|Work has joined #ruby
milardovich has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
JeanCarloMachado has joined #ruby
JoshS has quit [Ping timeout: 260 seconds]
ifctj has joined #ruby
bkxd has joined #ruby
falconer has quit [Ping timeout: 240 seconds]
JoshS has joined #ruby
nobitanobi has quit [Remote host closed the connection]
cajone has joined #ruby
braincrash has joined #ruby
nofxxx has quit [Ping timeout: 260 seconds]
jespada has joined #ruby
jameser has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
psychicist__ has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
slima has joined #ruby
funnel has joined #ruby
jameser has joined #ruby
mitt3ns has joined #ruby
bkxd_ has joined #ruby
msg has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
msg is now known as Guest45695
jameser has quit [Client Quit]
jameser has joined #ruby
aglorei has quit [Ping timeout: 240 seconds]
Kug3lis has joined #ruby
agent_white has quit [Ping timeout: 240 seconds]
aglorei has joined #ruby
ifctj has quit [Ping timeout: 240 seconds]
<slima> Hello, I'm totaly noob in ruby, but I like to write script: call for database and puts data to std in order: username -> first: mac,serial sec: mac,serial etc.. this is my code: https://gist.github.com/slima/86725888483249e04a49f532fa3cce74 for now its working wrong (output is in end of the file) can you give me any hint? I'm totaly lost.
stamina has joined #ruby
govg has quit [Ping timeout: 260 seconds]
ta has quit [Read error: Connection reset by peer]
ta has joined #ruby
SteenJobs_ has joined #ruby
<neoncortex> qq
<neoncortex> err, sory =D
mogaj has quit [Remote host closed the connection]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Slinky_Pete has joined #ruby
<dminuoso> Slinky_Pete: I can give you a hint
<dminuoso> slima: I mean.
<dminuoso> slima: Start with telling us *what* is wrong. What did you expect instead?
last_staff has quit [Quit: last_staff]
alibby has joined #ruby
gsilva has joined #ruby
govg has joined #ruby
skweek has quit [Ping timeout: 240 seconds]
gsilva has quit [Client Quit]
gsilva has joined #ruby
<neoncortex> dminuoso: i think i find why my ruby was crashing yesterday, and it's my fault, as usual ..
<dminuoso> neoncortex: Tell me, what was it?
Slinky_Pete has quit [Ping timeout: 240 seconds]
<neoncortex> dminuoso: in a loop, i was sometimes assign a value to a variable, sometimes dont, but verifying their value in each iteration
<dminuoso> neoncortex: Were you doing that in C code?
<dminuoso> If not, it's definitely NOT you.
<neoncortex> since i fixed it ( the variable have a proiper value in all iteration), the crash's seems to stopped
<dminuoso> neoncortex: Can you unfix it please.
<dminuoso> You just avoid a bug.
<dminuoso> neoncortex: A ruby crash screen is without exception always an internal bug. Unless you are writing a native extensions, it's _not_ your fault.
<neoncortex> dminuoso: do you think i just tricked the interpreter?
<dminuoso> neoncortex: Yes.
<dminuoso> I dont think it, Im absolutely sure in fact.
<dminuoso> You should *never* be able to trigger that bug splat screen in Ruby.
<neoncortex> i see
nickjj has quit [Read error: Connection reset by peer]
<dminuoso> neoncortex: how large is your code and can it be shared?
nickjj has joined #ruby
<dminuoso> are you able to extract a test case?
<neoncortex> dminuoso: +- 1700 lines at the moment, and it's in github: https://github.com/neoncortex/poor-man-s-bookmark, it is a bookmarking tool i'm starting to write
<dminuoso> neoncortex: are there any additional data I need to run this?
vuoto has quit [Quit: Lost terminal]
<dminuoso> neoncortex: also y u no gemfile.
<dminuoso> y u no gemspec
vuoto has joined #ruby
<neoncortex> dminuoso: no, just the gems i listed
mogaj has joined #ruby
<dminuoso> A Gemfile.lock would be *most* helpful.
<dminuoso> neoncortex: Please consider a Gemfile at the very least.
<dminuoso> With version constraints.
chromis has quit [Ping timeout: 252 seconds]
caw has quit [Ping timeout: 252 seconds]
rcs_ has joined #ruby
<neoncortex> i do not know, it's my first ruby code =D
spectra has quit [Ping timeout: 252 seconds]
Olipro has quit [Ping timeout: 252 seconds]
rcs has quit [Ping timeout: 252 seconds]
darthvorik has quit [Ping timeout: 252 seconds]
skmp has quit [Ping timeout: 252 seconds]
wsmoak has quit [Ping timeout: 252 seconds]
rfv has quit [Ping timeout: 252 seconds]
bakingbread has quit [Ping timeout: 252 seconds]
troter__________ has quit [Ping timeout: 252 seconds]
Guest84972 has quit [Quit: No Ping reply in 180 seconds.]
lancetw has quit [Ping timeout: 252 seconds]
peteretep has quit [Ping timeout: 252 seconds]
PaulePanter has quit [Ping timeout: 252 seconds]
<dminuoso> neoncortex: do you know yarm/npm?
Rush has joined #ruby
<neoncortex> no
knight_ has quit [Quit: No Ping reply in 180 seconds.]
ohcibi has quit [Quit: No Ping reply in 180 seconds.]
<dminuoso> neoncortex: Anyway. It's very easy to use: http://bundler.io/v1.5/gemfile.html
pragmatism has quit [Ping timeout: 252 seconds]
apeiros has quit [Ping timeout: 252 seconds]
mtkd has quit [Ping timeout: 260 seconds]
<neoncortex> i'll look at it
wsmoak has joined #ruby
gsingh93 has quit [Ping timeout: 252 seconds]
uranellus has quit [Ping timeout: 252 seconds]
<dminuoso> You just create that file and then use "bundle install" to install the bundle, and "bundle exec" to execute commands within that bundle.
<dminuoso> That's it. :)
darthvorik has joined #ruby
<neoncortex> yeah, it's seems helpful
knight_ has joined #ruby
chromis has joined #ruby
ohcibi has joined #ruby
apeiros has joined #ruby
xybre has quit [Ping timeout: 252 seconds]
caw has joined #ruby
rfv has joined #ruby
peteretep has joined #ruby
skmp has joined #ruby
lancetw has joined #ruby
<dminuoso> neoncortex: Now with a Gemfile.lock you can get reproducible behavior, since it pins gem versions.
pragmatism has joined #ruby
mtkd has joined #ruby
<dminuoso> So you could give me your Gemfile.lock, and allow me to install the exact same gem versions.
jespada has quit [Quit: WeeChat 1.4]
<dminuoso> (The Gemfile.lock is automatically generated by bundle install)
vuoto has quit [Remote host closed the connection]
icedp has joined #ruby
<neoncortex> i see
uranellus has joined #ruby
uranellus has quit [Changing host]
uranellus has joined #ruby
cibs has quit [Ping timeout: 260 seconds]
<neoncortex> dminuoso: the method is in the line 561 (the one who triggers the crash)
icedp is now known as Guest94512
<dminuoso> neoncortex: It's not.
<dminuoso> neoncortex: Your code has nothing to do with it.
<neoncortex> dminuoso: oh =D
spectra has joined #ruby
gsingh93 has joined #ruby
<neoncortex> they call two others, above them
iMadper|nPlus6 is now known as iMadper
d0nn1e has quit [Ping timeout: 240 seconds]
Lord_of_Life has quit [Excess Flood]
<dminuoso> neoncortex: Your code just produces a particular kind of situation that crashes when the GC comes around.
Olipro has joined #ruby
<dminuoso> neoncortex: Do you have the gist with the bug output again for me?
cibs has joined #ruby
<neoncortex> i think i do not have it anymore ..
PaulePanter has joined #ruby
d0nn1e has joined #ruby
<dminuoso> neoncortex: http://dpaste.com/3R9HME6
Lord_of_Life has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
bkxd_ has quit [Ping timeout: 260 seconds]
<neoncortex> dminuoso: you're starting to scare me haha
<dminuoso> No actually its not the GC itself
<dminuoso> One sec
kristofferR has joined #ruby
cschneid_ has joined #ruby
Fin7_ has joined #ruby
agent_white has joined #ruby
<herwin> ruby 2.1.5p273
<herwin> is that one still supported?
<dminuoso> herwin: Already had them update.
<herwin> "them"
<dminuoso> Yes them.
<dminuoso> Gender neutral pronoun. :-)
Fin7_ has left #ruby [#ruby]
<dminuoso> Chicago Manual of Style says its fine in casual contexts.
mitt3ns has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
tonini has quit [Quit: Connection closed for inactivity]
cschneid_ has quit [Ping timeout: 255 seconds]
mogaj has quit [Remote host closed the connection]
<herwin> got a bit confused by reading just half of the discussion, you were not the one pasting the segfault output
<herwin> note to self: stop reading half of the discussion
* herwin goed back to work
<neoncortex> herwin: i pasted this yesterday, and dminuoso think i find a bug in the ruby interpreter .. anyway, go work =D
iwmrby has joined #ruby
nerfed has joined #ruby
devyn has joined #ruby
cibs has quit [Ping timeout: 255 seconds]
mitt3ns has joined #ruby
<nerfed> hey guys, anyone know how I can temporarily disable an inherited hook on a class? if I `alias_method :__inherited_hook, :inherited` and then redefine inherited, it prevents the original from being called, but then calling __inherited_hook does not call the original hook method and aliasing it back to the original doesn't help either
tyang has joined #ruby
<nerfed> seems like ruby handles hook methods differently and this is an edge case, I really hope there is a workaround
<dminuoso> Ohh yes!
cibs has joined #ruby
<dminuoso> nerfed: I have something for you.
<dminuoso> Boy this is a perfect week.
nobitanobi has joined #ruby
rgiscard has joined #ruby
agent_white has quit [Ping timeout: 240 seconds]
<nerfed> dminuoso: it's not often that I run into a brick wall with ruby, so I hope you do have a solution
<nerfed> I could probably hack a solution to this with a C extension, but I'd really like to keep it pure ruby if at all possible
anisha has joined #ruby
<dminuoso> nerfed: Absolutely I have 2 ideas. Let me just try the regular Ruby way first before we resort to Fiddle.
Rodya_ has joined #ruby
<nerfed> the reason I need to accomplish this is that I need to do some extra initialization between creating the derived class and calling the inherited/included/extended hooks
chamunks- has joined #ruby
<dminuoso> Works just fine for me.
<dminuoso> nerfed: https://eval.in/741017
stamina has quit [Quit: WeeChat 1.7]
valkyr2e_ has joined #ruby
<matthewd> C.singleton_class.prepend Module.new { attr_accessor :inherited_disabled; def inherited *; super unless inherited_disabled; end }
Slinky_Pete has joined #ruby
<nerfed> that seems to work, can't believe the solution was so simple
<nerfed> now to figure out why there is a different between using #class and #singleton_class in this case, so that it can never bite me again
valkyr2e has quit [Ping timeout: 252 seconds]
chamunks has quit [Ping timeout: 252 seconds]
Kestrel-029 has quit [Ping timeout: 252 seconds]
RushPL has quit [Quit: No Ping reply in 180 seconds.]
sagax has quit [Remote host closed the connection]
valkyr2e_ is now known as valkyr2e
<nerfed> *a difference
<dminuoso> nerfed: class methods dont belong to the class.
valkyr2e is now known as Guest55219
<dminuoso> nerfed: lets assume there's no difference between modules and classes (this is kind of true actually), in Ruby *only* classes can have methods.
<dminuoso> And ruby does not distinguish between class methods and instance methods.
<dminuoso> So the real difference is on what class they are defined on.
RushPL has joined #ruby
antgel has joined #ruby
Rodya_ has quit [Ping timeout: 255 seconds]
<nerfed> but all other class level methods can be worked with using #class, it's only hooks which require #singleton_class
<dminuoso> No they cant
<dminuoso> For sending yes, but not defining.
gheegh has quit [Quit: Textual IRC Client: www.textualapp.com]
<dminuoso> When you do "def a.foo" (whatever a may be) its a shortcut for "a.singleton_class.send(:define_method, :foo)"
<dminuoso> They are exactly the same thing.
<nerfed> ah ok, guess there is always something more to learn when it comes to ruby
Nicmavr has joined #ruby
mogaj has joined #ruby
<nerfed> thanks, very useful
<dminuoso> nerfed: and in the context of a class, "self" is the class object itself.
bmurt has joined #ruby
Nicmavr is now known as Guest62605
<dminuoso> so "def self.method" means "define this on the singleton class of <self> (which is the class itself)"
synthroid has joined #ruby
blaxter has quit [Quit: foo]
<nerfed> so my confusion is because calling works on #class, and I usually call things to define (eval, class_eval, define_method, etc)
sagax has joined #ruby
<nerfed> singleton_class is what I should be using in most cases
<matthewd> It depends what you're doing and where you are
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<matthewd> MyClass.class is never going to give you what you want, because that's Class (the class class)
neuraload has quit [Quit: This computer has gone to sleep]
<dminuoso> MyClass = Module.new; MyClass.class # matthewd
<dminuoso> You lied!
<dminuoso> :P
* dminuoso hides
* dminuoso runs as fast as he cans
* dminuoso hides agai
skarlso has joined #ruby
mogaj has quit [Ping timeout: 240 seconds]
<dminuoso> nerfed: one other thing since we have touched the subject already: within this context: class << foo; end; does nothing but open the singleton_class of foo (whatever that may be), and set it to "self" inside the block and to the default definee.
<dminuoso> which should now explain why you can also define class methods by doing: class << self; def foo; end
GGMethos has quit [Ping timeout: 240 seconds]
<dminuoso> because all you do is: "open the singleton class of self, and then define methods onto it"
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
timmow has quit [Ping timeout: 252 seconds]
<dminuoso> >> a = "foo"; class << a; def length; "17.3"; end; puts a.length # nerfed
Ishido has joined #ruby
* dminuoso kicks ruby[bot]
<dminuoso> >> a = "foo"; class << a; def length; "17.3"; end; puts a.length # nerfed
<dminuoso> >> a = "foo"; class << a; def length; "17.3"; end; end; puts a.length # nerfed
Mortomes|Work has quit [Ping timeout: 260 seconds]
howdoi has quit [Ping timeout: 240 seconds]
lianj has quit [Ping timeout: 252 seconds]
neuraload has joined #ruby
<nerfed> yeah I understand all that, I just got confused about using the singleton class of a class
lianj has joined #ruby
<dminuoso> Now do you also know what class_eval does? :p
contradictioned has quit [Quit: No Ping reply in 180 seconds.]
<nerfed> I work on the class level a lot in ruby, but hardly ever on the singleton class of an instant of an object
<nerfed> *instance
howdoi has joined #ruby
<dminuoso> it does not matter whether its an object or a class, its the same story every time.
rgiscard has quit [Remote host closed the connection]
lianj has quit [Changing host]
lianj has joined #ruby
<nerfed> yeah since everythings an object and every object has a class, including the classes class
rafadc has joined #ruby
timmow has joined #ruby
<dminuoso> nerfed: right, and everything also has a superclass, which is different from alass
contradictioned has joined #ruby
<dminuoso> class
<nerfed> the super class is why I needed to mess with the inherited hook, because I'm initializing the instance of the class manually, passing the super class to the constructor
<dminuoso> nerfed: I've prepared a diagram a while ago, perhaps this will help you: http://i.imgur.com/ygZUS91.png
<dminuoso> note that technically the singleton chain is infinitely deep
<nerfed> so I need to skip the inherited hook before I do that, then initialize the actual class data after that, and only then call the inherited hook
t-recx has joined #ruby
jameser has joined #ruby
<dminuoso> the method call lookup is basically "take the resources klass, and then check the result for its method. if you cant find it, follow the super chain"
<dminuoso> s/resources/receivers/
<nerfed> yup
GGMethos has joined #ruby
hightower2 has quit [Remote host closed the connection]
TheWhip has quit [Remote host closed the connection]
rwb has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
gnufied has joined #ruby
millerti has joined #ruby
blackmesa has quit [Ping timeout: 240 seconds]
harfangk has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
jameser has quit [Max SendQ exceeded]
mikecmpbll has quit [Ping timeout: 240 seconds]
aspiers has joined #ruby
jameser has joined #ruby
gnufied has quit [Quit: Leaving]
_whitelogger has quit [Ping timeout: 240 seconds]
_whitelogger has joined #ruby
aredridel has joined #ruby
Guest94512 has quit [Ping timeout: 240 seconds]
Kestrel-029 has joined #ruby
milardovich has joined #ruby
dionysus69 has joined #ruby
case__ has joined #ruby
devyn has quit [Ping timeout: 240 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Kestrel-029 is now known as Guest16987
tfitts has joined #ruby
myk267 has joined #ruby
Guest45695 has quit [Remote host closed the connection]
milardovich has quit [Ping timeout: 260 seconds]
blackmesa has joined #ruby
marsjaninzmarsa has quit [Remote host closed the connection]
icedp has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marsjaninzmarsa has joined #ruby
mim1k has joined #ruby
<manveru> hmm, wasn't there a method called #eigenclass instead of #singleton_class for a while?
<manveru> my memory is fuzzy on that
psychicist__ has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
err_ok has joined #ruby
<manveru> no, doens't look like it
jameser has joined #ruby
xen0fon has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
<nerfed> I recall eigenclass being the terminology for ruby singleton classes many years ago
mim1k has joined #ruby
xen0fon has quit [Client Quit]
antgel has quit [Ping timeout: 255 seconds]
jameser has quit [Client Quit]
TheWhip has joined #ruby
nettoweb has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 268 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Slinky_Pete has quit [Remote host closed the connection]
nettoweb has joined #ruby
gnufied has joined #ruby
AKPWD has joined #ruby
terens has joined #ruby
milardovich has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
aspiers has quit [Ping timeout: 260 seconds]
jose_leeto has joined #ruby
nettoweb1 has joined #ruby
nettoweb has quit [Ping timeout: 260 seconds]
andikr has quit [Remote host closed the connection]
<dminuoso> nerfed: because there were some inaccuracies, I have a new revised version now
Tech has joined #ruby
__Yiota has joined #ruby
<manveru> yeah, i think _why popularized that at some point
agent_white has joined #ruby
milardovich has quit [Ping timeout: 240 seconds]
<dminuoso> manveru: I just use the internal names because it helps me concile the terminology with the internals -> keeps your sanity up while debugging
<manveru> don't worry, my question was totally unrelated to you :)
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<dminuoso> That should be even better! :D
mitt3ns has quit [Ping timeout: 240 seconds]
govg has quit [Ping timeout: 260 seconds]
tuelz has joined #ruby
jhack has joined #ruby
govg has joined #ruby
<tuelz> I've got an ivar that is initially nil, is there an idiomatic way/method to push things onto an ivar that creates an array if the ivar is nil?
falconer has joined #ruby
<dminuoso> tuelz: ivar ||= []
milardovich has joined #ruby
<dminuoso> tuelz: Note that it does not exactly fulfill your requirement (since it will also do the assignment if ivar is false), but it's a common idiom.
<tuelz> dminuoso: yeah that's what I'm doing was hoping to omit that LOC
Rodya_ has joined #ruby
Alina-malina_ has joined #ruby
xen0fon has joined #ruby
<dminuoso> tuelz: Another way is to construct in your initialize method which I prefer.
<tuelz> thanks though, that works
<dminuoso> tuelz: Let your constructor set up the class contract.
<dminuoso> That way all parts can reason about what state your instance variables are in. :)
<tuelz> makes sense
<tuelz> dminuoso: thanks as always :)
fusta has quit [Ping timeout: 255 seconds]
jameser has joined #ruby
aspiers has joined #ruby
Alina-malina_ has joined #ruby
Alina-malina_ has quit [Changing host]
braincrash has quit [Ping timeout: 260 seconds]
Alina-malina has quit [Ping timeout: 260 seconds]
Alina-malina_ is now known as Alina-malina
Rodya_ has quit [Ping timeout: 240 seconds]
milardovich has quit [Ping timeout: 260 seconds]
<nerfed> I wish there was a nice way for derived classes to inherit an inherited hook
tau has joined #ruby
<nerfed> it's really common for me to require a base class to initialize class level instance variables in a derived class, which I'd use a inherited/included hook for
mikecmpbll has joined #ruby
<nerfed> but that limits the use to one level of inheritance, any classes which are derived from a derived class will no longer have those ivars initialized
milardovich has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
braincrash has joined #ruby
malconis has joined #ruby
<dminuoso> nerfed: Do you want me to get the water gun?
<dminuoso> nerfed: https://eval.in/741067
milardovich has quit [Ping timeout: 240 seconds]
jameser has joined #ruby
<nerfed> wait what, I just noticed it already works that way now
<nerfed> but it was definitely not working last night
agit0 has joined #ruby
<nerfed> there must have been something else going on
<dminuoso> nerfed: Are you suggesting your ruby interpreter mutated last night?
<nerfed> did you spray water at my ruby interpreter?
<dminuoso> Don't worry, I treat ruby interpreters with respect.
<dminuoso> Humans? Not so much.
TheWhip has quit [Remote host closed the connection]
al2o3-cr has joined #ruby
<nerfed> no one said I was a humans
tyang_ has joined #ruby
<nerfed> I'm going to have to blame inheritance ghosts, they must have packed up and left in the night
<dminuoso> nerfed: https://eval.in/741072
<dminuoso> Look at all the funny stuff you can do with this.
<dminuoso> On that note I just realized must module Prepend must work in the ruby object model.
<nerfed> I've been looking for a good real world use case to use prepend for a while now
<nerfed> I almost thought I was one yesterday, but turned out that would have broken other stuff that I needed
<dminuoso> Im guessing it takes original klass object, replaces it with a new IClass object and sets that IClass'es superclas to be the original klass object. ;o
<nerfed> *found one
tyang has quit [Ping timeout: 268 seconds]
<dminuoso> nerfed: module Prepend is basically your go-to whenever you think you have to use alias_method :P
<dminuoso> its great for monkey patching stuff
anisha has quit [Quit: This computer has gone to sleep]
milardovich has joined #ruby
<dminuoso> nerfed: un-prepending and un-including is very simple too.
dionysus69 has quit [Ping timeout: 240 seconds]
<nerfed> I must remember it for monkeypatching in the future
<dminuoso> nerfed: fucking around with temporary includes is as simple as this: https://gist.github.com/anonymous/f5bae5728d619a07015c9e1ea47039b0
<nerfed> that's pretty crazy, I like it
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Ping timeout: 260 seconds]
jameser has joined #ruby
griffindy has joined #ruby
rgiscard has joined #ruby
Slinky_Pete has joined #ruby
Xentil has joined #ruby
msg has joined #ruby
msg is now known as Guest45919
sepp2k has joined #ruby
nobody72 has joined #ruby
govg has quit [Ping timeout: 255 seconds]
Slinky_Pete has quit [Ping timeout: 240 seconds]
ramortegui has joined #ruby
TheWhip has joined #ruby
Guest45919 has quit [Ping timeout: 268 seconds]
troter__________ has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
xybre has joined #ruby
bmurt has quit [Quit: Textual IRC Client: www.textualapp.com]
SteenJobs_ has quit [Quit: SteenJobs_]
nobody72 has quit [Ping timeout: 255 seconds]
pandaant has quit [Remote host closed the connection]
itarato has quit [Quit: WeeChat 1.4]
bmurt has joined #ruby
govg has joined #ruby
<tuelz> is there a method which takes two enumerables and maps each element against all elements in the other? e.g. [1,2,3].map([a,b,c]) { |x,y| [x,y] } #=> [1,a] ...
modin has quit [Ping timeout: 245 seconds]
Burgestrand has quit [Quit: Closing time!]
<rob__> tuelz: zip
<tuelz> rob__: thanks
bkxd has joined #ruby
nobody72 has joined #ruby
<allisio> rob__: Be advised that it doesn't work with Enumerables in the general case.
modin has joined #ruby
<allisio> You can't #zip Ranges, for instance. :/
<allisio> Er... never mind? I know there's some nuance to be mindful of, though.
last_staff has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
nettoweb1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
<allisio> I guess I must have been thinking of #product.
fusta has joined #ruby
jhack has quit [Quit: jhack]
nopacien13 is now known as nopacienc3
DLSteve has joined #ruby
rafaelaraujo has joined #ruby
cdg has joined #ruby
rafaelaraujo has left #ruby [#ruby]
fuzzyhorns has joined #ruby
iwmrby has quit [Quit: WeeChat 1.7]
itarato has joined #ruby
jenrzzz has joined #ruby
Lyubo1 has quit [Ping timeout: 268 seconds]
<noan> I think I have my config.ru wrong but I have no idea how to fix it.
volhit has joined #ruby
<noan> or maybe it's sinatra. Whatever the case I'm getting nothing on the console from one of the "apps" I'm trying to inf.
jolamb has left #ruby ["WeeChat 1.6"]
govg has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
arooni has quit [Quit: ZNC - http://znc.in]
last_staff has quit [Quit: last_staff]
nicltest has joined #ruby
nicltest has quit [Client Quit]
arooni has joined #ruby
tyang__ has joined #ruby
ferr1 has quit [Quit: WeeChat 1.6]
JeanCarloMachado has quit [Ping timeout: 268 seconds]
tyang_ has quit [Ping timeout: 268 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
jameser has joined #ruby
raspado has joined #ruby
chouhoulis has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cibs has quit [Ping timeout: 240 seconds]
TomyWork has quit [Ping timeout: 240 seconds]
govg has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 260 seconds]
cibs has joined #ruby
mwlang has joined #ruby
Lyubo1 has joined #ruby
volhit has quit [Quit: Textual IRC Client: www.textualapp.com]
teclator has quit [Remote host closed the connection]
aryaching has joined #ruby
cibs has quit [Ping timeout: 240 seconds]
cibs has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
astrobunny has joined #ruby
astrobunny has quit [Remote host closed the connection]
aganov has quit [Remote host closed the connection]
msg has joined #ruby
msg is now known as Guest33828
blackwind_123 has joined #ruby
shinnya has joined #ruby
Guest33828 has quit [Remote host closed the connection]
aspiers has quit [Ping timeout: 260 seconds]
Burgestrand has joined #ruby
Qchmqs has quit [Ping timeout: 260 seconds]
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mikecmpbll has quit [Ping timeout: 268 seconds]
aspiers has joined #ruby
jgnagy has joined #ruby
nobody72 has quit [Quit: nobody72]
CloCkWeRX has quit [Quit: Leaving.]
Burgestrand has quit [Quit: Closing time!]
TomyLobo has joined #ruby
malconis has quit [Quit: Textual IRC Client: www.textualapp.com]
jgnagy has quit [Ping timeout: 240 seconds]
malconis has joined #ruby
nettoweb has joined #ruby
Burgestrand has joined #ruby
mwlang has quit [Quit: mwlang]
anonymus has quit [Remote host closed the connection]
mwlang has joined #ruby
fuzzyhorns has quit [Quit: Leaving.]
fuzzyhorns has joined #ruby
Snowy has joined #ruby
MrBusiness has joined #ruby
blackmesa has quit [Ping timeout: 268 seconds]
saneax is now known as saneax-_-|AFK
bkxd has quit [Ping timeout: 260 seconds]
arch___ has joined #ruby
arch___ has quit [Excess Flood]
fusta has quit [Ping timeout: 240 seconds]
arch___ has joined #ruby
arch___ has quit [Excess Flood]
mwlang has quit [Ping timeout: 240 seconds]
interki has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
malconis has quit [Ping timeout: 240 seconds]
cschneid_ has joined #ruby
antoniobeyah has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 260 seconds]
dgs has quit [Ping timeout: 240 seconds]
falconer has quit [Quit: Leaving]
dgs has joined #ruby
falconer has joined #ruby
neuraload has quit [Quit: Leaving]
malconis has joined #ruby
pwnd_nsfw has joined #ruby
millerti has joined #ruby
funnel has quit [Quit: leaving]
Rodya_ has joined #ruby
funnel has joined #ruby
milardovich has joined #ruby
Rodya_ has quit [Ping timeout: 240 seconds]
astrobunny has joined #ruby
<noan> }
<noan> "password": "testtesttest"
<noan> "email": "test@test.test",
<noan> {
<noan> 2017-02-22 17:10:36 - JSON::ParserError - 743: unexpected token at '':
<noan> whut
benlieb has joined #ruby
astrobunny has quit [Ping timeout: 260 seconds]
mogaj has joined #ruby
msg has joined #ruby
msg is now known as Guest71630
mogaj has quit [Remote host closed the connection]
mogaj has joined #ruby
<dionysus69> ok that's it
Slinky_Pete has joined #ruby
<dionysus69> please someone give me advices on, how to make a ruby gui application that will work on both linux and windows
funnel has quit [Quit: Lost terminal]
skweek has joined #ruby
funnel has joined #ruby
<dionysus69> I understand that i would have to preinstall ruby on the windows machine manually, or if that's not necessary please let me know that too
mitt3ns has joined #ruby
t-recx has quit [Quit: t-recx]
Slinky_Pete has quit [Ping timeout: 260 seconds]
agit0 has quit [Quit: zzzZZZ….]
mim1k has quit [Ping timeout: 240 seconds]
User458764 has joined #ruby
<allisio> noan: That's clearly not the problematic portion of the JSON: https://eval.in/741145
User458764 has joined #ruby
<mitt3ns> Mornin' folks
agent_white has quit [Disconnected by services]
mitt3ns is now known as agent_white
<noan> allisio, hence whut. I resolved the issue there though I think
mitt3ns has joined #ruby
<jlebrech> annoyingly, when you do Benchmark.measure any variables in the block are undefined afterwards.
<ChrisWarrick> I want to iterate over a string, getting two variables: current character and next character (or nil). How do I do that?
anisha has joined #ruby
choke has joined #ruby
<allisio> ChrisWarrick: You want #each_cons.
<allisio> jlebrech: There's really no good reason to *want* variables to leak out of their original scopes.
falconer has quit [Quit: Leaving]
swills has quit [Ping timeout: 240 seconds]
<allisio> If you're hell-bent on having their new values accessible after the measurement, you could pre-initialize them outside the block.
<allisio> >> x = 1; proc { x = 2 }.call; x
<jlebrech> allisio: understandable, but sometime you're measuring a line or two and the code needs modifying
nobody72 has joined #ruby
<ChrisWarrick> allisio: For that, I’d need to (a) .split('') into an array, and then (b) append an extra element to get [last_character, nil]
<dionysus69> whats most up to date way to create ruby gui app? shoes seems to be forgotten, judging from the last commit.
<allisio> ChrisWarrick: Prefer `chars` over `split('')`, but yes; still the best way to go about it.
<allisio> Explicitly iterating over indices is usually bad form.
<allisio> That is, `(0...s.length).map { |i| [s[i], s[i + 1]] }` is gross.
<ChrisWarrick> allisio: What about array.zip(array[1..-1]) if I need an array anyways?
<allisio> ChrisWarrick: Smart.
<matthewd> ChrisWarrick: That starts to depend on what feels right, based on what you're doing inside the loop
mark_66 has quit [Remote host closed the connection]
noan has quit [Remote host closed the connection]
LambdaSix has quit [Ping timeout: 240 seconds]
noan has joined #ruby
coreutil has joined #ruby
nOwz has quit [Quit: WeeChat 1.7]
JeanCarloMachado has joined #ruby
noan has quit [Remote host closed the connection]
coreutil has quit [Remote host closed the connection]
LambdaSix has joined #ruby
noan has joined #ruby
swills has joined #ruby
bkxd has joined #ruby
Emmanuel_Chanel has joined #ruby
djbkd has joined #ruby
chouhoulis has joined #ruby
siwica has joined #ruby
nobody72 has quit [Ping timeout: 260 seconds]
nettoweb has quit [Ping timeout: 240 seconds]
nobody72 has joined #ruby
TheWhip has quit [Remote host closed the connection]
<siwica> When comparing two symbols, is it better practice to do `:symbol1 == :symbol2` or `:symbol1.equal(:symbol2)`?
brent__ has joined #ruby
<toretore> ==
<baweaver> == is fine.
doadet has joined #ruby
<ytti> i would say first is more idiomatic, whle latter is more pure
<baweaver> though symbols are literally the same object as opposed to a String or Integer
<baweaver> s/or Integer//
* baweaver goes to get coffee before he says something else off
Skarlso- has joined #ruby
yitsushi has joined #ruby
teclator has joined #ruby
armyriad has quit [Ping timeout: 240 seconds]
SuperLag has quit [Quit: leaving]
faces has quit [Ping timeout: 268 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Snowy has quit [Remote host closed the connection]
brent__ has quit [Ping timeout: 260 seconds]
conta has quit [Ping timeout: 268 seconds]
gregf_ has joined #ruby
jtdoncas has joined #ruby
nettoweb has joined #ruby
markholmes has joined #ruby
jenrzzz has joined #ruby
Snowy has joined #ruby
interki has joined #ruby
interki has quit [Excess Flood]
interki has joined #ruby
interki has quit [Client Quit]
jenrzzz has quit [Ping timeout: 255 seconds]
patarr has joined #ruby
Snowy has quit [Quit: ragequit]
brent__ has joined #ruby
interki has joined #ruby
skarlso has quit [Quit: Leaving...]
faces has joined #ruby
polishdub has joined #ruby
Kug3lis_ has joined #ruby
nobody72 has quit [Ping timeout: 240 seconds]
amclain has joined #ruby
reverberations has quit [Read error: Connection reset by peer]
Kug3lis has quit [Ping timeout: 240 seconds]
reverberations has joined #ruby
acovrig has joined #ruby
Burgestrand has quit [Quit: Closing time!]
<acovrig> I have an *old* system (ruby-1.8.7-p374) that has a reference for rake abc:import; what can I do to figure out what that does? I looked in lib and vendor but don’t see anything that smells like an importer
tyang_ has joined #ruby
Rodya_ has joined #ruby
mim1k has joined #ruby
jlebrech has quit [Remote host closed the connection]
agit0 has joined #ruby
rgiscard has quit [Remote host closed the connection]
nettoweb has quit [Ping timeout: 260 seconds]
Kug3lis_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tyang__ has quit [Ping timeout: 268 seconds]
Rodya_ has quit [Ping timeout: 240 seconds]
Guest71630 has quit [Remote host closed the connection]
msg has joined #ruby
msg is now known as Guest29178
tyang__ has joined #ruby
braincrash has quit [Ping timeout: 240 seconds]
nobitanobi has quit [Remote host closed the connection]
rakm has joined #ruby
Guest29178 has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
tyang_ has quit [Ping timeout: 268 seconds]
nettoweb has joined #ruby
benlieb has quit [Quit: benlieb]
benlieb has joined #ruby
nobitanobi has quit [Ping timeout: 240 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agit0 has quit [Quit: zzzZZZ….]
mim1k has quit [Ping timeout: 260 seconds]
aspiers has quit [Ping timeout: 240 seconds]
mtkd has quit [Ping timeout: 240 seconds]
acovrig has quit [Quit: acovrig]
mtkd has joined #ruby
tildes has joined #ruby
tyang_ has joined #ruby
aufi has quit [Quit: Leaving]
t-recx has joined #ruby
tyang__ has quit [Ping timeout: 268 seconds]
nettoweb has quit [Ping timeout: 240 seconds]
tyang has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
itarato has quit [Quit: WeeChat 1.4]
tyang_ has quit [Ping timeout: 268 seconds]
ikopico has joined #ruby
montanonic has joined #ruby
tildes has quit [Remote host closed the connection]
aupadhye has quit [Ping timeout: 260 seconds]
milardovich has quit [Remote host closed the connection]
nettoweb has joined #ruby
milardovich has joined #ruby
redhedded1 has quit [Quit: Textual IRC Client: www.textualapp.com]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
marxarelli|afk has quit [Quit: Textual IRC Client: www.textualapp.com]
marxarelli has joined #ruby
jtdoncas has quit [Ping timeout: 240 seconds]
iqiqwi has quit [Remote host closed the connection]
milardovich has quit [Remote host closed the connection]
agit0 has joined #ruby
rubyfizz has joined #ruby
bkxd has quit [Ping timeout: 268 seconds]
agit0 has quit [Client Quit]
nerfed has quit [Ping timeout: 260 seconds]
shinnya has quit [Ping timeout: 255 seconds]
agit0 has joined #ruby
agit0 has quit [Client Quit]
username_ has joined #ruby
faces has quit [Ping timeout: 260 seconds]
faces has joined #ruby
username_ has quit [Client Quit]
montanonic has quit [Ping timeout: 268 seconds]
username_ has joined #ruby
aspiers has joined #ruby
duderonomy has quit [Ping timeout: 260 seconds]
mogaj has quit [Remote host closed the connection]
nowhereFast has joined #ruby
<nowhereFast> is it possible to use prepend inside of a module?
User458764 has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhereFast has left #ruby [#ruby]
mogaj has joined #ruby
aspiers has quit [Ping timeout: 240 seconds]
bigkevmcd has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has joined #ruby
aspiers has joined #ruby
faces has quit [Ping timeout: 260 seconds]
msg has joined #ruby
nobody72 has joined #ruby
montanonic has joined #ruby
braincrash has joined #ruby
msg is now known as Guest55967
chouhoul_ has joined #ruby
Rodya_ has joined #ruby
doadet has quit [Ping timeout: 255 seconds]
Beams has quit [Quit: .]
chouhou__ has joined #ruby
fuzzyhorns has quit [Quit: Leaving.]
Slinky_Pete has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
hurricanehrndz has joined #ruby
enterprisey has joined #ruby
chouhoulis has quit [Ping timeout: 260 seconds]
<hurricanehrndz> I'm trying to stub a module method, and it only seems to work when being called with the fully qualified method name, is this normal?
jgnagy has joined #ruby
flying has quit []
chouhoul_ has quit [Ping timeout: 240 seconds]
Rodya_ has quit [Ping timeout: 240 seconds]
Slinky_Pete has quit [Ping timeout: 260 seconds]
username_ has quit [Quit: Lost terminal]
faces has joined #ruby
username_ has joined #ruby
mim1k has joined #ruby
User458764 has joined #ruby
username_ has quit [Client Quit]
moei has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
username_ has joined #ruby
<toretore> ?code hurricanehrndz
<ruby[bot]> hurricanehrndz: We can't help you without your code, please post it to https://gist.github.com
mogaj has quit [Remote host closed the connection]
jcao219 has joined #ruby
<djellemah> dionysus69: qt-bindings (for qt-4.8), ruby-gtk, and I just discovered ruby-qml now.
<hurricanehrndz> I'm trying to replicate this https://josephmate.wordpress.com/2010/01/31/mocking-modules-with-mocha/ without using the module name for the module function
whathappens has joined #ruby
rwb has joined #ruby
bmurt has joined #ruby
mogaj has joined #ruby
harfangk has quit [Ping timeout: 260 seconds]
TheWhip has joined #ruby
harfangk has joined #ruby
mogaj has quit [Remote host closed the connection]
<siwica> What would be the most elegant way to modify each element in an array after a certain condition of an element is met for the first time? E.g. comment out every line in an array of lines after a certain keyword occured in a line for the first time.
montanonic has quit [Ping timeout: 268 seconds]
milardovich has joined #ruby
enterprisey has quit [Remote host closed the connection]
<siwica> I'd like to use some sort of map that maintains a state between between elements
<toretore> that's what reduce is
<toretore> well, not exactly, but it can be
TheWhip has quit [Ping timeout: 240 seconds]
renchan has quit [Quit: Leaving...]
ikopico has quit [Ping timeout: 260 seconds]
antgel has joined #ruby
<siwica> toretore: Could you provide a minimal example?
synthroi_ has joined #ruby
duderonomy has joined #ruby
anisha has quit [Quit: Leaving]
Tech has quit [Read error: Connection reset by peer]
fuzzyhorns has joined #ruby
Tech has joined #ruby
<toretore> >> [1,2,3,4,5].reduce([0, []]){|(s,a),n| [s+n, a+[n]] }
<ruby[bot]> toretore: # => [15, [1, 2, 3, 4, 5]] (https://eval.in/741205)
synthro__ has joined #ruby
jhack has joined #ruby
<toretore> >> [1,2,3,4,5].reduce([0, []]){|(s,a),n| [s+n, a+[n+1]] }
<ruby[bot]> toretore: # => [15, [2, 3, 4, 5, 6]] (https://eval.in/741206)
whathappens has quit [Read error: Connection reset by peer]
whathappens has joined #ruby
synthroid has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<noan> so if I'm accessing my headers object in sinatra/rack.. is this ALL my headers in a hash? or can some be left out
<siwica> toretore: ok, I see!
<toretore> but for your problem, just do `condition = false; array.map{|e| if condition; modify e; else; condition = true if something; end }`
synthroi_ has quit [Ping timeout: 260 seconds]
anisha has joined #ruby
<apeiros> there's something off with that
<apeiros> oh
<apeiros> I see
<apeiros> nvm :)
<toretore> needs more flip flop?
<apeiros> no code ever needs more flip flop
<allisio> How does the flip-flop work in a #map?
<toretore> tbh it's an ideal use case for it
<toretore> if there ever was
montanonic has joined #ruby
<apeiros> maybe. but you'll have to comment what your code does, and that comment will a) be longer than the alternative code and b) an anti-pattern :)
<toretore> lol
<toretore> 30 lines of comment explaining wtf a flip flop is
Cohedrin has joined #ruby
<apeiros> you could cheat and just link to an explanation ^^
<apeiros> anyway, calorie killing time, cya :D
<apeiros> that's calorie intake time ;-)
bkxd has joined #ruby
<toretore> oh
<toretore> bon appetit
<allisio> siwica: https://eval.in/741212
<toretore> i thought it sounded strange
lxsameer has joined #ruby
<apeiros> 🚲 <- calorie killer
jhack has quit [Quit: jhack]
<toretore> well, bon exercice then :P
larcara has quit []
<baweaver> Just use a true flag above the method
<baweaver> not everything has to be implemented inside one function.
<toretore> but muh point free
whathapp_ has joined #ruby
<baweaver> There are limits to how much FP we can really use in Ruby
<allisio> Stateful #map is heresy.
<allisio> Are there?
<baweaver> get too far carried away and well....
<baweaver> Tail call optimization, Monads, Pattern Matching, full referential transparency, etc etc etc
<baweaver> and yes you can compile with TCO
<toretore> it's usually a mistake to apply best practices from another language in one that's substantially different
<baweaver> but I don't tend to count that
<baweaver> bingo
<baweaver> Monads for instance require static type contracts to really work, otherwise you end up in a mess with Monoid construction.
whathappens has quit [Ping timeout: 241 seconds]
<baweaver> besides, flip flop uses a boolean flag in the background anyways.
harfangk has quit [Quit: Textual IRC Client: www.textualapp.com]
chouhou__ has quit [Remote host closed the connection]
JeanCarloMachado has quit [Ping timeout: 260 seconds]
chouhoulis has joined #ruby
JeanCarloMachado has joined #ruby
OMGtechy has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
xall_ has joined #ruby
GodFather has joined #ruby
matcouto has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
renchan has joined #ruby
marxarelli is now known as marxarelli|afk
GodFather has quit [Remote host closed the connection]
mim1k has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
atmosx has quit [Quit: WeeChat 1.4]
milardovich has quit [Remote host closed the connection]
gsilva has quit [Quit: Leaving]
esObe has joined #ruby
GodFather has joined #ruby
TheWhip has joined #ruby
last_staff has joined #ruby
Anonymoose2 has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
jgnagy has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 240 seconds]
davezd has quit [Quit: Leaving]
atmosx has joined #ruby
reverberations has quit [Ping timeout: 240 seconds]
mim1k has joined #ruby
<sparr> I've got a class with an initialize method that takes some params. I'd like to predefine most of those params somewhere, in a way that I can merge them with modifiers when I initialize the object.
<sparr> example of what I have now: Deck.new(cards: 5, width: 1125, height: 825, layout: ['foo','bar'])
esObe has quit [Remote host closed the connection]
esObe has joined #ruby
jtdoncas has joined #ruby
<sparr> what I'd like to do is define the width, height, and 'foo' layout in one place and give it a name, then call Deck.new(cards:5, predefinedstuff:thatname, layout:['bar']), but that would require changing the initialize method. Instead, I'd like to maybe make thatname be a hash that gets merged with a second hash of the custom params and that hash gets broken up into the params for the initialize method.
singalaut has quit [Quit: paeh]
<sparr> what might that look like?
OMGtechy has quit [Quit: Leaving]
alibby has quit [Quit: Leaving.]
singalaut has joined #ruby
<toretore> why don't you want to change initialize?
<sparr> not my code to change
Rodya_ has joined #ruby
<toretore> so what you have is a hash, and you want to merge that hash with some default values?
cdg has quit [Remote host closed the connection]
<sparr> yes, and then use that hash as the named parameters to new()
nobody72 has quit [Ping timeout: 240 seconds]
<sparr> in python I'd have two dicts, use update() to merge them, then pass that dict in as **keywords on the function call.
esObe has quit [Ping timeout: 260 seconds]
<toretore> but it won't deep merge
<toretore> you can do the same in ruby
<daed> whoa, 2.4 is out?
<daed> for quite a while eh..
<sparr> the merge on the layout array is the trickiest part, I think
A124 has quit [Quit: '']
ikopico has joined #ruby
<toretore> sparr: you know what the logic you want is, just write a method that merges them the way you want
Rodya_ has quit [Ping timeout: 268 seconds]
benlieb has quit [Quit: benlieb]
<toretore> Deck.new(my_merge(defaults, other))
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jackjackdripper has quit [Quit: Leaving.]
oetjenj has joined #ruby
A124 has joined #ruby
synthro__ has quit [Remote host closed the connection]
Xiti has joined #ruby
nofxx has joined #ruby
<sparr> toretore: what does my_merge return there? if it returns a hash, wouldn't initialize() need to be modified to take a single hash param?
<neoncortex> dminuoso: referencing unexistant objects can cause the crash i've shown?
<sparr> link above is a better explanation of what I'm looking for, I think
nobody72 has joined #ruby
TheWhip has quit [Remote host closed the connection]
<toretore> sparr: your first example is correct
<toretore> Deck.new takes 1 hash
<toretore> you can **kwargs it if you want, but there is actually no difference
bigkevmcd has joined #ruby
ur5us has joined #ruby
milardovich has joined #ruby
ElFerna has joined #ruby
montanonic has quit [Ping timeout: 240 seconds]
enterprisey has joined #ruby
pliniker has quit [Ping timeout: 258 seconds]
nobody72_ has joined #ruby
bigkevmcd has quit [Ping timeout: 268 seconds]
pliniker has joined #ruby
nobody72 has quit [Ping timeout: 240 seconds]
bocaneri has quit [Remote host closed the connection]
modin has quit [Ping timeout: 245 seconds]
elifoster has joined #ruby
<allisio> sparr: In your first example there, `some_voodoo_with(a, b)` is just `a.merge(b)`.
mtkd has quit [Ping timeout: 240 seconds]
modin has joined #ruby
<allisio> Hash#merge overwrites the values at existing keys.
mtkd has joined #ruby
jgar has joined #ruby
<jgar> I am new to ruby and am trying to use a library but running into problems running rake commands, somethig with gdbm and ffi, but the stacktrace is baffling to me: https://gist.github.com/jong/8377a4fea5f4e165579e73e9021032ed
jcao219 has quit [Ping timeout: 259 seconds]
montanonic has joined #ruby
ikopico has quit [Ping timeout: 260 seconds]
jaruga has quit [Quit: jaruga]
<sparr> allisio: I don't want to overwrite layout, I want to append it, so I might need a custom merge function
<djellemah> Hash#merge(other_hash){|key, oldval, newval| block}
<jgar> I don't even know what to google for, my gems: https://gist.github.com/jong/5ea1ad91b6165b01b005746051bd3eed
<sparr> I think I'm gonna make a gist with a better description of my overall situation. Thanks for the help so far!
<djellemah> jgar: I'm guessing gdbm has a native library dependency, which you haven't installed.
hahuang65 has quit [Ping timeout: 260 seconds]
<allisio> sparr: Ah, I did miss that part, but djellemah's suggestion (#merge with conflict resolution) is probably just the thing you need.
jackjackdripper has joined #ruby
lenwood has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<jgar> djellemah - I have installed libgdbm3 and libgdbm-dev - is there something about that stack trace that gives you a clue that a dependency is not installed? I am not familiar with reading ruby traces
<jgar> @djellemah - also, it seems I can require it OK: root@0101fd913ca1:/snip# ruby -e "require 'gdbm'" root@0101fd913ca1:/snip# echo $? 0
jackjackdripper has quit [Client Quit]
<allisio> jgar: Why are you root?
<allisio> sparr: Does this miss the mark? https://eval.in/741238
<jgar> allisio: I'm inside a docker container.
<sparr> allisio: first, thanks for turning me on to pp
<jgar> @djellemah: ah! more clues maybe: https://gist.github.com/jong/6f506f023fc41fb12b49a558f2546ba5
<sparr> allisio: second, yes, that looks like it could work
<allisio> sparr: Good deal.
<allisio> jgar: The problem might be in the Rakefile.
<jgar> allisio: I did notice that I get the error when running two require statements with -e, so maybe bundler/setup and gdbm aren't playing nice
<fuzzyhorns> what are you using GDBM for?
<fuzzyhorns> it's a native extension
<jgar> I'm not directly, this lib I'm trying to use is using it.
benlieb has joined #ruby
<fuzzyhorns> which lib is that?
bkxd has quit [Ping timeout: 255 seconds]
<fuzzyhorns> is this the Rakefile you're running? https://github.com/StateAndPlain/zip2zone/blob/master/Rakefile
machinewar has joined #ruby
tyang_ has joined #ruby
<jgar> allisio: fwiw: root@0101fd913ca1:/snip# ruby -c Rakefile Syntax OK < -that's about the best I can do in knowing if the rakefile is OK :(
<jgar> fuzzyhorns: yes that looks right
<fuzzyhorns> so we can see from the trace at least it's trying to attach via foreign function interface to the native gdbm lib
<fuzzyhorns> and failing to do so
aspiers has quit [Ping timeout: 260 seconds]
<fuzzyhorns> you prob said before, but you're sure you have http://www.gnu.org.ua/software/gdbm/?
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<jgar> unfortunately the trace doesn't give me (a newbie) any clues on how to debug further
synthroid has joined #ruby
<fuzzyhorns> jgar: so do you have gdbm or no?
<fuzzyhorns> not the gem
<fuzzyhorns> but the native library
<fuzzyhorns> the problem isn't the ruby, it's that ruby is reaching out for a c library that doesn't exist
tyang has quit [Ping timeout: 268 seconds]
<jgar> fuzzyhorns: actually no - I just used apt to install libgdbm3 and libgdbm-dev
tyang__ has joined #ruby
blackmesa has joined #ruby
<jgar> but beyond those I'm only guessing.
<djellemah> might be the gdbm gem wants a specific version of libgdbm?
<jgar> How did you know/determine that some underlying c lib was missing from that stacktrace?
xall_ has quit [Ping timeout: 260 seconds]
xall has joined #ruby
<fuzzyhorns> my guess is that gdbm isn't installed where the ffi lib would guess it is
<jgar> possibly, that sounds likely
<fuzzyhorns> well, i've worked with ffi before
<fuzzyhorns> if you look at the trace, you see it moves through gdbm gem to ffi gem, then ffi gem errors around an "attach" method
<jgar> ah, blood and tears it sounds like ;)
<fuzzyhorns> yes x)
<jgar> I am using an ubuntu image with ruby already installed, maybe having those libs installed before ruby would get them linked better
<fuzzyhorns> you can see an example of attach_function here
synthroi_ has joined #ruby
KCmetro has joined #ruby
<fuzzyhorns> it may give some clues where it looks for libs
<sparr> I want to return an array with a value appended to it, without modifying the original array. can I do that without an explicit copy of the array?
mim1k has quit [Ping timeout: 260 seconds]
<fuzzyhorns> sparr: no
tyang_ has quit [Ping timeout: 268 seconds]
<fuzzyhorns> immutability requires copies
<fuzzyhorns> this isn't just a ruby thing either
<jgar> fuzzyhorns, djellemah, allisio - you have all been very helpful thank you. I'll investigate further about getting ruby and the deps (ffi and gdbm) linked/working correctly
<fuzzyhorns> jgar: let us know how it goes and good luck, every time i've dealt with this it's been a bit of a pain!
<sparr> ok, I'm starting with what allisio gave me earlier, template.merge(custom) { |key, old, new| key == :layout ? old + new : new }
l4v2 has joined #ruby
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<djellemah> >> ary = [1,2,3]; [ary + [4],ary] # sparr
<ruby[bot]> djellemah: # => [[1, 2, 3, 4], [1, 2, 3]] (https://eval.in/741242)
synthro__ has joined #ruby
Slinky_Pete has joined #ruby
<allisio> sparr: ^ indicates that Array#+ doesn't modify the receiver, just to clarify.
synthroid has quit [Ping timeout: 255 seconds]
<sparr> I want to augment it to allow custom['layout'] to be a single string, instead of an array. in that case, I need my block to evaluate to old.push(new), but I don't want to change old
<sparr> allisio: yeah, I got it. I'm trying with Array#push now :(
<sparr> oh, oh, I could use +[new]
<allisio> Good eye.
<sparr> template.merge(custom) { |key, old, new| key == :layout ? (new.is_a?(Array) ? old + [new] : old + new) : new }
ifctj has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
nettoweb has joined #ruby
synthroi_ has quit [Ping timeout: 240 seconds]
nettoweb has quit [Client Quit]
<sparr> yes, yes, rubocop, I know nested conditionals are bad :/
KCmetro_ has joined #ruby
BTRE has quit [Quit: Leaving]
<sparr> also, my inner ?: is backwards, oops
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
<fuzzyhorns> jgar: follow-up, i think it's likely you need to rename the lib gdbm
<fuzzyhorns> rename or alias i guess, whatever
neoncortex has quit [Quit: gone]
<djellemah> sparr: try Array(new)
KCmetro has quit [Ping timeout: 255 seconds]
Ishido has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
Slinky_Pete has quit [Ping timeout: 268 seconds]
<sparr> ok, here's a fun question... can a gem contain non-ruby files, and if so then how do I refer to them in my code? like if I want to directly open one for reading.
<fuzzyhorns> sparr: you can read any file in to string or bytes
<fuzzyhorns> so as long as your gem is packaged with the files, and your calling code knows where to find them, yep
raspado has quit [Quit: Leaving...]
ifctj has quit [Ping timeout: 240 seconds]
<sparr> "where to find them" is the question
<djellemah> sparr: __FILE__ and __dir__
<sparr> djellemah: that's how a ruby file finds itself, no?
ifctj has joined #ruby
<elomatreb> IIRC there are some RubyGems conventions on where you should put such files
<djellemah> try it ;-)
<allisio> &ri Gem.datadir
mim1k has joined #ruby
<sparr> allisio: thanks, that's probably what I want
Rodya_ has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
nowhereman has joined #ruby
milardovich has quit [Ping timeout: 268 seconds]
machinewar has quit []
blackwind_123 has quit [Ping timeout: 260 seconds]
ifctj has quit [Ping timeout: 240 seconds]
maloik has quit [Remote host closed the connection]
aspiers has joined #ruby
blackwind_123 has joined #ruby
maloik has joined #ruby
markholmes has quit [Remote host closed the connection]
Rodya_ has quit [Ping timeout: 240 seconds]
pilne has joined #ruby
<fuzzyhorns> ime i usually see such a thing in a "support" dir
Ishido has joined #ruby
<nofxx> any good copy+paste algo or gem for simplify/smooth an array of floats ?
mim1k has quit [Ping timeout: 260 seconds]
JoshS has quit [Quit: Leaving]
username_ has quit [Ping timeout: 255 seconds]
<fuzzyhorns> nofxx: what does simplify/smooth mean?
ElFerna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nofxx> it's pretty much it fuzzyfuzz. There's usually more use in geo stuff...
<fuzzyhorns> https://github.com/railsmechanic/judgee this has additive smoothing?
quoboo has quit [Quit: Connection closed for inactivity]
<sparr> ok, here's a better writeup of what I'm trying to do in terms of deduplicating array data and code in my current project. I'd appreciate any guidance on how to make the block-calling-a-block part work, and ruby-izing the rest of it: https://gist.github.com/sparr/f668bd7349754f9361e540160f093027
sepp2k has quit [Quit: Leaving.]
<fuzzyhorns> nofxx: pseudocode looks pretty easy to rewrite
jackjackdripper has joined #ruby
<fuzzyhorns> you'll want to switch it from recursion
<fuzzyhorns> as ruby needs vm options to have TCO
<nofxx> fuzzyfuzz, found an old gem! https://github.com/joshuaclayton/douglas_peucker
blackmesa has quit [Ping timeout: 240 seconds]
kirun has joined #ruby
<fuzzyhorns> nice!
Fernando-Basso has quit [Quit: WeeChat 1.5]
<fuzzyhorns> it looks a lot like quicksort to me
<fuzzyhorns> same performance i guess too
raspado has joined #ruby
nahra has quit [Read error: Connection reset by peer]
nahra has joined #ruby
zzxc has quit [Ping timeout: 240 seconds]
<sparr> I'm very fuzzy on the idea of having a block call a block
zzxc has joined #ruby
<fuzzyhorns> have you worked with Proc objects before sparr>
<fuzzyhorns> ?
nobody72_ has quit [Read error: Connection reset by peer]
last_staff has quit [Quit: last_staff]
<sparr> I have not
<fuzzyhorns> sparr: that might help a bit
nobody72 has joined #ruby
milardovich has joined #ruby
rafadc has joined #ruby
redhedded1 has joined #ruby
<fuzzyhorns> f = proc {|g| g.call('f called') }
<fuzzyhorns> h = proc {|x| p "#{x} from h" }
benlieb has quit [Quit: benlieb]
<fuzzyhorns> f.call(h)
<fuzzyhorns> => "f called from h"
<fuzzyhorns> procs are a lot like blocks, but you can pass them around
<fuzzyhorns> if you need a proc to turn into a block, you use &
<elomatreb> Not strictly your question but if you want to do something The Ruby Way you should probably avoid nested ternaries D:
Technaton has quit [Quit: ZNC 1.6.4 - http://znc.in]
<sparr> elomatreb: just for concise irc pasting. I'll break it apart later.
<fuzzyhorns> not even in ruby but anywhere. nested ternaries are bad :d
skweek has quit [Ping timeout: 260 seconds]
Lyubo1 has quit [Ping timeout: 240 seconds]
<allisio> sparr: It's a little... all over the place, but you're thinking along the right lines; in the final analysis, Hash#merge is the cleanest approach to this sort of hierarchical configuration.
<sparr> so, I've got a method that wants a block. I want to deduplicate some code that I always put in that block. I need to be using proc objects to make that work?
blackmesa has joined #ruby
<allisio> You could go out of your way to architect it around delegation and the like, but that'd be overkill just now.
<fuzzyhorns> if you want to extract a block out you want a proc
<sparr> allisio: yeah, the Hash#merge part seems straightforward. Deduplicating the code in all the blocks is where I'm really stuck.
Technaton has joined #ruby
milardovich has quit [Remote host closed the connection]
<djellemah> >> fn = -> i {i*2}; [1,2,3].map(&fn) #sparr
<ruby[bot]> djellemah: # => [2, 4, 6] (https://eval.in/741253)
<fuzzyhorns> sparr: elomatreb is using "stabby" notation to write the proc
SeepingN has joined #ruby
<elomatreb> sparr: https://eval.in/741252
<fuzzyhorns> and you can see the & to turn the proc back into a block
<elomatreb> No, I'm not :P
<allisio> sparr: But djellemah is. :P
<fuzzyhorns> yes lol
<toretore> >> def foo(&b); b.call('hello'); end; f = ->(msg){ puts msg }; foo(&f)
<ruby[bot]> toretore: # => hello ...check link for more (https://eval.in/741255)
<elomatreb> Also, -> doesn't create a Proc, but rather a lambda, some differences in how arguments and returns are handled
<toretore> sparr: blocks are just anonymous functions as implicit parameters. if you make them explicit it becomes clear ^^
<fuzzyhorns> elomatreb: true, true
<elomatreb> toretore: You lose some performance from that though, since it needlessly creates a full Proc instance
hahuang65 has joined #ruby
<toretore> >> def foo(b); b.call('hello'); end; f = ->(msg){ puts msg }; foo(f) #without any magic sparr
<sparr> toretore: I'm dealing with a method that already exists and wants an implicit block
<ruby[bot]> toretore: # => hello ...check link for more (https://eval.in/741259)
<allisio> sparr: Then you'll want to pass along `&some_proc`.
<sparr> I can't change how Deck.new works
Burgestrand has joined #ruby
<allisio> I mean, you can... this is Ruby.
rafadc has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
millerti has joined #ruby
milardovich has joined #ruby
<sparr> I'd like to not change how Deck.new works because the person using MY library might still want to call Deck.new on their own later and expect it to still work the same
<elomatreb> But you don't need to, "turning a Proc into a block" how we described is probably your best option
<sparr> I'm trying to wrap my head around all the examples everyone has just given
millerti has quit [Client Quit]
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
<allisio> sparr: Sure, and its current signature of (Hash, &block) makes a great deal of sense.
montanonic has quit [Ping timeout: 255 seconds]
<elomatreb> toretore: "blocks are just anonymous functions as implicit parameters", the Ruby version of "monads are monoids in the category of endofunctors"
dionysus69 has joined #ruby
<allisio> But with considerably greater informational content.
<sparr> ok, so, in my make_deck, there's an implicit block parameter
<sparr> in the definition of make_deck, how do I call that block?
<allisio> Most performant is `yield`.
<toretore> `yield` calls the implicit function
<sparr> yield is how I guessed, and what I put in my example
hahuang65 has quit [Ping timeout: 260 seconds]
oetjenj_ has joined #ruby
<allisio> sparr: If you don't mind putting the "stuff that always gets called" right there in #make_deck (in the call to Deck.new), then you essentially just need to consider putting the `yield` at the end instead.
Lyubo1 has joined #ruby
rafadc has joined #ruby
ElFerna has joined #ruby
sepp2k has joined #ruby
milardovich has quit [Ping timeout: 268 seconds]
<sparr> allisio: I need the yield to come first, not last
<sparr> the stuff that always gets called gets called after the per-deck stuff
ikopico has joined #ruby
marxarelli|afk is now known as marxarelli
<allisio> sparr: And you're quite sure that's what you want?
xall has quit [Ping timeout: 255 seconds]
marxarelli has joined #ruby
<sparr> yes. among the stuff that always gets called is the "save the per-deck stuff to a file" call
raspado has quit [Remote host closed the connection]
<allisio> Sounds like what you really need is a sandwich.
<allisio> Some prologue and epilogue, to clarify.
raspado has joined #ruby
flips has joined #ruby
oetjenj has quit [Ping timeout: 255 seconds]
Slinky_Pete has joined #ruby
bkxd has joined #ruby
rafadc has quit [Client Quit]
<sparr> I'm gonna shelve this question for a bit and hope it makes more sense to me later
<allisio> It's just that you probably want the block passed to #make_deck to be able to perform overrides in the same way as they're able to override values in the constructing Hash.
<sparr> thanks for all the input, I just need to think about a different part of the problem for a bit
jhack has joined #ruby
jhack has quit [Client Quit]
ElFerna has quit [Client Quit]
workmad3 has quit [Ping timeout: 260 seconds]
matcouto has joined #ruby
raspado has quit [Client Quit]
samdvr has joined #ruby
szulak has joined #ruby
<flips> With rvm, do I need to separate do a "rvm gemdir" after I've done "rvm [use] <some other version>"?
elifoster has quit [Quit: class]
<sparr> now I'm thinking about how to make all of this work as a gem. Should I make a new module, like Squib_FOO, or should I augment the Squib module? Either way, should I stick with one Deck class that takes parameters on construction, or should I make one class for each size deck that all inherit from a generic deck?
jhack has joined #ruby
samdvr has left #ruby [#ruby]
jhack has quit [Client Quit]
__Yiota has joined #ruby
benlieb has joined #ruby
nowhereman has quit [Ping timeout: 260 seconds]
<sparr> does the name of a module need to be the same (ignoring case) as its gem?
last_staff has joined #ruby
<fuzzyhorns> sparr: there's a convention
<fuzzyhorns> sec
cschneid_ has quit [Remote host closed the connection]
<elomatreb> It's just a convention though, you can break it if it makes sense for you
<sparr> I did read that, but part of it was confusing...
<sparr> If you’re adding functionality to another gem, use a dash. This usually corresponds to a / in the require statement (and therefore your gem’s directory structure) and a :: in the name of your main class or module.
hllywluis has joined #ruby
<sparr> rdoc-data require 'rdoc/data' RDoc::Data
ElFerna has joined #ruby
<sparr> say I want to publish rdoc-data, but I'm not the author of rdoc. wouldn't that mean my gem can't live in rdoc/ ?
Kug3lis has joined #ruby
<elomatreb> It can, those are two different directories on your system
certainty has joined #ruby
jpleau has left #ruby ["WeeChat 1.5"]
Kug3lis has quit [Client Quit]
matcouto has quit [Quit: Textual IRC Client: www.textualapp.com]
<certainty> evening
<sparr> elomatreb: give me a fuzzified example of where `require 'rdoc'` gets its files and where `require 'rdoc/data'` gets its files?
<elomatreb> Somewhere on your system there is a folder in which your gems are installed
<sparr> those *look* like they would be referring to the same /foo/bar/ruby/lib/gems/blah/rdoc/
<elomatreb> In this directory, there are the two directories "rdoc" (from the actual rdoc gem) and "rdoc-data" (from the rdoc-data gem)
hahuang65 has joined #ruby
lenwood has quit [Ping timeout: 260 seconds]
<elomatreb> In each of those directories, there are lib/ directories, which are added to the paths require searches for the file you give it
matcouto has joined #ruby
<elomatreb> And in these lib directories, there are two different "rdoc" directories
vasilakisfil has quit [Quit: Konversation terminated!]
username_ has joined #ruby
nobody72 has quit [Quit: nobody72]
<elomatreb> I.e. $gem_dir/rdoc/lib/rdoc/somefile.rb and $gem_dir/rdoc-data/lib/rdoc/data/somefile.rb
<allisio> sparr: The word/notion you're looking for is `$LOAD_PATH`.
montanonic has joined #ruby
<sparr> so what happens if the rdoc gem gets updated so that it includes a data subdirectory?
<elomatreb> Oh, I skipped something, sorry
jgnagy has joined #ruby
<elomatreb> When you do `require "rdoc/data"`, you require $gem_root/lib/rdoc/data.rb (A file, not a directory)
<elomatreb> */lib/rdoc-data
flips has left #ruby ["WeeChat 1.5"]
<elomatreb> Similarly, if you do `require "rdoc"` you require the file $gem_root/rdoc/lib/rdoc.rb
safetypin has joined #ruby
hllywluis has quit [Quit: Textual IRC Client: www.textualapp.com]
bruce_lee has quit [Remote host closed the connection]
jgnagy has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
<sparr> I still don't understand, but maybe I don't have to
nofxxx has joined #ruby
<elomatreb> I'm bad at explaining, sorry :(
<sparr> so, if I want bundler to automatically handle my gem that has an all-caps acronym in its name, I might name it a_b_c so that the module would be ABC?
ElFerna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Burgestrand has quit [Quit: Closing time!]
<sparr> to make this less abstract... Squib is the gem for making game card decks
Rodya_ has joined #ruby
<elomatreb> If your module is named ABC your gem should be named "abc" I'd say
<sparr> I want to extend Squib to handle layouts for a particular game publishing company, The Game Crafter. thegamecrafter is way too long to keep typing, so I'm thinking I want this to be squib-tgc squib/tgc Squib::TGC
nofxx has quit [Ping timeout: 255 seconds]
<sparr> but the naming page says that 'tgc' capitalizes to 'Tgc' while t_g_c capitalizes to 'TGC'
<elomatreb> I *think* that's supposed to be for using a module name that consists of multiple words, e.g. StuffDoer
<sparr> yeah, maybe I should just break the recommendations in this case?
<elomatreb> I personally don't find TheGameCrafter too bo too long to type, your editor will autocomplete after the first time
aspiers has quit [Ping timeout: 255 seconds]
<allisio> sparr: You probably shouldn't put your thing in Squib's namespace.
Slinky_Pete has quit []
Rodya_ has quit [Ping timeout: 255 seconds]
<sparr> my thing is useless without Squib, and strictly extends Squib functionality
millerti has joined #ruby
ElFerna has joined #ruby
Rodya_ has joined #ruby
Rodya__ has joined #ruby
nobitanobi has joined #ruby
ldnunes has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Xentil has quit [Ping timeout: 268 seconds]
Rodya_ has quit [Ping timeout: 260 seconds]
cdg_ has joined #ruby
_aeris_ has quit [Remote host closed the connection]
ElFerna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<sparr> I could, instead, make a top level module that replaces Squib?
<sparr> (depends on squib, then provides augmented versions of everything Squib provides)
nobitanobi has quit [Ping timeout: 240 seconds]
ElFerna has joined #ruby
ElFerna has quit [Client Quit]
prestorium has quit [Quit: Leaving]
cdg has quit [Ping timeout: 268 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
mrgrieve1 has quit [Quit: leaving]
rafadc has joined #ruby
jenrzzz has joined #ruby
Burgestrand has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
esObe has joined #ruby
ElFerna has joined #ruby
rafadc has quit [Client Quit]
renchan has quit [Remote host closed the connection]
Klumben has quit [Ping timeout: 245 seconds]
alem0lars has quit [Ping timeout: 276 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
_aeris_ has joined #ruby
aspiers has joined #ruby
ElFerna has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rwb has quit [Ping timeout: 240 seconds]
bdnelson has joined #ruby
whathapp_ has quit [Remote host closed the connection]
Gasher has joined #ruby
whathappens has joined #ruby
bdnelson has left #ruby [#ruby]
tyang__ has quit [Ping timeout: 268 seconds]
alem0lars has joined #ruby
cschneid_ has joined #ruby
milardovich has joined #ruby
cdg has joined #ruby
whathappens has quit [Ping timeout: 260 seconds]
bkxd has quit [Ping timeout: 260 seconds]
griffindy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid_ has quit [Ping timeout: 240 seconds]
aspiers has quit [Ping timeout: 268 seconds]
biberu has quit []
cdg_ has quit [Ping timeout: 260 seconds]
postmodern has joined #ruby
griffindy has joined #ruby
griffindy has quit [Read error: Connection reset by peer]
_2easy_ has quit [Quit: Lost terminal]
synthro__ has quit []
nowhereman has joined #ruby
millerti has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
_2easy has joined #ruby
skweek has joined #ruby
t-recx has quit [Quit: t-recx]
teclator has quit [Ping timeout: 260 seconds]
hahuang61 has joined #ruby
teclator has joined #ruby
Klumben has joined #ruby
Karl____ has joined #ruby
t-recx has joined #ruby
<Karl____> I'm having the weirdest error. I'm trying to read from a file with file.getc(). The only thing I ever do on the file is open() and getc(). Yet somehow I get the same text twice (but with an extra \" at the end)
tau has quit [Remote host closed the connection]
tomphp has joined #ruby
<Karl____> I'm probably just being stupid somehow, but I can't for my life figure out how. The thing I described is not expected behavior, right?
antgel has quit [Ping timeout: 260 seconds]
<Karl____> I tried printing each char with file.pos() next to it, file.pos() is monotonely rising, but when I look at the corresponding lines it looks like they have rewinded until the last eol
JeanCarloMachado has quit [Ping timeout: 260 seconds]
<toretore> Karl____: code?
<toretore> ?gist
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Tech has quit [Quit: Leaving]
KCmetro_ has quit [Remote host closed the connection]
<Karl____> toretore: I'll try to clean out the worst unnecessary code, brb
<allisio> Karl____: Are you reading a file with Windows line endings on a system that expects Unix ones?
<allisio> Printing the '\r' character will return the cursor to the beginning of the line.
hanmac has joined #ruby
<Karl____> allisio: really? printing it to anyware?
<allisio> Karl____: Printing it to any non-Windows console, at any rate.
<Papierkorb> Karl____: "\r" is 'carriage return'. It's job is to move the cursor back to column 0 of the current line
<Papierkorb> *its
<allisio> *column 1
markholmes has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
Rodya__ has quit [Remote host closed the connection]
<Karl____> I'm running it in atom on windows, via the "script" plugin, so it's highly possible that something like that is happening
jtdoncas has quit [Ping timeout: 268 seconds]
<Karl____> I tried removing all the debug prints in the code and now it looks wrong, but in a different way
<Karl____> so I think you're on to something
ResidentBiscuit has joined #ruby
Rodya_ has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
aspiers has joined #ruby
<allisio> Karl____: Yeah, '\r' is almost certainly the culprit. The simplest fix would be to check each character before printing and skip over carriage returns.
<allisio> At least, you'll get sane output that way.
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has quit [Ping timeout: 240 seconds]
<Papierkorb> Or, considering this is a toy program, just call #inspect on the character before outputting it
hahuang61 has quit [Remote host closed the connection]
jhack has joined #ruby
hellowarz has joined #ruby
hahuang61 has joined #ruby
blackwind_123 has quit [Ping timeout: 268 seconds]
jtdoncas has joined #ruby
montanonic has quit [Ping timeout: 260 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
astrobunny has joined #ruby
blackwind_123 has joined #ruby
mikecmpbll has joined #ruby
millerti has joined #ruby
cdg has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
oetjenj_ has quit [Quit: Textual IRC Client: www.textualapp.com]
tuelz has quit [Quit: WeeChat 1.7]
cdg has joined #ruby
Xiti has quit [Quit: Xiti]
minimalism has joined #ruby
Burgestrand has quit [Quit: Closing time!]
montanonic has joined #ruby
ikopico_ has joined #ruby
szulak has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
benlieb has quit [Quit: benlieb]
sepp2k has quit [Read error: Connection reset by peer]
ElFerna has joined #ruby
montanonic has quit [Ping timeout: 260 seconds]
KCmetro has joined #ruby
ElFerna has quit [Client Quit]
whathappens has joined #ruby
jgar has quit [Quit: Page closed]
case__ has quit [Remote host closed the connection]
rwb has joined #ruby
bkxd has joined #ruby
gloscombe_ has joined #ruby
Gasher has quit [Quit: Leaving]
ElFerna has joined #ruby
jose_leeto has quit [Quit: Leaving.]
ikopico has quit [Quit: WeeChat 1.7]
ikopico_ is now known as ikopico
ElFerna has quit [Client Quit]
maattdd_ has joined #ruby
ResidentBiscuit has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 255 seconds]
mim1k has quit [Ping timeout: 260 seconds]
polishdub has quit [Quit: Leaving]
blackmesa has quit [Ping timeout: 240 seconds]
fuzzyhorns has quit [Quit: Leaving.]
Xiti has joined #ruby
t-recx has quit [Quit: t-recx]
t-recx has joined #ruby
jenrzzz has joined #ruby
astrobunny has quit [Ping timeout: 240 seconds]
minimalism has quit [Quit: minimalism]
arch___ has joined #ruby
arch___ has quit [Excess Flood]
arch___ has joined #ruby
arch___ has quit [Excess Flood]
arch___ has joined #ruby
arch___ has quit [Excess Flood]
arch___ has joined #ruby
arch___ has quit [Excess Flood]
arch___ has joined #ruby
arch___ has quit [Excess Flood]
CloCkWeRX has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
ikopico has quit [Quit: ZNC - http://znc.in]
boombox_ has joined #ruby
interki has quit [Ping timeout: 260 seconds]
nowhereman has quit [Ping timeout: 260 seconds]
TomyLobo has quit [Ping timeout: 255 seconds]
Karl____ has quit [Remote host closed the connection]
dionysus69 has joined #ruby
jackjackdripper has joined #ruby
case_ has joined #ruby
milardovich has quit []
CloCkWeRX has quit [Ping timeout: 260 seconds]
t-recx has quit [Quit: t-recx]
t-recx has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
safetypin has quit [Quit: Textual IRC Client: www.textualapp.com]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
ur5us has quit [Remote host closed the connection]
aonghusflynn has joined #ruby
boombox_ has quit [Remote host closed the connection]
boombox_ has joined #ruby
t-recx has quit [Client Quit]
jhack has quit [Quit: jhack]
t-recx has joined #ruby
aonghusflynn has left #ruby [#ruby]
boombox_ has quit [Ping timeout: 260 seconds]
gsilva has joined #ruby
t-recx has quit [Quit: t-recx]
t-recx has joined #ruby
Ishido has quit [Remote host closed the connection]
ramortegui has quit [Quit: Ex-Chat]
ur5us has joined #ruby
minimalism has joined #ruby
CloCkWeRX has joined #ruby
jcao219 has joined #ruby
toretore has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
nobitanobi has joined #ruby
benlieb has joined #ruby
saneax-_-|AFK is now known as saneax
Burgestrand has joined #ruby
teclator has quit [Quit: No Ping reply in 180 seconds.]
nobitanobi has quit [Ping timeout: 268 seconds]
jackjackdripper has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
teclator has joined #ruby
t-recx has quit [Quit: t-recx]
redhedded1 has quit [Quit: Textual IRC Client: www.textualapp.com]
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
jhack has joined #ruby
enterprisey has quit [Read error: Connection reset by peer]
MasterNayru has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
bkxd has quit [Ping timeout: 260 seconds]
anotherpi has joined #ruby
<anotherpi> hello everyone!
<anotherpi> i have a problem with minitest :(
<anotherpi> i have a test class, with many test method
<anotherpi> but test methods do not run to their end
<anotherpi> it seems to `return` after the first assertion
mtkd has quit [Ping timeout: 260 seconds]
<anotherpi> weird!
charliesome has joined #ruby
<matthewd> Is the assertion failing?
bmurt has joined #ruby
TPug has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
myk267 has quit [Read error: Connection reset by peer]
<anotherpi> i don't think so
<anotherpi> the minitest report say everything is ok
<anotherpi> -> 10 runs, 13 assertions, 0 failures, 0 errors, 0 skips
<anotherpi> but i have a lot more assertions
<allisio> anotherpi: Are you perhaps invoking Kernel#exit?
<anotherpi> allisio: mmh nop
<anotherpi> may it's my configuration
mtkd has joined #ruby
<matthewd> anotherpi: It's the return in def_visit -- it's not doing what you think it's doing
<anotherpi> lol, it's late
<anotherpi> i did too much JS this week, sorry about that
<matthewd> No worries! Happy to help anyone who knows to show code without being prompted :)
Rodya_ has quit [Remote host closed the connection]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
GeorgeTorwell has joined #ruby
SuperLag has joined #ruby
ur5us has joined #ruby
hutch34 has quit [Ping timeout: 240 seconds]
myk267 has joined #ruby
kirun has quit [Quit: Konversation terminated!]
patarr_ has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
patarr has quit [Ping timeout: 240 seconds]
jhack has quit [Quit: jhack]
s0l__ has quit [Read error: Connection reset by peer]
Rodya_ has joined #ruby
patarr_ has quit [Ping timeout: 240 seconds]
dionysus69 has quit [Ping timeout: 240 seconds]
Immune has quit [Quit: ZzzZZZzzzz]
hutch34 has joined #ruby
s0l__ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
last_staff has quit [Quit: last_staff]
Rodya_ has joined #ruby
teclator has quit [Ping timeout: 240 seconds]