havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: 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
JohnDorian has joined #ruby
<craysiii> so im trying to create a gem to be used in another project, i created .gemspec, built the gem, and installed it successfully, but i can't seem to require it?
kies has quit [Ping timeout: 268 seconds]
<craysiii> also im trying to require it in a irb session
hutch34 has quit [Ping timeout: 255 seconds]
im0nde has quit [Read error: Connection reset by peer]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
boombox_ has joined #ruby
<havenwood> craysiii: You tried?: require 'roleplayagent'
<havenwood> craysiii: You ran?: gem install roleplayagent-0.0.1.gem
<havenwood> craysiii: Sanity check that it's installed: gem which roleplayagent
<craysiii> yes, i must give backstory. I actually got it to work before by doing require cinch then require roleplayagent, then I changed the gemspec file to include the dependencies when i do require roleplayagent, now it wont work
<craysiii> ok will do
Larahero has quit [Quit: http://www.kiwiirc.com/ - A hand crafted IRC client]
<craysiii> huh..
<craysiii> not there
rkazak has quit [Quit: Sleep.....ing....]
<craysiii> hmm.. could rebuilding the gem have caused it to uninstall itself?
milardovich has quit []
Xandaros has quit [Remote host closed the connection]
brent__ has quit [Remote host closed the connection]
TomyLobo has quit [Ping timeout: 255 seconds]
normie1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brent__ has joined #ruby
devyn has quit [Remote host closed the connection]
<craysiii> also does adding a runtime dependency to a gemspec not fix the issue of having to require gem dependencies before the gem?
normie1 has joined #ruby
cfec0b8d has quit [Remote host closed the connection]
troys_ is now known as troys
<zenspider> "issue of having to require gem dependencies before the gem"?
<zenspider> what does that mean to you?
brent__ has quit [Ping timeout: 246 seconds]
normie1 has quit [Client Quit]
<craysiii> yeah thats a shit sentence sorry
<zenspider> dependencies and requires are completely separate unless you muck shit up with things like bundler
boombox_ has quit [Remote host closed the connection]
<zenspider> which I don't recommend, especially for a gem
<craysiii> i see, thanks
Guest69 has joined #ruby
Asher has quit [Quit: Leaving.]
ecuanaso has joined #ruby
jrafanie has joined #ruby
Asher has joined #ruby
railswebdev has joined #ruby
jrafanie has quit [Client Quit]
Xandaros has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
BSaboia has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
gusrub has quit [Remote host closed the connection]
Cohedrin has joined #ruby
<stormbytes> anyone familiar with open3.capture3 syntax?
<stormbytes> i'm wanting to execute something like... mycommand -o foo -p bar somefile.txt
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<stormbytes> can't understand how to do that (from the docs)
DeeJayh has joined #ruby
robouk has joined #ruby
DeeJayh_ has quit [Ping timeout: 255 seconds]
DeeJayh__ has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
hutch34 has joined #ruby
ecuanaso has joined #ruby
gusrub has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
nitric has quit [Ping timeout: 260 seconds]
DeeJayh has quit [Ping timeout: 246 seconds]
charliesome has joined #ruby
jusa has joined #ruby
belmoussaoui_ has joined #ruby
t-recx has quit [Quit: t-recx]
jusa has quit [Ping timeout: 240 seconds]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
belmoussaoui has quit [Ping timeout: 245 seconds]
oliv_____ has joined #ruby
apparition has joined #ruby
quazimodo has joined #ruby
ace05 has joined #ruby
ace05_ has quit [Ping timeout: 260 seconds]
Guest69 has joined #ruby
railswebdev has joined #ruby
gothicsouth has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jgt has quit [Ping timeout: 272 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
Kug3lis is now known as Kug3lis_off
ahrs has quit [Remote host closed the connection]
hahuang65 has joined #ruby
ahrs has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
bousquet has joined #ruby
x0f has quit [Ping timeout: 240 seconds]
gothicsouth has joined #ruby
rohitpaulk has joined #ruby
patarr has joined #ruby
demio has joined #ruby
mim1k has joined #ruby
Blaze has joined #ruby
Blaze is now known as Guest50890
shinnya has quit [Ping timeout: 268 seconds]
x0f has joined #ruby
devyn has joined #ruby
patarr has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 240 seconds]
cam27 has quit [Ping timeout: 245 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gusrub has quit [Remote host closed the connection]
<stormbytes> how to use open3.capture3 to pass a command with options ?
agent_white has joined #ruby
DenSchub is now known as oschub
bruce_lee has quit [Ping timeout: 268 seconds]
Guest50890 is now known as _blaze_
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
rohitpaulk has quit [Ping timeout: 240 seconds]
gusrub has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
_blaze_ has quit []
uZiel has joined #ruby
Guest69 has joined #ruby
d^sh_ has joined #ruby
Xiti has quit [Quit: Xiti]
Kug3lis_off is now known as Kug3lis
Kug3lis is now known as Kug3lis_off
GodFather has quit [Ping timeout: 260 seconds]
mim1k has joined #ruby
Xiti has joined #ruby
railswebdev has joined #ruby
d^sh has quit [Ping timeout: 268 seconds]
KCmetro has joined #ruby
jrafanie has joined #ruby
belmoussaoui_ has quit [Quit: belmoussaoui_]
belmoussaoui has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
bousquet has quit []
TheHodge has quit [Quit: Connection closed for inactivity]
robouk has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
robouk has joined #ruby
oliv_____ has quit [Remote host closed the connection]
mitt3ns has joined #ruby
oliv_____ has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agent_white has quit [Ping timeout: 260 seconds]
pugcs has joined #ruby
rohitpaulk has joined #ruby
gusrub has quit [Remote host closed the connection]
quobo has quit [Quit: Connection closed for inactivity]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jameser has joined #ruby
pugcs has quit [Quit: Page closed]
KCmetro has quit [Quit: Leaving...]
patarr has joined #ruby
GinoMan2440 has joined #ruby
GinoMan2440 has quit [Remote host closed the connection]
GinoMan2440 has joined #ruby
cam27 has joined #ruby
herbmillerjr has joined #ruby
genpaku has quit [Remote host closed the connection]
Pongles has quit [Quit: Leaving]
<zenspider> stormbytes: the doco for capture3 has almost nothing BUT examples involving options.
patarr has quit [Ping timeout: 240 seconds]
<zenspider> And the syntax is ruby. It's always ruby. </pet-peeve>
<stormbytes> zenzpider can you point one out that shows how to employ capture3 with a command that has flags and options?
genpaku has joined #ruby
<stormbytes> eg. myscript --foo bar -p -q /some/path/to/file
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider> ri Open3.capture3 | grep capture3\(\"
<zenspider> hrm.. for some reason I get that data twice. I wonder what is borked
<zenspider> huh. yeah. I get the exact same entry twice
<stormbytes> pretty cryptic..
<stormbytes> what does this mean: :stdin_data=>"foo\nbar\nbaz\n"
<zenspider> not sure what is cryptic
<stormbytes> i get that stdin_data is being passed to the command.. but i don't understand the format or how to construct it
<stormbytes> ---->"foo\nbar\nbaz\n" <----
<stormbytes> what does that say in plain english?
<zenspider> it says foo newline bar newline baz newline
<stormbytes> dang..
<stormbytes> i thought it was some opt-flag+value array
<stormbytes> what am I not getting here?
enterprisey has joined #ruby
<stormbytes> can open3.capture3 NOT handle command options and values?
<zenspider> I can't tell you what you're not getting.
<stormbytes> how would you put this command line into open3.capture3 terms :
<stormbytes> myscript --foo bar -p -q /some/path/to/file
normie1 has joined #ruby
<stormbytes> or does all that just go into :stdin_data
<zenspider> what about this are you tripping up on?
<zenspider> capture3(*cmd, stdin_data: '', binmode: false, **opts)
<stormbytes> I'm trying to do this:
<stormbytes> rd ports -i <var>
<stormbytes> I have it this way
<stormbytes> Open3.capture3("rd ports", :stdin_data => "-i #{options[:index]}")
<stormbytes> it works, but.. i thought the whole point of capture3 was to avoid stuff like #{}
<stormbytes> what's '**opts' in your example?
<stormbytes> i guess i'm wondering if theres some way of passing a hash or an array with options.. i dunno
<stormbytes> if its all about building up the :stdin_data string I can do that too
troys is now known as troys_
<quazimodo> hi all
jrafanie has joined #ruby
<quazimodo> Curious to know, is it possible to build ruby gems via bundler into a /path/to/bundle directory (including using native extensions) then copy the directory into another identical machine/vm minus all the build time packages like make, etc. and have it run?
<quazimodo> essentially, i'm tired of my rails docker image being 1.4gigs
<quazimodo> i'd like to build everything in one image, once it's done building just copy it all over into another image and be done with it
<quazimodo> any thought?
jrafanie has quit [Client Quit]
oschub is now known as DenSchub
roamingdog has joined #ruby
<zenspider> quazimodo: if it is docker, you could build one image with your stuff and then declare that your base image, no?
<quazimodo> zenspider: still makes everything huge
<zenspider> and as far as build time dependencies go... you can either remove the build deps in the same cmd that added them so they don't take up space, or you can use the new experimental --squash option
<quazimodo> so, for example, a change in gems needed would mean the base image changes, and once again i'm pushing huge diffs up
<quazimodo> didn't see squash
<zenspider> the former is something like: CMD pkg add x y z && bundle && pkg del y z
<quazimodo> yeah I get that
<quazimodo> but it means doing a _lot_ in one command
<zenspider> I'm working for a client that is using a very old version of node so they have to build their own... the CMD is probably 30 lines long (formatted well)
<zenspider> a newer version would be ~30 CMDS and the docker build cmd would use --squash
<quazimodo> i have to understand squash first
<zenspider> it's basically the same thing... later deletes are able to affect the final image
<quazimodo> right
<zenspider> the intermediates will be fat tho
<quazimodo> so my build machine will hold the huge images, but the final image pushed into registry will be minimal
<zenspider> should be, yeah
<stormbytes> zenspider what kind of arguments does capture3 take? I get the first one is the command, but what is :stdin_data => string? is that a hash ?
<stormbytes> without braces
jusa has joined #ruby
HoierM has quit [Ping timeout: 240 seconds]
Bhootrk_ has joined #ruby
Bhootrk_ has quit [Max SendQ exceeded]
kies has joined #ruby
rohitpaulk has quit [Ping timeout: 260 seconds]
demio has quit [Quit: Computer has gone to sleep.]
Guest69 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<zenspider> stormbytes: it's literally named as to what it takes. I really don't get your confusion... To the point where I had to ask others if you were a troll given this and our interactions this weekend.
jusa has quit [Ping timeout: 272 seconds]
demio has joined #ruby
<quazimodo> lol
agent_white has joined #ruby
<stormbytes> ok nevermind
<zenspider> just in case: "stdin" translates to "standard input"
demio has quit [Client Quit]
<quazimodo> that's amazing
<quazimodo> seriously
<quazimodo> what kind of arguments does capture3 take?...it's literally named as to what it takes.
demio has joined #ruby
rohitpaulk has joined #ruby
* zenspider shrugs
<stormbytes> seriously dude, what is up with the ad hominem attacks? This is a ruby channel. i'm asking questions about Ruby. its in't my fault if you are just oh-so-smart that you find my questions "trolling"
demio has quit [Client Quit]
railswebdev has joined #ruby
yottanami_ has joined #ruby
dlitvak has joined #ruby
<stormbytes> I'm not as "gifted" as you must be, and I would appreciate if you would quit it with the abusive language and the bullying
<zenspider> 0) ad hominem: (of an argument or reaction) directed against a person rather than the position they are maintaining.... 1) there are no attacks above. 2) you don't seem to have a position that you're maintaining 3) the only person who's attacking at this point is you.
mitt3ns has quit [Ping timeout: 240 seconds]
marxarelli is now known as marxarelli|afk
<stormbytes> zenspider moving forward, either offer assistance of kindly move along and feel free to ignore my questions. I'm not looking to be the object of your abusive remarks.
<zenspider> again... the only person attacking right now... is YOU
* baweaver sighs
<baweaver> enough
<zenspider> I pointed out, again, that the arguments are literally named as to what they take and you claimed abuse.
<baweaver> stormbytes: you need to read through the documentation, slowly
<stormbytes> I don't know what 'attacks' you perceive. Im' not attacking you I'm pointing out that I've had it with your rude, condescending and downright abusive treatment.
roamingdog has quit [Ping timeout: 260 seconds]
<zenspider> stop conflating abuse with shit you don't like
<baweaver> you've not been abused.
<stormbytes> Its your call if you want to contribute an answer to anyones question, but finding a question silly or simplistic does NOT give you the right to abuse the person and call them names as you've been doing repeatedly to me
<baweaver> and I've not seen any name calling either.
yottanami_ has quit [Ping timeout: 240 seconds]
<stormbytes> so like i said, feel free to ignore my questions. I have just as much right to be here and I don't deserve to be called names or otherwise mistreated. You've been warned.
<zenspider> strike 2...
<baweaver> stormbytes: enough
<baweaver> No one has abused you or called you names
<stormbytes> scroll up
<baweaver> I did
<stormbytes> not far enough
<stormbytes> he's been calling me a troll and implied that he's included others in discussing this, for no reason other than my asking simple questions relating to ruby
<stormbytes> feel free to search through the channel logs, you'll see it
<baweaver> He discussed it with me
<stormbytes> frankly i'm floored that this sort of thing is tolerated
<baweaver> and I simply said you had difficulty understanding things.
<baweaver> I can look up past logs later, but at this moment you're the one that's out of line
<baweaver> and it stops now
<stormbytes> what exactly is "out of line"
<stormbytes> what *specifically* stops now?
<zenspider> conflating abuse with shit you don't like is "out of line". I'm literally reading a book right now titled "Conflict is not Abuse"... good timing
<stormbytes> i've no interest in discussing this any further. I'm here to learn ruby and engage with others in that effort. Either address me respectfully or please ignore my questions altogether. The end.
<zenspider> and I'd say what specifically stops is your tirade. BS like you line above with "You've been warned"
<stormbytes> baweaver as for my question, I don't entirely understand the arguments that open3.capture3 takes
<stormbytes> I get the first parameter is the command to be executed. Whats the next one?
belmoussaoui has quit [Quit: belmoussaoui]
belmoussaoui has joined #ruby
<havenwood> stormbytes: The Open3#capture3 docs point to Open3#popen3 which say "If the last parameter, opts, is a Hash, it is recognized as an option for Process.spawn."
<havenwood> stormbytes: Those docs are here: https://ruby-doc.org/core/Process.html#method-c-spawn
<havenwood> stormbytes: I'd suggest the Process::spawn docs.
<havenwood> stormbytes: Link ^ above.
<zenspider> of course the cafe network goes dead mid-argument... :P
<stormbytes> I did see that
<stormbytes> this is greek to me
normie1 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<stormbytes> i want to know how to convert a regular bash command into a format that open3.capture3 takes
charliesome has joined #ruby
<stormbytes> so somecommand --port 3 -u me -p mypwd /some/file.txt
<stormbytes> with back ticks or system() its straight forward but apparently open3 is the way to go
oliv_____ has quit [Remote host closed the connection]
<havenwood> stormbytes: stdout, stderr, status = Open3.capture3("somecommand --port 3 -u me -p mypwd /some/file.txt")
olivi____ has joined #ruby
<stormbytes> havenwood i got that.. but i thought there was some way to pass the arguments and options as some data structure (array, hash, etc)
<stormbytes> so.. my bad, i guess i'm not approaching this correctly
<stormbytes> because its going to end up as stdout, stderr, status = Open3.capture3("somecommand --port #{port} -u #{user} -p #{mypwd} #{file} ")
<zenspider> FUCK... the cafe network is terrible. went home.
<zenspider> havenwood: I'm not sure I would... the spawn docs are really thick
<stormbytes> and I've read pretty much everywhere that this is bad practice
<stormbytes> the other way that works is this stdout, stderr, status = Open3.capture3("rd ports", :stdin_data => "-i #{options[:index]}")
<stormbytes> but i'm just geussing
olivi____ has quit [Ping timeout: 240 seconds]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<zenspider> guaranteed that doesn't work
<zenspider> oooh I didn't even notice the dramatic #ops maneuver :P
gix has quit [Ping timeout: 268 seconds]
raspado has joined #ruby
rohitpaulk has quit [Ping timeout: 246 seconds]
ace05 has quit [Remote host closed the connection]
<zenspider> stormbytes: what is bad practice specifically?
gix has joined #ruby
<stormbytes> as I understand it, allowing variable interpolation inside command line arguments
<zenspider> why?
<stormbytes> eg. ls #{directory}
<stormbytes> my guess is it opens things up to malicious code?
<zenspider> are you in charge of the value in `directory`?
jgt has joined #ruby
<stormbytes> well, yeah.. which is kind of how I saw it, but I thought it would be best to learn how to conform to best practices
<stormbytes> this has been a 3+ hour pita now.. I'm not looking for the adventure
<stormbytes> i'm going to keep it simple for now and possibly revisit/refactor this once I have a better handle on things
<zenspider> malicious code doesn't just appear. it has to have a vector.
<stormbytes> right, and i'm not sure my little script warrants all this footwork, but I saw it as a learning experience
<zenspider> you might want to ri Process.spawn and look at the different forms that the command can have
<stormbytes> I bookmarked it in the docs, will look that over when I've got more brain power
<stormbytes> btw, the other day.. your Number() example was spot on
<stormbytes> I looked it over the following morning, tested a bit and used the suggestion. I was initially thrown off by the use of being/rescue but read up on it
<stormbytes> *begin, not being
raspado has quit [Remote host closed the connection]
jgt has quit [Ping timeout: 268 seconds]
DaniG2k has joined #ruby
theunraveler has joined #ruby
theunraveler has quit [Remote host closed the connection]
uZiel has quit [Ping timeout: 248 seconds]
rohitpaulk has joined #ruby
safetypin has joined #ruby
donald has quit [Quit: Leaving.]
alveric1 has quit [Quit: WeeChat 1.8]
jusa has joined #ruby
troys_ is now known as troys
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
postmodern has quit [Quit: Leaving]
mim1k has joined #ruby
Guest69 has joined #ruby
railswebdev has joined #ruby
mim1k has quit [Ping timeout: 246 seconds]
DaniG2k has quit [Quit: leaving]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
charliesome has joined #ruby
ace05 has joined #ruby
hutch34 has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rohitpaulk has quit [Ping timeout: 246 seconds]
hutch34 has quit [Ping timeout: 268 seconds]
Guest69 has joined #ruby
railswebdev has joined #ruby
mim1k has joined #ruby
mitt3ns has joined #ruby
safetypin has quit [Quit: ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
agent_white has quit [Ping timeout: 246 seconds]
mim1k has quit [Ping timeout: 240 seconds]
agent_white has joined #ruby
mitt3ns has quit [Ping timeout: 246 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
GinoMan2440 has quit [Ping timeout: 255 seconds]
GinoMan2440 has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
mitt3ns has joined #ruby
meshsmith has joined #ruby
renchan has joined #ruby
meshsmith has quit [Read error: Connection reset by peer]
agent_white has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
meshsmith has joined #ruby
roamingdog has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
roamingdog has quit [Ping timeout: 240 seconds]
* dminuoso wants Kernel#malloc
jenrzzz has joined #ruby
dionysus69 has joined #ruby
uZiel has joined #ruby
rohitpaulk has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
<matthewd> dminuoso: Not much you could do with it without ffi
<dminuoso> matthewd: But I am using fiddle left and right. :S
DTZUZU has quit [Quit: WeeChat 1.5]
<dminuoso> Trying to write C code in Ruby..
AnoHito_ has joined #ruby
<matthewd> `Kernel.send :include, Fiddle`, problem solved :P
nadir has quit [Quit: Connection closed for inactivity]
<dminuoso> Hehe.
dionysus69 has quit [Remote host closed the connection]
dc2 has joined #ruby
<matthewd> Oh, except for the module-inclusion-order thing. So `Object.include Fiddle` (why did I think include was private?)
AnoHito has quit [Ping timeout: 260 seconds]
dionysus69 has joined #ruby
<dminuoso> matthewd: Interestingly I keep making that same assumption.
<dminuoso> I mean it kind of makes sense, you shouldnt be able to mutate the inheritance chain *that* easily..
muelleme has joined #ruby
cfec0b8d has joined #ruby
<matthewd> I think it'd because define_method trips me up
<matthewd> Especially when Object#define_singleton_method is public :|
<dminuoso> :o
jenrzzz has quit [Ping timeout: 246 seconds]
ur5us has quit [Remote host closed the connection]
gothicsouth has joined #ruby
hanmac1 has left #ruby [#ruby]
hanmac has joined #ruby
JoshS has joined #ruby
meshsmith has quit [Remote host closed the connection]
dionysus69 has quit [Remote host closed the connection]
Bock has joined #ruby
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dionysus69 has joined #ruby
jgt has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby
ascarter_ has joined #ruby
jameser has quit [Read error: Connection reset by peer]
jameser has joined #ruby
jusa has quit [Ping timeout: 240 seconds]
muelleme has quit [Ping timeout: 268 seconds]
xall has joined #ruby
xall has quit [Client Quit]
aupadhye has joined #ruby
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
anisha has joined #ruby
anisha has quit [Remote host closed the connection]
roamingdog has joined #ruby
anisha has joined #ruby
oleo has quit [Quit: irc client terminated!]
ben__ has quit [Ping timeout: 268 seconds]
BSAlb has joined #ruby
BSAlb has quit [Max SendQ exceeded]
uZiel has quit [Ping timeout: 248 seconds]
BSAlb has joined #ruby
BSAlb has quit [Max SendQ exceeded]
ben__ has joined #ruby
BSaboia has quit [Ping timeout: 240 seconds]
BSAlb has joined #ruby
BSAlb has quit [Max SendQ exceeded]
BSAlb has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
rohitpaulk has joined #ruby
muelleme has joined #ruby
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
uZiel has joined #ruby
byte512_ has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
troys is now known as troys_
ace05 has quit [Remote host closed the connection]
ace05 has joined #ruby
byte512 has quit [Ping timeout: 240 seconds]
ace05 has quit [Remote host closed the connection]
BSaboia has joined #ruby
BSaboia has quit [Max SendQ exceeded]
Burgestrand has joined #ruby
BSAlb has quit [Ping timeout: 246 seconds]
BSaboia has joined #ruby
jameser has quit [Ping timeout: 240 seconds]
ltem has joined #ruby
jameser has joined #ruby
jaruga_________ has joined #ruby
jamesaxl has joined #ruby
Cohedrin has joined #ruby
psmolen has quit [Ping timeout: 245 seconds]
lel has quit [Ping timeout: 240 seconds]
duderonomy has quit [Ping timeout: 240 seconds]
AnoHito_ has quit [Ping timeout: 240 seconds]
cyphase has quit [Ping timeout: 245 seconds]
ByronJohnson has quit [Ping timeout: 245 seconds]
duderonomy has joined #ruby
nuck has quit [Ping timeout: 240 seconds]
cyphase has joined #ruby
psmolen has joined #ruby
Mortomes|Work has joined #ruby
ByronJohnson has joined #ruby
AnoHito has joined #ruby
enterprisey has quit [Remote host closed the connection]
muelleme has quit [Ping timeout: 260 seconds]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Macaveli has joined #ruby
tomphp has joined #ruby
conta has joined #ruby
ace05 has joined #ruby
dga has joined #ruby
ohcibi has quit [Ping timeout: 255 seconds]
nicesignal has quit [Ping timeout: 246 seconds]
lel has joined #ruby
AnoHito has quit [Ping timeout: 240 seconds]
AnoHito has joined #ruby
DoubleMalt has joined #ruby
jgt1 has joined #ruby
ohcibi has joined #ruby
aufi has joined #ruby
jgt has quit [Ping timeout: 272 seconds]
<Seenox> Hello everyone. I am trying to use CURL in Ruby like this: https://gist.github.com/Seenoxx/8f5505238abd885862ec86b79e581eee -- My code is missing the --cacert --cert --key part in the ruby part though. Any help is appreciated. :)
jenrzzz has quit [Ping timeout: 260 seconds]
troys_ is now known as troys
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
lupine has quit [Ping timeout: 246 seconds]
dc2 has quit [Ping timeout: 268 seconds]
troys has quit [Quit: Bye]
lupine has joined #ruby
Kug3lis_off is now known as Kug3lis
olivi____ has joined #ruby
Kug3lis is now known as Kug3lis_off
last_staff has joined #ruby
<zenspider> Seenox: `ri Net::HTTP` and look at the Attributes section
nobitanobi has joined #ruby
last_staff has quit [Client Quit]
saschavoid has joined #ruby
<zenspider> and/or `ri Net::HTTP.start`
olivi____ has quit [Ping timeout: 240 seconds]
<zenspider> and since you're still just doing a get, I'd seriously consider doing open-uri instead
<Seenox> zenspider: Thanks, I will need to change it to PUT and DELETE, etc. soon. I'm just testing it.
<Seenox> zenspider: Hmm, seems like I need to add some attr in req_options section.
<zenspider> kk... well, you can always read open-uri.rb for hints
<zenspider> ie, emacs $(gem which open-uri)
<zenspider> looks like it creates an x509 store and puts everything in there instead
<Seenox> Yeah... I've changed my code a little bit and got this: `initialize': wrong argument (String)! (Expected kind of OpenSSL::X509::Certificate) (TypeError)
Silthias has joined #ruby
jgnagy has quit [Remote host closed the connection]
gizmore has joined #ruby
<zenspider> go read open-uri and look at what it does
jgnagy has joined #ruby
<matthewd> http://www.rubyinside.com/nethttp-cheat-sheet-2940.html might help for a quick example
<Seenox> matthewd: SSL/HTTPS request with PEM certificate, it is!
ur5us has joined #ruby
BSAlb has joined #ruby
jgnagy has quit [Ping timeout: 260 seconds]
<zenspider> nice! curl -O blahblah[02-15] will download multiple files
nobitanobi has quit [Read error: No route to host]
<zenspider> nicer to link to the real thing: https://github.com/augustl/net-http-cheat-sheet
nobitanobi has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
mark_66 has joined #ruby
BSaboia has quit [Ping timeout: 245 seconds]
tristanp has quit [Ping timeout: 246 seconds]
nicesignal has joined #ruby
patarr has joined #ruby
cam27 has quit [Quit: cam27]
nobitanobi has quit [Ping timeout: 260 seconds]
jusa has joined #ruby
patarr has quit [Ping timeout: 272 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
brent__ has joined #ruby
<Seenox> matthewd zenspider: Thanks to both of you. Problem solved.
<Seenox> matthewd zenspider: Final working version: https://gist.github.com/Seenoxx/cf0cd190e31533bba7cb75405ff22ab4
jusa has quit [Ping timeout: 258 seconds]
brent__ has quit [Ping timeout: 268 seconds]
andikr has joined #ruby
<elomatreb> VERIFY_NONE almost certainly sounds like a bad idea
<Seenox> elomatreb: Local and behind 2 proxies?
duderonomy has quit [Read error: Connection reset by peer]
Pumukel has joined #ruby
<elomatreb> I don't have scrollback, sorry. If you're *sure* an invalid certificate isn't a threat
BSab has joined #ruby
Kug3lis_off is now known as Kug3lis
<Seenox> elomatreb: Yes, the API will reject invalid hostnames and IPs anyway. But thanks for the suggestion.
BSAlb has quit [Ping timeout: 240 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
lupine has quit [Ping timeout: 260 seconds]
lupine has joined #ruby
<Seenox> zenspider: Earlier you mentioned that you would use open-uri instead for GET requests. Any reason in particular? (Just being curious)
<elomatreb> It's really intuitive and looks nice, you treat the website just like a file you read
dc2 has joined #ruby
Dimik has quit []
<Seenox> elomatreb: I see. Thanks.
dc2 has quit [Ping timeout: 246 seconds]
ascarter_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nofxxx has joined #ruby
ascarter has quit [Read error: Connection reset by peer]
olivi____ has joined #ruby
nofxxxx has quit [Ping timeout: 246 seconds]
<duper> p
<duper> oops
ur5us has joined #ruby
mikecmpbll has joined #ruby
dionysus69 has joined #ruby
olivi____ has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
hutch34 has joined #ruby
ascarter has joined #ruby
quazimodo has quit [Ping timeout: 255 seconds]
hutch34 has quit [Ping timeout: 268 seconds]
Kug3lis is now known as Kug3lis_off
Cohedrin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
quobo has joined #ruby
pandaant has joined #ruby
jkprg has joined #ruby
jkprg has quit [Client Quit]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
Ivan__ has joined #ruby
vali has joined #ruby
vali has left #ruby [#ruby]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
Ivan__ has quit [Client Quit]
roamingdog has quit [Remote host closed the connection]
arquebus has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
mim1k_ has quit [Read error: Connection reset by peer]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
pwnd_nsfw` is now known as pwnd_nsfw
vondruch_ is now known as vondruch
biberu has joined #ruby
arquebus has quit [Ping timeout: 268 seconds]
dionysus69 has quit [Quit: dionysus69]
workmad3 has joined #ruby
TomyWork has joined #ruby
tomphp has joined #ruby
tomphp has quit [Client Quit]
charliesome has joined #ruby
mim1k has joined #ruby
DeeJayh_ has joined #ruby
ForeignBiscuit has joined #ruby
jud^ has joined #ruby
Puppet_ has joined #ruby
tomphp has joined #ruby
arquebus has joined #ruby
hahuang61 has joined #ruby
dlitvak_ has joined #ruby
knowtheory_ has joined #ruby
lipoqil_ has joined #ruby
cstrahan_ has joined #ruby
hlmjr has joined #ruby
pelegreno____ has joined #ruby
diego_k has joined #ruby
contradictioned_ has joined #ruby
lxsameer has joined #ruby
jameser_ has joined #ruby
anisha_ has joined #ruby
kke_ has joined #ruby
ptx0_ has joined #ruby
planigan_ has joined #ruby
Muz_ has joined #ruby
yokel_ has joined #ruby
crankhar1er has joined #ruby
dgs_ has joined #ruby
gil__ has joined #ruby
Marc- has joined #ruby
_derpy has joined #ruby
sspreitzer has joined #ruby
sspreitzer has joined #ruby
bougyman_ has joined #ruby
tekku has joined #ruby
unsymbol_ has joined #ruby
nemesit|znc_ has joined #ruby
_aeris has joined #ruby
jolamb_ has joined #ruby
tabakhase__ has joined #ruby
Derperpe- has joined #ruby
soahccc_ has joined #ruby
NightMonkey_ has joined #ruby
marlinc_ has joined #ruby
jamesaxl has quit [*.net *.split]
jameser has quit [*.net *.split]
anisha has quit [*.net *.split]
aupadhye has quit [*.net *.split]
dlitvak has quit [*.net *.split]
kies has quit [*.net *.split]
herbmillerjr has quit [*.net *.split]
hahuang65 has quit [*.net *.split]
gil_ has quit [*.net *.split]
DeeJayh__ has quit [*.net *.split]
ResidentBiscuit has quit [*.net *.split]
nemesit|znc has quit [*.net *.split]
planigan has quit [*.net *.split]
dgs has quit [*.net *.split]
Puppet___ has quit [*.net *.split]
contradictioned has quit [*.net *.split]
RealMarc has quit [*.net *.split]
cajone has quit [*.net *.split]
ptx0 has quit [*.net *.split]
SuperTaz has quit [*.net *.split]
Muz has quit [*.net *.split]
pelegreno___ has quit [*.net *.split]
statikowsky has quit [*.net *.split]
akkad has quit [*.net *.split]
crankharder has quit [*.net *.split]
cstrahan has quit [*.net *.split]
jud has quit [*.net *.split]
Derperperd has quit [*.net *.split]
tekk has quit [*.net *.split]
unsymbol has quit [*.net *.split]
kke has quit [*.net *.split]
marlinc has quit [*.net *.split]
NightMonkey has quit [*.net *.split]
diegok has quit [*.net *.split]
ignarps has quit [*.net *.split]
bauruine has quit [*.net *.split]
tfitts has quit [*.net *.split]
krasnus has quit [*.net *.split]
heyimwill has quit [*.net *.split]
soahccc has quit [*.net *.split]
jolamb has quit [*.net *.split]
go|dfish has quit [*.net *.split]
`derpy has quit [*.net *.split]
bougyman has quit [*.net *.split]
_aeris_ has quit [*.net *.split]
sspreitz has quit [*.net *.split]
lipoqil has quit [*.net *.split]
jokke has quit [*.net *.split]
knowtheory has quit [*.net *.split]
SuperTux88 has quit [*.net *.split]
selim has quit [*.net *.split]
yokel has quit [*.net *.split]
tabakhase has quit [*.net *.split]
silverdust has quit [*.net *.split]
dlitvak_ is now known as dlitvak
spectra has quit [*.net *.split]
_aeris is now known as _aeris_
cstrahan_ is now known as cstrahan
lipoqil_ is now known as lipoqil
knowtheory_ is now known as knowtheory
NightMonkey_ is now known as NightMonkey
SuperTux88 has joined #ruby
marlinc_ is now known as marlinc
olivi____ has joined #ruby
bauruine_ has joined #ruby
Tharbakim has quit [Ping timeout: 240 seconds]
Ferdroid has quit [Ping timeout: 260 seconds]
syndikate has quit [Ping timeout: 260 seconds]
conta has quit [Remote host closed the connection]
Ferdroid has joined #ruby
iooner has quit [Ping timeout: 240 seconds]
conta has joined #ruby
opencw has joined #ruby
dionysus69 has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jamesaxl has joined #ruby
akkad has joined #ruby
spectra has joined #ruby
ignarps has joined #ruby
iooner has joined #ruby
syndikate has joined #ruby
Tharbakim has joined #ruby
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
kies has joined #ruby
aupadhye has joined #ruby
go|dfish has joined #ruby
olivi____ has quit [Ping timeout: 268 seconds]
jokke has joined #ruby
ledestin has joined #ruby
cajone has joined #ruby
krasnus has joined #ruby
yokel_ has quit [Changing host]
yokel_ has joined #ruby
yokel_ is now known as yokel
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
nemesit|znc_ has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
nemesit|znc has joined #ruby
howdoi_ has joined #ruby
heyimwill has joined #ruby
konsolebox has joined #ruby
last_staff has joined #ruby
charliesome has joined #ruby
last_staff has quit [Client Quit]
dionysus69 has quit [Quit: dionysus69]
nowhereman has quit [Ping timeout: 246 seconds]
tvw has joined #ruby
patarr has joined #ruby
cschneid_ has joined #ruby
Mia has quit [Read error: Connection reset by peer]
patarr has quit [Ping timeout: 240 seconds]
nemesit|znc has quit [Quit: ZNC 1.6.3+deb1 - http://znc.in]
nemesit|znc has joined #ruby
tvw has quit [Ping timeout: 258 seconds]
dionysus69 has joined #ruby
stamina has joined #ruby
cschneid_ has quit [Ping timeout: 255 seconds]
romank has joined #ruby
tabakhase__ has quit [Changing host]
tabakhase__ has joined #ruby
tabakhase__ is now known as tabakhase
nowhereman has joined #ruby
<dionysus69> can anyone help me translate this php method into ruby method? :) https://gist.github.com/anonymous/8c78ccc7005fd93063feb205f3917af0
<dionysus69> this an example for sending sms
rgr has joined #ruby
normie1 has joined #ruby
normie1 has quit [Client Quit]
kthibodeaux has quit [Quit: WeeChat 1.5]
adrianvalenzuela has joined #ruby
<adrianvalenzuela> hello?
<elomatreb> dionysus69: Ruby comes with a proper HTTP client, no need to use curl like that: https://ruby-doc.org/stdlib-2.4.1/libdoc/net/http/rdoc/Net/HTTP.html
devyn has quit [Ping timeout: 240 seconds]
jameser_ has quit [Ping timeout: 260 seconds]
<dionysus69> elomatreb: ok thanks, I wasn't sure curl was being used in that way. This is a weird script, it's not mine obviously.
devyn has joined #ruby
Burgestrand has quit [Quit: Closing time!]
dc2 has joined #ruby
adrianvalenzuela has quit [Quit: Lost terminal]
devyn has quit [Ping timeout: 240 seconds]
dc2 has quit [Ping timeout: 255 seconds]
devyn has joined #ruby
<conta> guys, here is what I do:
<conta> log = File.open(File.join(settings.root,'log/bridge.log'))
<conta> and then log.each_line.count which returns 3
<conta> when I do again log.each_line.count I get 0
<conta> and can't do anything with file cause it looks like it's "empty"
<conta> what am I doing wrong?
<apeiros> that'd be because you've already read to the end
<conta> so what is correct way? if I wanna see count first and then let's say show some lines
<apeiros> &ri IO#seek conta
ur5us has quit [Remote host closed the connection]
<apeiros> alternatively, you can read the whole file into memory. not advisable for big files, or files of unknown size.
patarr has joined #ruby
<conta> I see there is also #reopen, I guess I am going to use it
<conta> thanks guys
<apeiros> seek is probably better, but sure.
<elomatreb> You probably want #rewind not #reopen?
mim1k has quit [Ping timeout: 240 seconds]
<conta> so what I do is: check number of lines that user wants, if that is bigger than file, use real count of lines
pandaant has quit [Quit: Lost terminal]
rgr has quit [Ping timeout: 240 seconds]
xall has joined #ruby
<apeiros> oh right, rewind exists too.
* apeiros too rarely has to move to the start of a file - more often to a specific location (and that's rare too actually)
patarr has quit [Ping timeout: 258 seconds]
fusta has joined #ruby
<dminuoso> apeiros: Hah! I had to use rewind for the first time.
<dminuoso> Just a week ago.
* apeiros will use unwind, just 2 days from now
<dminuoso> I see what you did there.
<apeiros> but I haven't even done it yet?!?
<apeiros> we can rewind to what you just said in 2 days
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso> apeiros: Stop violating causality. Didn't your mother teach you to not exceed the speed of light?
<apeiros> I don't. I only bend some dimensions. can't help if they warp around.
dionysus69 has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
xall has quit [Quit: xall]
tomphp has joined #ruby
tomphp has quit [Client Quit]
stormbytes has quit [Quit: My Mac Mini has gone to sleep. ZZZzzz…]
ace05 has quit [Read error: Connection reset by peer]
ace05 has joined #ruby
jackrandom has joined #ruby
tomphp has joined #ruby
SuperTaz has joined #ruby
rohitpaulk has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
Mortomes|Work has quit [Ping timeout: 260 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Silthias has quit [Ping timeout: 240 seconds]
arquebus has quit [Quit: konversation disconnects]
Silthias has joined #ruby
marr has joined #ruby
yottanami has joined #ruby
<yottanami> How can I write this code more clear in Ruby style `product_counts = @products.each_with_object(Hash.new(0)) { |p, count| count[p.code] += 1 }.keep_if { |_k, v| v >= 2 }`
ferr1 has joined #ruby
SesMan has joined #ruby
statikowsky has joined #ruby
tfitts has joined #ruby
<dminuoso> yottanami: By using variables.
<dminuoso> yottanami: Or you could use a single map.
<dminuoso> Or actually mm yeah.
<yottanami> dminuoso, Using single map? how?
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
roshanavand has quit [Client Quit]
<dminuoso> yottanami: Not much left to improve. I would probably do it lie this: https://gist.github.com/dminuoso/ba7f0bd79c39c761ead3c32916353a45
<dminuoso> oh.
dc2 has joined #ruby
<dminuoso> Check updated gist.
roshanavand has joined #ruby
<elomatreb> Mh, `@products.group_by(&:code).map {|_, p| p.length }.select {|c| c > 1 }`?
<dminuoso> elomatreb: I thought about it, but each_with_object is just more expressive (and faster)
<elomatreb> Also, I failed. That just gets you the counts, nevermind
<yottanami> elomatreb, What about using reduce?
<dminuoso> yottanami: each_with_object is the same, except you dont have to use "next"
<dminuoso> (Since you can mutate it instead)
<elomatreb> Yep, reduce/inject are just fancy functional programming versions of each_with_object
dc2 has quit [Ping timeout: 240 seconds]
<dminuoso> yottanami: Personally I might actually use each.with_object (for consistencies sake) instead of each_with_object
jaruga_________ has quit [Ping timeout: 240 seconds]
jaruga_________ has joined #ruby
andikr has quit [Ping timeout: 260 seconds]
tomphp has joined #ruby
GodFather has joined #ruby
last_staff has joined #ruby
morfin has joined #ruby
ur5us has joined #ruby
jrafanie has joined #ruby
<morfin> Array.sample use Random right?
tomphp has quit [Client Quit]
last_staff has quit [Client Quit]
rgr has joined #ruby
<dminuoso> morfin: By default yes, but you can supply a different random engine if you want.
<dminuoso> Actually.
tomphp has joined #ruby
<dminuoso> morfin: Yes. VALUE opts, randgen = rb_cRandom;
<morfin> hmm rb_cRandom?
<elomatreb> That's from the C source of sample
<dminuoso> morfin: That's the C name for the class Random.
tomphp has quit [Client Quit]
<dminuoso> morfin: And it's overriden if you supply the kwarg random.
<morfin> i was looking how it choose random index, since it's Random then probably MT
jgnagy has joined #ruby
<dminuoso> morfin: Correct.
<dminuoso> morfin: MT19937 to be to exact.
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apparition has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yottanami_ has joined #ruby
yottanami has quit [Read error: Connection reset by peer]
andikr has joined #ruby
<dminuoso> morfin: But you could do [1,2].sample(random: OpenSSL::Random) if you needed a cryptographically secure sample.
t-recx has joined #ruby
<conta> guys, [1,2,3,4,5][-1..-2] should return [] ?
jgnagy has quit [Ping timeout: 255 seconds]
last_staff has joined #ruby
<dminuoso> conta: Yeah.
<conta> ah, should be -2..-1
<conta> my bad
<elomatreb> Wouldn't using SecureRandom be easier (and possibly better should Ruby finally decide to use system RNGs)?
belmoussaoui_ has joined #ruby
tomphp has joined #ruby
devyn has quit [Ping timeout: 246 seconds]
Burgestrand has joined #ruby
last_staff has quit [Client Quit]
Qchmqs__ has joined #ruby
Qchmqs__ is now known as Qchmqs
devyn has joined #ruby
belmoussaoui has quit [Ping timeout: 260 seconds]
last_staff has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<morfin> MT is faster i think
last_staff has quit [Client Quit]
<elomatreb> Speed of RNGs should rarely be of any concern
<morfin> since system RNG use /dev/urandom or CryptGenRandom or something else
<morfin> no, that's not true )
<elomatreb> Generating a new batch of /dev/urandom data should just be a few rounds of whatever stream cipher the implementation uses, it won't take long
<morfin> as example i use RNG to generate world in other project(on C++) and use std::mt19937 and fast generation is concerning me
<morfin> i don't need secure random numbers, just random
<elomatreb> Maybe one of the valid cases then, but these differences will not matter in Ruby code
<morfin> well, maybe
charliesome has joined #ruby
charliesome has quit [Client Quit]
<duper> When writing a method such as a Class initialize, what's the difference between passing &block as a parameter and using `block.call(x) if block` VS. `yield x if block_given?`
<elomatreb> duper: The latter saves you execution time since Ruby doesn't have to convert the block to a Proc object
robouk has quit [Quit: Konversation terminated!]
<morfin> i prefer yield thing
<elomatreb> You should, if you don't need to pass the block around
<morfin> well, i had such situaltion
rgr has quit [Quit: rgr]
<morfin> when wanted to pass block or symbol representing method name and call later
Larahero has joined #ruby
<morfin> btw OpenSSL as i remember use several sources including /dev/urandom hmm
mfaeh has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
belmoussaoui has joined #ruby
belmoussaoui_ has quit [Ping timeout: 268 seconds]
ta has joined #ruby
ta_ has quit [Ping timeout: 255 seconds]
ldnunes has joined #ruby
yottanami_ has quit [Ping timeout: 240 seconds]
yottanami_ has joined #ruby
Macaveli has quit [Quit: Textual IRC Client: www.textualapp.com]
Burgestrand has quit [Quit: Closing time!]
roamingdog has joined #ruby
belmoussaoui_ has joined #ruby
GinoMan2440 has quit [Ping timeout: 245 seconds]
rgr has joined #ruby
<duper> elomatreb: thanks.. speed is what i'm looking for
belmoussaoui has quit [Ping timeout: 240 seconds]
Burgestrand has joined #ruby
dviola has joined #ruby
dc2 has joined #ruby
roamingdog has quit [Ping timeout: 260 seconds]
nowhereman has quit [Ping timeout: 240 seconds]
jaruga________ has joined #ruby
Burgestrand has quit [Ping timeout: 240 seconds]
jaruga_________ has quit [Ping timeout: 255 seconds]
dc2 has quit [Ping timeout: 260 seconds]
<duper> is there a faster way to do this? `@alerts.each do |a|; self << a; end`
<canton7> what is 'self'?
rohitpaulk has quit [Ping timeout: 240 seconds]
<canton7> does it have a 'push' method, for instance?
roshanavand has quit [Ping timeout: 260 seconds]
GinoMan has joined #ruby
ur5us has quit [Remote host closed the connection]
uZiel has quit [Ping timeout: 248 seconds]
last_staff has joined #ruby
last_staff has quit [Client Quit]
nadir has joined #ruby
hutch34 has joined #ruby
<apeiros> or better yet, concat?
synthroid has joined #ruby
<apeiros> (conat(foo) is faster than push(*foo), by quite a bit, at least it was in 2.1)
GinoMan2440 has joined #ruby
Larahero has left #ruby [#ruby]
Fernando-Basso has joined #ruby
rohitpaulk has joined #ruby
hutch34 has quit [Ping timeout: 260 seconds]
brent__ has joined #ruby
GinoMan has quit [Ping timeout: 260 seconds]
<duper> canton7: self is a custom Class derived from Array
mim1k has quit [Ping timeout: 260 seconds]
stamina has quit [Quit: WeeChat 1.8]
DoubleMalt has quit [Quit: Leaving]
<apeiros> &ri Array#concat duper
<duper> self.concat(@alerts) # like that?
<apeiros> assuming @alerts responds to to_a or to_ary, yes
<apeiros> in the worst case, @alerts.each.to_a
<duper> @alerts is an array
<apeiros> then… you could have just read the link above instead of asked ><
brent__ has quit [Ping timeout: 240 seconds]
yottanami_ has quit [Ping timeout: 255 seconds]
yottanami has joined #ruby
pupsicle has joined #ruby
apparition has joined #ruby
jackrandom has quit [Remote host closed the connection]
antgel has joined #ruby
belmoussaoui has joined #ruby
Burgestrand has joined #ruby
belmoussaoui_ has quit [Ping timeout: 255 seconds]
bkxd has joined #ruby
<dminuoso> I regularly coerce arrays into arrays using [].each.to_a
<dminuoso> just to be sure it's really an array.
<dminuoso> MRI can be sneaky.
mim1k has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
jackrandom has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
anisha_ has quit [Quit: This computer has gone to sleep]
jamesaxl has quit [Read error: Connection reset by peer]
<apeiros> dminuoso: don't laugh. I've had classes (not mine) with #each but no Enumerable, so .each.to_a was the way to go
<apeiros> I think back then it was even enum_for(:each).to_a
jamesaxl has joined #ruby
BSab has quit [Read error: Connection reset by peer]
<apeiros> actually - feel free to laugh. it's surreal enough, and I wasn't the perpetrator :D
devyn has quit [Ping timeout: 246 seconds]
nowhereman has joined #ruby
roshanavand has joined #ruby
rohitpaulk has joined #ruby
safetypin has joined #ruby
safetypin has quit [Client Quit]
<dminuoso> apeiros: I think stupid.class.include.Enumerable; would have been easier.
andikr has quit [Remote host closed the connection]
<dminuoso> stupid.class.include(Enumerable) I mean
quazimodo has joined #ruby
devyn has joined #ruby
mim1k has quit [Read error: Connection reset by peer]
dga has quit [Ping timeout: 260 seconds]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
dc2 has joined #ruby
cdg has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
charliesome has joined #ruby
nowhere_man has joined #ruby
nowhereman has quit [Read error: Connection reset by peer]
<apeiros> dminuoso: I don't touch classes I don't own
<apeiros> ok, not fully true, but still, I try to resist :D
devyn has quit [Ping timeout: 246 seconds]
<dminuoso> apeiros: Sometimes I can't resist.
<dminuoso> Why bother with all that immutable crap and responsible development.
yottanami has quit [Ping timeout: 246 seconds]
robouk has joined #ruby
mim1k has joined #ruby
jaruga________ has quit [Quit: jaruga________]
bkxd has quit [Ping timeout: 245 seconds]
devyn has joined #ruby
bkxd has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
rohitpaulk has quit [Ping timeout: 240 seconds]
howdoi_ has quit [Quit: Connection closed for inactivity]
xall has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh_ has joined #ruby
Burgestrand has quit [Quit: Closing time!]
quazimodo has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 240 seconds]
ldnunes has quit [Ping timeout: 240 seconds]
Kug3lis has joined #ruby
mfaeh_ has quit [Remote host closed the connection]
shinnya has joined #ruby
mfaeh has joined #ruby
quazimodo has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
olivi____ has joined #ruby
ldnunes has joined #ruby
t-recx has quit [Quit: t-recx]
meshsmith has joined #ruby
olivi____ has quit [Ping timeout: 240 seconds]
GodFather has quit [Ping timeout: 260 seconds]
LastWhisper____ has joined #ruby
hutch34 has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
jolamb_ is now known as jolamb
mim1k has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chalkmonster has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
oleo has joined #ruby
olivi____ has joined #ruby
GodFather has joined #ruby
olivi____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
Bish has quit [Ping timeout: 268 seconds]
dc2 has joined #ruby
Guest69 has joined #ruby
oliv_____ has quit [Remote host closed the connection]
ace05 has quit [Ping timeout: 260 seconds]
railswebdev has joined #ruby
olivi____ has joined #ruby
meshsmith has quit [Remote host closed the connection]
Bish has joined #ruby
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
fedruantine has quit [Remote host closed the connection]
chouhoulis has joined #ruby
roshanavand has quit [Quit: roshanavand]
dc2 has quit [Ping timeout: 245 seconds]
chalkmonster has quit [Remote host closed the connection]
roshanavand has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
ur5us has joined #ruby
ace05 has joined #ruby
HoierM has joined #ruby
im0nde has joined #ruby
HoierM has quit [Max SendQ exceeded]
LastWhisper____ has joined #ruby
ur5us has quit [Ping timeout: 245 seconds]
__Yiota has joined #ruby
alibby has joined #ruby
jusa has joined #ruby
ace05 has quit [Ping timeout: 240 seconds]
<ule> Hey guys.. how can I catch an exception happening inside a custom converter? I have something like this: CSV.parse(data, {headers: true, converters: MY_CUSTOM_CONVERTER}) do |row|
<ljarvis> ule: wrap the whole block in a rescue
<ule> ljarvis: I want to specify which row is throwing error
<ule> so I would love to catch this exception inside the row loop
<ljarvis> ule: you should probably use CSV.foreach(filename, options) instead. CSV.parse will just pull in all of your data and not parse it row-by-row like each_row does
<ljarvis> foreach does*
<ule> foreach.. ok.. let me read about it
ferr1 has quit [Ping timeout: 268 seconds]
_joes__ has joined #ruby
Dwarf-br has joined #ruby
MarkBilk has quit [Ping timeout: 255 seconds]
yottanami has joined #ruby
tomphp has joined #ruby
aupadhye has quit [Ping timeout: 240 seconds]
majuk has joined #ruby
Qchmqs has quit [Quit: Konversation terminated!]
sepp2k has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
ferr1 has joined #ruby
hutch34 has quit [Ping timeout: 272 seconds]
MarkBilk has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
patarr has joined #ruby
jusa has quit [Ping timeout: 268 seconds]
jusa has joined #ruby
jrafanie has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
olivi____ has quit [Quit: Leaving...]
hutch34 has joined #ruby
xall has quit [Ping timeout: 260 seconds]
romank has quit [Ping timeout: 258 seconds]
xall has joined #ruby
romank has joined #ruby
chalkmonster has joined #ruby
cschneid_ has joined #ruby
t-recx has joined #ruby
ineb has left #ruby ["WeeChat 1.8"]
romank_ has joined #ruby
anonymus has joined #ruby
cbyrda has joined #ruby
lostapathy has joined #ruby
romank has quit [Ping timeout: 240 seconds]
dc2 has joined #ruby
<lostapathy> in a gemspec, is it "legal" to have runtime dependencies depend on RUBY_VERSION? See line 17 of https://github.com/AuthorizeNet/sdk-ruby/blob/master/authorizenet.gemspec - bundler won't let you install that with activesupport/rails > 4.2.6.
<lostapathy> rubygems.org also shows it locked to activesupport 4.2.6 https://rubygems.org/gems/authorizenet
apparition has quit [Quit: Bye]
<lostapathy> Trying to figure out if that's just a bad gemspec I should submit a PR on, or if there's a problem with rubygems/bundler
rippa has joined #ruby
jrafanie_ has joined #ruby
jrafanie has quit [Ping timeout: 245 seconds]
dc2 has quit [Ping timeout: 240 seconds]
fusta has quit [Ping timeout: 240 seconds]
conta has quit [Ping timeout: 255 seconds]
sundhell has joined #ruby
mim1k has joined #ruby
jgnagy has joined #ruby
yottanami_ has joined #ruby
gil__ has quit [Read error: Connection reset by peer]
duderonomy has joined #ruby
gil_ has joined #ruby
gil_ has joined #ruby
gil_ has quit [Changing host]
yottanami has quit [Ping timeout: 260 seconds]
nadir has quit [Quit: Connection closed for inactivity]
ptx0_ is now known as ptx0
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
truenito has joined #ruby
bast has joined #ruby
robotmay has joined #ruby
mark_66 has quit [Remote host closed the connection]
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
roshanavand has quit [Remote host closed the connection]
cam27 has joined #ruby
Pumukel has quit [Ping timeout: 260 seconds]
sundhell has quit [Quit: WeeChat 1.8]
brent__ has joined #ruby
maringouin has joined #ruby
maringouin has left #ruby [#ruby]
cdg_ has joined #ruby
SesMan has quit [Read error: Connection reset by peer]
maringou_ has joined #ruby
__Yiota has joined #ruby
maringou_ has quit [Client Quit]
maringou_ has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
im0nde has quit [Ping timeout: 240 seconds]
saschavoid has quit [Quit: die();]
tomphp has joined #ruby
marr has quit [Ping timeout: 246 seconds]
Maxel_ has joined #ruby
hutch34 has quit [Read error: Connection reset by peer]
romank_ has quit [Ping timeout: 240 seconds]
aufi has quit [Quit: Leaving]
belmoussaoui has quit [Quit: belmoussaoui]
belmoussaoui has joined #ruby
pandaant has joined #ruby
jaruga________ has joined #ruby
romank has joined #ruby
jaruga________ has quit [Client Quit]
bast has quit [Changing host]
bast has joined #ruby
jaruga________ has joined #ruby
yottanami_ has quit [Ping timeout: 272 seconds]
polysics has joined #ruby
Kug3lis has quit [Ping timeout: 258 seconds]
synthroid has quit [Remote host closed the connection]
amclain has joined #ruby
belmoussaoui has quit [Quit: belmoussaoui]
jamesaxl has quit [Read error: Connection reset by peer]
belmoussaoui has joined #ruby
bkxd has joined #ruby
jamesaxl has joined #ruby
<ule> Hey guys.. how would you do this?
hutch34 has joined #ruby
<ule> FIELDS.each { |k| self[k] = nil }
<ule> I'm wondering if there is a pretty way
<herwin> what is self?
<ule> herwin: I'm running this inside my rails/model
<ule> so.. I have alist of attributes from this model that I want to set as nil
<apeiros> if you do this often, have a hash instead and do: model.attributes = clear_fields
<apeiros> (where clear_fields = {column => nil, …})
<ule> ohhh
<ule> smart move
* apeiros is a smooth operator
<ule> let me test.. because I just want to set to nil some fields
<ule> *attributes
bkxd has quit [Ping timeout: 240 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
pandaant has quit [Remote host closed the connection]
<apeiros> it'll only set the attributes which are present in clear_fields
uZiel has joined #ruby
<ule> oh nevermind.. I can't use that
dc2 has joined #ruby
<ule> because I'm gonna use this same list of attribute names to set again
<apeiros> o0
<ule> so..
<apeiros> how are you setting from a list of names only?
xall has quit [Quit: xall]
<apeiros> seems to me like you'd need to have values too…
<ule> FOO = %w[name1 name2 name3]
<ule> so.. let me explain better
<apeiros> yeah, I think at this point, fake code doesn't cut it
t-recx has quit [Ping timeout: 260 seconds]
<apeiros> and you'll have quite a bit of time too, I'm afk for ~10-20min
<ule> inside my rails model I have 2 methods.. foo/foo2
marxarelli|afk has quit [Quit: Textual IRC Client: www.textualapp.com]
<ule> foo sets some fields to nil
<apeiros> as said, no fake
freeze has joined #ruby
<ule> ok
<ule> archive/restore
marxarelli has joined #ruby
<ule> archive sets name, email, password, etc to nil AND moves it to a temporary table called archived_users
<ule> then.. my restore method grabs all data from archived_users and sets back to my model
<ule> so I have some code duplicated like 10 fields setting to nil.. and on another method another 10 lines just to set it back
bkxd has quit [Ping timeout: 240 seconds]
<ule> so I'm gonna loop through and make things prettier
marr has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
ur5us has joined #ruby
synthroid has joined #ruby
<ule> FIELDS.each { |k| self[k] = nil }
hutch34 has joined #ruby
<ule> this works file.. I'm just wondering if there is another idea
<ule> apeiros: I liked your idea setting the attributes though
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 240 seconds]
maringou_ has quit [Ping timeout: 260 seconds]
raspado has joined #ruby
hobodave has joined #ruby
abhi__ has joined #ruby
Guest69 has joined #ruby
duderonomy has quit [Ping timeout: 255 seconds]
Kug3lis_off is now known as Kug3lis
railswebdev has joined #ruby
abhi__ has quit [Read error: Connection reset by peer]
shinnya has quit [Ping timeout: 258 seconds]
<apeiros> from what you've described: def archive; archived_users.create(attributes.slice(*ClearFields.keys)); self.attributes = ClearFields; end; def restore; self.attributes = restore_from_user.attributes.slice(*ClearFields.keys); end
<apeiros> but that's just me
polysics has quit [Remote host closed the connection]
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
oryman has joined #ruby
Maxels has joined #ruby
oryman has quit [Remote host closed the connection]
canton7 has quit [Quit: ZNC - http://znc.in]
canton7 has joined #ruby
belmoussaoui has quit [Quit: belmoussaoui]
Pumukel has joined #ruby
rgr_ has joined #ruby
Maxel_ has quit [Ping timeout: 260 seconds]
TomyWork has quit [Ping timeout: 240 seconds]
rgr has quit [Ping timeout: 255 seconds]
ForeignBiscuit has quit [Ping timeout: 272 seconds]
<ule> apeiros: you're at other level of programming
<ule> apeiros: master
<ule> :P
msj1974 has joined #ruby
nitric has joined #ruby
Kug3lis_ has joined #ruby
chouhoul_ has joined #ruby
t-recx has joined #ruby
chouhoulis has quit [Ping timeout: 255 seconds]
AnoHito has quit [Ping timeout: 240 seconds]
CacoS has joined #ruby
zenspider_ has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
AnoHito has joined #ruby
mfaeh has quit [Remote host closed the connection]
mfaeh has joined #ruby
nowhere_man has quit [Ping timeout: 255 seconds]
Kug3lis_ has quit [Ping timeout: 240 seconds]
msj1974 is now known as mstjohn1974
mim1k has quit [Ping timeout: 272 seconds]
zenspider has quit [Ping timeout: 255 seconds]
<ule> thank you
mstjohn1974 is now known as msj1974
msj1974 is now known as msj2015
centrx has joined #ruby
ascarter has joined #ruby
gmoney has joined #ruby
dionysus69 has joined #ruby
donald has joined #ruby
polysics has joined #ruby
polysics_ has joined #ruby
polysics has quit [Read error: Connection reset by peer]
cbyrda has quit [Quit: leaving]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
msj2015 has quit [Quit: Leaving]
marr has quit [Ping timeout: 240 seconds]
ResidentBiscuit has joined #ruby
marr has joined #ruby
Guest69 has joined #ruby
railswebdev has joined #ruby
ben__ has quit []
tristanp has joined #ruby
ben__ has joined #ruby
renchan has quit [Quit: Leaving...]
chalkmonster has joined #ruby
gothicsouth has joined #ruby
SeepingN has joined #ruby
centrx has quit [Remote host closed the connection]
chouhoul_ has quit [Remote host closed the connection]
robouk has quit [Quit: Konversation terminated!]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
im0nde has joined #ruby
ascarter has joined #ruby
mfaeh has quit []
jrafanie has joined #ruby
dc2 has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
Fridtjof has quit [Ping timeout: 272 seconds]
jrafanie_ has joined #ruby
jrafanie has quit [Ping timeout: 245 seconds]
stormbytes has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dc2 has quit [Ping timeout: 240 seconds]
Fridtjof has joined #ruby
pazzaz has joined #ruby
nowhere_man has joined #ruby
polishdub has joined #ruby
nadir has joined #ruby
quobo has joined #ruby
im0nde has quit [Ping timeout: 245 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ecuanaso has joined #ruby
yottanami_ has joined #ruby
bernd27 has joined #ruby
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jackrandom has quit [Quit: Leaving]
romank has quit [Ping timeout: 260 seconds]
duderonomy has joined #ruby
meshsmith has joined #ruby
majuk has quit [Remote host closed the connection]
roshanavand has joined #ruby
jaruga________ has quit [Quit: jaruga________]
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
polysics_ has quit [Remote host closed the connection]
roshanavand has quit [Client Quit]
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
centrx has joined #ruby
centrx has joined #ruby
centrx has quit [Changing host]
centrx has quit [Remote host closed the connection]
roshanavand has joined #ruby
polysics_ has joined #ruby
ujjain has quit [Quit: ZNC - 1.6.0 - http://znc.in]
ferr1 has quit [Quit: WeeChat 1.7]
<ule> Hey guys
<ule> I'm planning to instantiate some models isnide a loop and hit .save outside only after another event
<ule> so..
<ule> loop { new_foo = foo.new(attributes) }
<ule> then something like new_foo.save
mim1k has joined #ruby
yottanami_ has quit [Ping timeout: 255 seconds]
<ule> but of course on all the created attributes
hobodave has quit [Quit: Computer has gone to sleep.]
<ule> so I guess I need to pusth that to an array? new_foo[] ?
ledestin has joined #ruby
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
dviola has quit [Quit: WeeChat 1.8]
TomyLobo has joined #ruby
<chalkmonster> ule, I'm assuming you're talking about activerecord?
<ule> yeah
cdg_ has quit [Ping timeout: 260 seconds]
<ule> sorry forgot I was on #ruby channel
<chalkmonster> The straightforward way of doing this is to stick each record in an array, and then array.map { |record| record.save }
<chalkmonster> That will create one INSERT query / record though
<ule> chalkmonster: thank you
<chalkmonster> not a great idea
dopecanoe has joined #ruby
<chalkmonster> why are you creating them in a loop?
mim1k has quit [Ping timeout: 260 seconds]
polysics_ has quit [Remote host closed the connection]
<chalkmonster> if you're doing something like Create Object -> Then do something else to it, you might at least want to wrap it in a single transaction
<Maxels> I'm trying to execute the command: rake db:create db:migrate db:seed, and getting an error NoMethodError: undefined method `last_comment' for #<Rake::Application:0x00000000f3ce60>
<Maxels> . seems like I have some version mismatching going on. found this advice https://stackoverflow.com/questions/35893584/nomethoderror-undefined-method-last-comment-after-upgrading-to-rake-11 but the updated comment does not seem to apply to me
<chalkmonster> did you generate a lot of migrations at once?
ledestin has quit [Ping timeout: 260 seconds]
<apeiros> ?rails Maxels
<ruby[bot]> Maxels: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<Maxels> ah, sorry didn't know that was a rails thing. thanks
bernd27 has quit [Remote host closed the connection]
<chalkmonster> ^ the tragedy of Ruby in a nutshell
<ule> chalkmonster: trying to fix some legacy code
<ule> chalkmonster: :/ but that worked!! thank you very much!
<chalkmonster> ule, you should look into Ruby Enumerators
jackrandom has joined #ruby
<chalkmonster> records.map(&:save) will also work
<ule> ohh thats even better
PaulCapestany has joined #ruby
<chalkmonster> but if you can, try using the .create() method. That can create multiple records at oncep
<ule> chalkmonster: I just need to confirm if my ruby 2.1 has this syntax available
<chalkmonster> ule, it does.
<chalkmonster> wait.. 2.1?
<chalkmonster> k I'm sleeping bye
<ule> chalkmonster: bye!
chalkmonster has quit [Quit: Daddy's flown, 'cross the ocean.]
<havenwood> ule: It's a 1.9 thing, 2.1 is fine!
hobodave has joined #ruby
<ule> havenwood: yep, thank you.. Just did the test here.. worked
ecuanaso has joined #ruby
_joes_ has joined #ruby
dviola has joined #ruby
ecuanaso has quit [Client Quit]
__Yiota has joined #ruby
ecuanaso has joined #ruby
mikecmpbll has joined #ruby
User458764 has joined #ruby
chouhoulis has joined #ruby
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
pankaj has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
dc2 has joined #ruby
oleo has quit [Quit: irc client terminated!]
roamingdog has quit [Ping timeout: 258 seconds]
ur5us has joined #ruby
pankaj has quit [Quit: Leaving]
dc2 has quit [Ping timeout: 255 seconds]
pankaj has joined #ruby
ducklobster has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
jamesaxl has joined #ruby
ur5us has quit [Ping timeout: 268 seconds]
Dwarf-br has left #ruby ["Leaving"]
User458764 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
spheric has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
roshanavand has quit [Quit: roshanavand]
oleo has joined #ruby
Bock has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
KeyJoo has joined #ruby
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
User458764 has joined #ruby
ascarter has joined #ruby
dionysus69 has joined #ruby
meshsmith has quit [Ping timeout: 255 seconds]
Silthias has quit [Ping timeout: 246 seconds]
Silthias has joined #ruby
CacoS has quit [Ping timeout: 240 seconds]
jackrandom has quit [Remote host closed the connection]
CacoS has joined #ruby
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jrafanie has joined #ruby
haylon has joined #ruby
<SeepingN> Any big gotchas going from 2.0 to 2.1 or latest?
<SeepingN> I found that going from 1.8.6 to 2.0, lots of things like date/time and timeout and exceptions in general got better, which broke old code which had to look for ... "less correct" exceptions (compared to what is thrown in 2.0).
<havenwood> SeepingN: 2.0 to 2.4 may require updated gems and give you some deprecation warnings but it's worth trying.
<havenwood> SeepingN: 2.0 to 2.1 should be painless.
<havenwood> SeepingN: I'd suggest trying 2.3.4 or 2.4.1.
<SeepingN> some of this was really not a result of ruby but of the libraries jumping up for ssh and such
<SeepingN> hm ok. yeah our needs are slow, so starting with 2.1 might be good if it's smoother
<lostapathy> I would try 2.4.1 and if that seems too ugly, go to 2.3.4. I have upgraded some pretty nasty stuff to 2.3 without incident, but 2.4 has had issues with a couple gems I used
<havenwood> SeepingN: You might try jumping straight to 2.3.4 and if it works, great!
<lostapathy> 2.1 is already EOL, might as well go at least 2.2
<SeepingN> ah, yeah I don't think I'd go for that new anyway, given we aren't doing anything that "fancy" and don't have time to "fix everything" again
<havenwood> 2.2 doesn't get bugfixes anymore but at least it gets security fixes.
<SeepingN> ah. so we're still behind, even with our much-updated centos 7 :\
<havenwood> 2.3.4 or 2.4.1 is best!
<lostapathy> if you're on 2.0, 2.3.4 shouldn't be too bad
<havenwood> ^ +1
<SeepingN> k thx. have to look into this soon!
muelleme has joined #ruby
patarr_ has joined #ruby
arthurl has joined #ruby
ResidentBiscuit has quit [Ping timeout: 255 seconds]
davidmichaelkarr has joined #ruby
patarr has quit [Ping timeout: 268 seconds]
<arthurl> hi guys what does it mean if a jruby service bombs out with this error 'LoadError: no such file to load -- bundler/setup' but when i invoke the logic in the service definition file manually it works without issue?
dc2 has joined #ruby
morfin has quit []
dc2 has quit [Ping timeout: 260 seconds]
Cohedrin has joined #ruby
oncall-pokemon has joined #ruby
patarr_ has quit [Ping timeout: 240 seconds]
ResidentBiscuit has joined #ruby
maringouin has joined #ruby
cdg has joined #ruby
polysics has joined #ruby
rgr_ has quit [Ping timeout: 245 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
moei has joined #ruby
gnufied has quit [Ping timeout: 258 seconds]
hutch34 has quit [Ping timeout: 240 seconds]
jusa has quit [Ping timeout: 240 seconds]
truenito has quit [Ping timeout: 255 seconds]
gnufied has joined #ruby
sp4rrow has joined #ruby
ResidentBiscuit has quit [Ping timeout: 245 seconds]
ecuanaso has joined #ruby
ur5us has joined #ruby
patarr has joined #ruby
<havenwood> arthurl: It likely means that the Bundler gem is not installed.
<havenwood> arthurl: (There's also a #jruby channel but feel free to ask here as well.)
<havenwood> arthurl: gem install bundler
<havenwood> arthurl: Sanity check?: gem which bundler
<havenwood> arthurl: which bundle
jgt1 has quit [Ping timeout: 245 seconds]
DLSteve has joined #ruby
milardovich has joined #ruby
ltem has quit [Quit: Leaving]
jrafanie has joined #ruby
<arthurl> havenwood bundler is definitely installed- as i said the app runs fine when invoke it directly (as opposed to using the service to start it)
<arthurl> to me it seems like some kind of scope issue
<havenwood> arthurl: Is the service using the same Ruby? It seems the gem is not installed on the Ruby being used.
<havenwood> arthurl: Maybe env is being dropped?
<lostapathy> yes, that. Either different ruby, or setup with different envs so it's not getting the same gems
chrisgopher has joined #ruby
<arthurl> havenwood this is the service definition- https://gist.github.com/alyssenko/9aa447e633a157f17b9436352373a86b
<arthurl> if i run the code there manually it seems to work
<arthurl> when i invoke via /etc/init.d/service start that's when i get that strange bundler/setup error
<havenwood> arthurl: Is it in your PATH when running it manually and not via the service?
<havenwood> Oh, I guess you're running it directly.
<havenwood> But the GEM_PATH?
<havenwood> `echo $GEM_PATH` in both?
<havenwood> Or is --user-local flag for RubyGems only set in one?
<havenwood> arthurl: Sanity check that the same Ruby and Gem env are being used in both.
<havenwood> See: gem env
<havenwood> Or at least: gem env gempath
<havenwood> If it's looking in the same place for gems, it'll find em.
quazimodo has quit [Ping timeout: 260 seconds]
pjaspers has quit [Remote host closed the connection]
<arthurl> havenwood i think you might be right about the GEM_PATH- i just added that echo line to the service definition and i see it was blank when i attempted to start the service
ResidentBiscuit has joined #ruby
ResidentBiscuit has quit [Max SendQ exceeded]
ResidentBiscuit has joined #ruby
ur5us has quit [Remote host closed the connection]
<arthurl> havenwood even after i explicitly defiined the GEM_PATH in the service definition it still fails with the same error (i see the echo statement is indeed outputting the correct GEM_PATH right before the daemon line is called)
<havenwood> arthurl: Is it the same Ruby?
<havenwood> arthurl: Is this the same?: gem env gempath
jrafanie_ has joined #ruby
<havenwood> arthurl: Or from inside Ruby: Gem.path
<arthurl> havenwood the jruby_path is hardcoded in the service if you look so yes that should be ok
<arthurl> let me look into gem env and gempath
<havenwood> arthurl: It's to sanity check the Ruby and Gem match up to the right versions. I'd suggest printing out as much as you can.
<havenwood> >> RUBY_ENGINE
<ruby[bot]> havenwood: # => "ruby" (https://eval.in/809113)
jrafanie has quit [Ping timeout: 240 seconds]
<havenwood> >> RUBY_ENGINE_VERSION
<ruby[bot]> havenwood: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<havenwood> #=> "2.4.1"
<havenwood> (Is what it returns in modern Ruby.)
<havenwood> And that works in JRuby.
<havenwood> RUBY_ENGINE_VERSION #=> "9.1.10.0"
bast has quit [Ping timeout: 272 seconds]
im0nde has joined #ruby
lele has quit [Ping timeout: 240 seconds]
FastJack has quit [Read error: Connection reset by peer]
FastJack has joined #ruby
<arthurl> so printing gem env gempath
<arthurl> comes back with something weird from inside the service
<arthurl> '/.gem/ruby/1.8:/usr/lib64/ruby/gems/1.8'
<arthurl> and if i run it from my command line i get '/usr/local/rvm/gems/ruby-1.8.7-p374:/usr/local/rvm/gems/ruby-1.8.7-p374@global'
<donald> do somebody use openclassrooms? I do not understand wwhat is expected under the method degat. What is it in english? http://exercices.openclassrooms.com/assessment/334?login=6989945&tk=9a484121a16ea444d42b8f6b61c36646&sbd=2016-02-01&sbdtk=2466d6bae51e373d89ac8e3f74213199
<havenwood> arthurl: Yeah, so that's not JRuby.
<havenwood> arthurl: That's probably a system Ruby 1.8.
milardovich has quit [Remote host closed the connection]
nofxxx has quit [Ping timeout: 246 seconds]
lele has joined #ruby
nofxxx has joined #ruby
Guest69 has joined #ruby
railswebdev has joined #ruby
bast has joined #ruby
bast has joined #ruby
bast has quit [Changing host]
gothicsouth has joined #ruby
polysics has quit [Remote host closed the connection]
milardovich has joined #ruby
polysics has joined #ruby
<arthurl> gotcha
<arthurl> now i just need to figure out how to set it properly in the context of that service
ascarter has joined #ruby
<havenwood> arthurl: You might want to set PATH to include Ruby bin/ dir and RubyGems bin/ dir. And consider setting GEM_HOME, GEM_PATH, GEM_ROOT and RUBY_ROOT.
<arthurl> havenwood it seems that my path already has that
<arthurl> echo $PATH /usr/local/rvm/gems/ruby-1.8.7-p374/bin:/usr/local/rvm/gems/ruby-1.8.7-p374@global/bin:/usr/local/rvm/rubies/ruby-1.8.7-p374/bin:/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin:/usr/local/rvm/bin:/root/bin
<havenwood> arthurl: Here's how chruby sets those for example: https://github.com/postmodern/chruby/blob/master/share/chruby/chruby.sh#L42-L58
<havenwood> arthurl: Ah, RVM?
dc2 has joined #ruby
<havenwood> Are you using RVM for JRuby?
milardovich has quit [Ping timeout: 240 seconds]
<havenwood> It seems not...
<arthurl> havenwood yes
<havenwood> Oh, okay.
polysics has quit [Ping timeout: 240 seconds]
<havenwood> arthurl: You'll probably want to use an RVM wrapper then.
<havenwood> arthurl: You'll find some hints in the links here: https://rvm.io/deployment
<havenwood> There's not a single place for wrapper docs. That'd be nice to add to the RVM docs.
ascarter has quit [Client Quit]
<havenwood> arthurl: For example: https://rvm.io/deployment/init-d
<arthurl> havenwood what's strange is that this is an ec2 instance, production, which also has a clone which we use for staging- and in staging it works
<havenwood> arthurl: Or: https://rvm.io/deployment/god
pankaj has quit [Quit: Leaving]
<havenwood> arthurl: your service isn't the same environment
<havenwood> arthurl: sudo drops env
<havenwood> arthurl: RVM solves this with wrappers.
JoshS has quit [Ping timeout: 255 seconds]
<havenwood> arthurl: or the `rvmsudo` command in place of `sudo`
<arthurl> havenwood so i see the hardcoded jruby path we have in the service definition might actually NOT be the rvm one "JRUBY_PATH=/home/deploy/jruby-1.7.16/bin"
<havenwood> The standard recommendation is to use a Ruby version switcher in dev but not in prod.
<havenwood> Typically you only need one Ruby in prod.
<havenwood> arthurl: Yeah, that's what made me think the JRuby was not RVM-related.
<havenwood> arthurl: If you have RVM on a production server not using RVM, that is a recipe for headache.
<arthurl> right, although i do also see 'jruby-1.7.15' listed when i run rvm list
<havenwood> arthurl: rvm implode --force
<havenwood> arthurl: Pick the way you'd like to deploy and remove the cruft.
<havenwood> You have too many Rubies.
<arthurl> well what's also interesting is that other server gem env gempath outputs what i want from inside the service
<arthurl> and everything looks identical
dc2 has quit [Ping timeout: 272 seconds]
<havenwood> Why do these have RVM installed?
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<havenwood> If you're not using it, uninstall it.
<arthurl> because we have other apps
<arthurl> that use it
konsolebox has quit [Quit: Leaving]
<havenwood> Ah, so you do need multiple Rubies on the same prod server?
hutch34 has joined #ruby
<arthurl> yes, unfortunately
<havenwood> If you're using RVM for some of them, you might want to use it for all of them.
<havenwood> Or rethink the whole thing.
<havenwood> It's best to not switch Ruby versions in prod. If you must switch Ruby versions in prod, use only one Ruby version switcher or do it manually.
<havenwood> But don't do it manually and have one or more Ruby version switchers. It's too crazy.
<havenwood> arthurl: Since such an old Ruby is involved, I'd suggest looking into RVM wrappers and install and configure JRuby with RVM.
<havenwood> Or pay down some technical debt and update things or split them out so Rubies aren't so comingled in prod.
donald has left #ruby [#ruby]
<havenwood> arthurl: Good luck!
<arthurl> havenwood i appreciate the recommendation i think it was done this way for a reason- due to these old versions there was probably difficulty getting the jruby to play nice with rvm or something hence that standalone install
mjuszczak has joined #ruby
brent__ has quit [Remote host closed the connection]
<havenwood> arthurl: JRuby should play just fine with RVM.
<zenspider_> yeah. that sounds like a mess. Unify.
<havenwood> arthurl: Wrappers work well with JRuby.
mjuszczak has quit [Client Quit]
zenspider_ is now known as zenspider
brent__ has joined #ruby
zenspider has quit [Changing host]
zenspider has joined #ruby
<havenwood> It might be they just didn't know how to do it with RVM. There seems to be much confusion in that regard.
<havenwood> Simple is good.
<havenwood> As simple as can possibly work is a nice level of simplicity.
<zenspider> agreed. simple is good. that's why I don't use RVM. :P
<havenwood> Tens of thousands of lines of shell tends to not be simple.
<havenwood> A hundred lines of shell is scary enough. ;-)
<zenspider> I got tired of filing patches to fix usage of unset variables only to have them regress over and over
<zenspider> but yeah. over time it's tried to be everything
bruce_lee has quit [Write error: Broken pipe]
eregon has quit [Write error: Broken pipe]
oleo has quit [Excess Flood]
hlmjr has quit [Write error: Broken pipe]
<zenspider> (except emacs)
bruce_lee has joined #ruby
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
<apeiros> maybe we should use emacs instead of rvm
eregon has joined #ruby
<havenwood> chruby support even ships wtih RVM, called MRVM
hlmjr has joined #ruby
<havenwood> It's the version changer that ate another version changer.
<zenspider> wait... what? I thought chruby was even smaller than rbenv ?
ascarter has joined #ruby
<havenwood> zenspider: It is, way smaller. I said that badly.
<havenwood> zenspider: RVM has chruby support, not the other way around.
<zenspider> (chruby ALSO has unset variable usage... gets old)
<zenspider> oooh. gotcha
brent__ has quit [Ping timeout: 246 seconds]
ozcanesen has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jjaii9 has joined #ruby
<jjaii9> hey how can I use an instance variable in an eigenclass (class << self)? thanks
im0nde has quit [Ping timeout: 240 seconds]
sp4rrow has quit [Quit: The Internet needs a break and I need a cookie]
nuck has joined #ruby
<baweaver> jjaii9: please don't crosspost
<baweaver> pass it in as an argument
<jjaii9> baweaver: sorry! can you give a simple example?
roamingdog has joined #ruby
im0nde has joined #ruby
<baweaver> to a function
<jjaii9> i'm trying to do something like record = other_method(var)
<jjaii9> and i'm getting record isn't a valid method
<baweaver> !gist
<baweaver> ...
<baweaver> ?gist
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
<jjaii9> baweaver: omw
nchambers is now known as telnet
roamingdog has quit [Ping timeout: 260 seconds]
telnet is now known as nchambers
valeska has joined #ruby
<jjaii9> when it hit's record it throws an error like 'undefined local variable or method 'record'
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
railswebdev has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<baweaver> Those are technically class methods
<baweaver> so anything defined as an instance method is not visible
<baweaver> line 5 crashes?
<baweaver> even after you define it like that on 4?
<jjaii9> line 4
<jjaii9> baweaver: i need to use attr_accessor?
<baweaver> post the error as a comment on the gist
<valeska> hola
<havenwood> valeska: hi
valeska has left #ruby [#ruby]
<baweaver> you're trimming something jjaii9
<baweaver> way to go havenwood
<baweaver> scared them off
<baweaver> XD
<havenwood> ¯\_(ツ)_/¯
<zenspider> jjaii9: nope. try again.
<jjaii9> it was a typo!
<jjaii9> hahaha
<jjaii9> sorry yall
Kug3lis has joined #ruby
Guest69 has joined #ruby
railswebdev has joined #ruby
PaulCapestany has quit [Read error: Connection reset by peer]
jjaii9 has quit []
raspado has quit [Remote host closed the connection]
JohnDorian has left #ruby ["Leaving"]
CacoS has quit [Remote host closed the connection]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
im0nde has quit [Quit: im0nde]
postmodern has joined #ruby
raspado has joined #ruby
Kug3lis_ has joined #ruby
jenrzzz has joined #ruby
underport has joined #ruby
nertzy has joined #ruby
oleo has joined #ruby
opencw has quit [Quit: Leaving]
synthroid has quit []
milardovich has joined #ruby
milardovich has quit [Remote host closed the connection]
PaulCapestany has joined #ruby
muelleme has quit [Ping timeout: 260 seconds]
maringouin has quit [Ping timeout: 260 seconds]
railswebdev has quit [Read error: Connection reset by peer]
chrisgopher has quit [Remote host closed the connection]
GinoMan1423 has joined #ruby
jenrzzz_ has joined #ruby
ur5us has joined #ruby
Rodya_ has joined #ruby
GinoMan2440 has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
GinoMan1423 has quit [Ping timeout: 260 seconds]
dviola has quit [Quit: WeeChat 1.8]
cam27 has quit [Quit: cam27]
dc2 has joined #ruby
brent__ has joined #ruby
jjaii9 has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
dc2 has quit [Ping timeout: 261 seconds]
mtkd has quit [Ping timeout: 272 seconds]
hobodave has quit [Quit: Computer has gone to sleep.]
mtkd has joined #ruby
rgr_ has joined #ruby
Kug3lis has quit [Read error: Connection reset by peer]
mim1k has joined #ruby
chouhoul_ has joined #ruby
nowhere_man has quit [Remote host closed the connection]
jgt1 has joined #ruby
Guest69 has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
jusa has joined #ruby
chouhoulis has quit [Ping timeout: 240 seconds]
duderonomy has quit [Ping timeout: 260 seconds]
chouhoul_ has quit [Ping timeout: 260 seconds]
ldnunes has quit [Quit: Leaving]
sp4rrow has joined #ruby
Silthias1 has joined #ruby
roamingdog has joined #ruby
jusa has quit [Ping timeout: 260 seconds]
Silthias has quit [Ping timeout: 272 seconds]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34 has quit [Ping timeout: 240 seconds]
biberu has quit []
raspado has quit [Quit: Leaving...]
mikecmpbll has quit [Quit: inabit. zz.]
hobodave has joined #ruby
Rodya_ has quit [Remote host closed the connection]
roamingdog has quit [Ping timeout: 268 seconds]
polysics has joined #ruby
roamingdog has joined #ruby
Kug3lis_ has quit [Ping timeout: 260 seconds]
polysics has quit [Ping timeout: 255 seconds]
Kug3lis has joined #ruby
nowhere_man has joined #ruby
mitt3ns is now known as agent_white
nowhere_man has quit [Client Quit]
nowhere_man has joined #ruby
Silthias has joined #ruby
Silthias1 has quit [Ping timeout: 240 seconds]
nowhereman has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
LastWhisper____ has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
nowhere_man has quit [Ping timeout: 240 seconds]
sp4rrow has quit [Quit: Textual]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
tomphp has joined #ruby
dionysus69 has quit [Ping timeout: 255 seconds]
Cohedrin has quit [Read error: Connection reset by peer]
ozcanesen has quit [Quit: Textual IRC Client: www.textualapp.com]
Maxels has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
lxsameer has joined #ruby
jenrzzz_ has quit [Ping timeout: 260 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
Cohedrin has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
roamingdog has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
ascarter has joined #ruby
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
dc2 has joined #ruby
patarr has quit [Ping timeout: 255 seconds]
marxarelli is now known as marxarelli|afk
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Kug3lis has quit [Remote host closed the connection]
Kug3lis has joined #ruby
Xeago has quit [Ping timeout: 240 seconds]
TomyLobo has quit [Ping timeout: 255 seconds]
Xeago has joined #ruby
dc2 has quit [Ping timeout: 240 seconds]
tomphp has joined #ruby
hanna has quit [Remote host closed the connection]
eputnam has quit [Ping timeout: 268 seconds]
eputnam_ has joined #ruby
haylon has quit [Remote host closed the connection]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
ascarter has quit [Client Quit]
underport has quit [Quit: Leaving]
hanna` has joined #ruby
hanna` is now known as hanna
adrianvalenzuela has joined #ruby
ozcanesen has joined #ruby
adrianvalenzuela is now known as adrianvalenz
adrianvalenz has quit [Client Quit]
vircung has joined #ruby
vircung has quit [Remote host closed the connection]
arthurl has quit [Ping timeout: 260 seconds]
vircung has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
Cohedrin has joined #ruby
GinoMan1423 has joined #ruby
hutch34 has joined #ruby
cisco has joined #ruby
ascarter has joined #ruby
ascarter has quit [Client Quit]
marr has quit [Ping timeout: 240 seconds]
hobodave has quit [Ping timeout: 240 seconds]
ozcanesen has quit [Quit: Textual IRC Client: www.textualapp.com]
vircung has quit [Quit: Nothing to do here]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
Rodya_ has joined #ruby
dc2 has joined #ruby
vircung has joined #ruby
vircung has quit [Client Quit]
DLSteve has quit [Quit: All rise, the honorable DLSteve has left the channel.]
lxsameer has quit [Ping timeout: 255 seconds]
bkxd has joined #ruby
Guest69 has joined #ruby
Kug3lis has quit [Quit: Textual IRC Client: www.textualapp.com]
Rodya_ has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 240 seconds]
bkxd has joined #ruby
Pumukel has quit [Ping timeout: 255 seconds]
ozcanesen has joined #ruby
gnufied has quit [Ping timeout: 240 seconds]
adrianvalenz_ has joined #ruby
<adrianvalenz_> hola
bkxd has quit [Ping timeout: 246 seconds]
ascarter has joined #ruby
<adrianvalenz_> ascarter: hi there
<adrianvalenz_> anyone in the ruby channel?
<dminuoso> no.
<adrianvalenz_> lol
<jjaii9> hahah!
<adrianvalenz_> jurk
<adrianvalenz_> lol jk
<jjaii9> how u doin
<adrianvalenz_> good, good. Just trying to figure out irc again
<jjaii9> :-D
lxsameer has joined #ruby
nertzy has quit [Quit: This computer has gone to sleep]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gnufied has joined #ruby
vircung has joined #ruby
cinch has joined #ruby
adrianvalenz_ has quit [Ping timeout: 255 seconds]
dachi has joined #ruby
cinch_ has joined #ruby
cinch_ has quit [Remote host closed the connection]
cinch has quit [Remote host closed the connection]
cfec0b8d has quit [Quit: Leaving]
vircung has quit [Quit: Nothing to do here]
vircung has joined #ruby
ascarter has joined #ruby
al2o3-cr has quit [Ping timeout: 240 seconds]
ozcanesen has quit [Quit: Textual IRC Client: www.textualapp.com]
cschneid_ has quit [Remote host closed the connection]
dachi has left #ruby [#ruby]
shinnya has joined #ruby
ascarter has quit [Ping timeout: 255 seconds]
ascarter has joined #ruby
gigetoo has quit [Ping timeout: 245 seconds]
al2o3-cr has joined #ruby
Cohedrin has quit [Read error: Connection reset by peer]
HoierM has joined #ruby
Cohedrin has joined #ruby
HoierM has quit [Max SendQ exceeded]
HoierM has joined #ruby
gigetoo has joined #ruby
ascarter has quit [Read error: Connection reset by peer]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jusa has joined #ruby
robotmay has quit [Ping timeout: 260 seconds]
robotmay has joined #ruby
lxsameer has quit [Ping timeout: 240 seconds]
dopecanoe has left #ruby ["Closing Window"]
<al2o3-cr> sup #ruby
lxsameer has joined #ruby
<al2o3-cr> nooodless
<baweaver> Code challenge time!
jusa has quit [Ping timeout: 240 seconds]
cdg has quit [Remote host closed the connection]
<baweaver> Transpose an array such that: transpose([[1,2], [3,4]]) == [[1,3], [2,4]] && transpose([[1,2,3,4,5],[6,7,8,9,0]]) == [[1, 6], [2, 7], [3, 8], [4, 9], [5, 0]]
<baweaver> Array#traspose is off limits ;)
<baweaver> Array#transpose rather.
<dminuoso> Shame.
<dminuoso> I was about to do this.
minimalism has quit [Quit: minimalism]
<baweaver> Also no redefining Array#==
<dminuoso> baweaver, https://eval.in/809151
<dminuoso> done
<dminuoso> Heh/.
<baweaver> fine fine fine
<dminuoso> That last one was funny, I didn't consider that - but I should have.
<baweaver> I just thought of it
<dminuoso> baweaver, what do I win?
<baweaver> On occasion I enjoy abusing an interviewers question for kicks
<baweaver> ?cookie dminuoso
<ruby[bot]> dminuoso: here's your cookie: 🍪
Rodya_ has joined #ruby
<dminuoso> Cookielishious.
<baweaver> granted this wasn't one I was asked. It's a bit too easy, but may be a nice FizzBuzz alt.
mim1k has joined #ruby
<sonOfRa> Fun challenge: Given an 1D-Array of 64-bit ints, where each int is a row in a bitwise matrix, transpose the bitwise matrix!
polysics has joined #ruby
<baweaver> It's a Bit over my knowledge range of byteshifting :)
<sonOfRa> Hard mode: provide an algorithm more efficient than O(n^2)
<baweaver> so there is one of those twiddling tricks then
marxarelli|afk is now known as marxarelli
dc2 has quit [Ping timeout: 260 seconds]
<baweaver> Probably makes it O(n), but I don't know nearly enough to pull that one off.
<sonOfRa> It's insane, I actually had to implement this recently, and I took a LONG time to get it run fast, but here's a version that does it in C: https://gist.github.com/sonOfRa/2d1ad08ce91013117ed007bc1ebedabb
<sonOfRa> slowslice has the same result, but is, well, slow
adrianvalenz has joined #ruby
<baweaver> Hacker's Delight probably has some recipe for this
Rodya_ has quit [Ping timeout: 245 seconds]
<sonOfRa> Yup, I found it there (though for 8 and 16 bit matrices)
mim1k has quit [Ping timeout: 240 seconds]
<dminuoso> sonOfRa, you should be shot.
<dminuoso> sonOfRa, static inline is silly.
<sonOfRa> dminuoso: it was for a silly competition that used rtdsc to count cycles
<dminuoso> sonOfRa, so?
<sonOfRa> This shaved off *very few* but barely noticeable cycles
<dminuoso> sonOfRa, no it did no.
* baweaver does not know C
<dminuoso> sonOfRa, inline is a stupid modifier that has to do with definition rules
* baweaver backs away slowly
polysics has quit [Ping timeout: 260 seconds]
<dminuoso> Though in C the rules are kind of silly and complicated. It's a bit simpler in C++
<sonOfRa> dminuoso: I dunno, I looked at the assembly I got for the forced inlining and the non-forced-inlining, and it didn't inline the function, allocating a new stack frame. MIght have been bad measurement, but it was measurable in the context of the contest
<dminuoso> sonOfRa, Im not talking about __attribute((always_inline))
<sonOfRa> But what's wrong with giving an inline function static linkage?
adrianvalenz has quit [Quit: leaving]
BSaboia has joined #ruby
<dminuoso> sonOfRa, the rationale behind inline is to provide the definition to the call site to enable optimizations (note that this is not about function call inlining)
<dminuoso> sonOfRa, by also making it static, you essentially imply that the definition is scoped to the TU, which prevents linkers from being smart.
quazimodo has joined #ruby
<sonOfRa> Oh, I guess that makes sense if you have more than a single TU
<dminuoso> and if not, you dont need either.
<dminuoso> sonOfRa, essentially inline is the trick that allows you to put definitions into headers without running into multiple definition errors
<sonOfRa> I'd say being shot is a harsh punishment for placing a useless classifier ;)
t-recx has quit [Ping timeout: 268 seconds]
<zenspider> crazy idea: talk about ruby
<dminuoso> sonOfRa, that is the best SO answer on the subject.
<zenspider> what all do I need to define if I'm going to define == ? is it just hash or is there more?
Cohedrin has quit [Read error: Connection reset by peer]
<zenspider> ugh... the coffee is NOT working today
<dminuoso> zenspider, clearly not.
<dminuoso> zenspider, == is whatever you need for your generic equality.
<zenspider> that's not answering my question, is it?
<dminuoso> zenspider, let me rephrase
<dminuoso> zenspider, eql? is hash equality, equal? is object identity, == is <generic whatever makes sense for you> equality.
<zenspider> again, that's not answering my question. please just stop
<dminuoso> zenspider, reconsider your question then.
Cohedrin has joined #ruby
<dminuoso> Because it sucks.
jjaii9 has quit [Remote host closed the connection]
* baweaver grabs popcorn
<dminuoso> == has nothing to do with hash, but you can use hash to speed up the process if you like to.
jjaii9 has joined #ruby
<dminuoso> but depending on how your hash works, it may not be feasible
<dminuoso> baweaver, sharing is caring
mikeiniowa has quit [Remote host closed the connection]
vircung has quit [Quit: Nothing to do here]
<dminuoso> baweaver, I have a new entry for the code contest
<dminuoso> baweaver, def transpose(array) Array.new(array.first.size) { |i| array.map { |row| row[i] } } end
<baweaver> oi
lxsameer has quit [Quit: WeeChat 1.7]
<baweaver> hax
<dminuoso> :-)
vircung has joined #ruby
kt has quit [Ping timeout: 260 seconds]
vircung has quit [Client Quit]
ascarter has joined #ruby
vircung has joined #ruby
jjaii9 has quit [Ping timeout: 240 seconds]
rgr_ has quit [Ping timeout: 258 seconds]
hutch34 has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
ascarter has quit [Client Quit]
Guest69 has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
ascarter has joined #ruby
kies has quit [Ping timeout: 255 seconds]
ur5us has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
kt has joined #ruby