jhass changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.3, 2.4.5, 2.3.8, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
nowhere_man has quit [Remote host closed the connection]
nowhere_man has joined #ruby
mroutis has joined #ruby
Xiti has quit [Ping timeout: 240 seconds]
<al2o3-cr> phaul: what repl you tesinging in?
kurko__ has joined #ruby
<al2o3-cr> irb/pry/?
kurko_ has quit [Ping timeout: 240 seconds]
<al2o3-cr> i got two mins
<phaul> no repl. just create 2 files, x.rb; y.rb. y.rb require 'x'; local vars defined in x are not available in y
<phaul> executing ruby y.rb
Xiti has joined #ruby
<phaul> hm, in fact y is not executing top level either.
TvL2386 has quit [Ping timeout: 260 seconds]
<phaul> if I explcitly use TOPLEVEL + get / set I can communicate local vars across files. but if I just assume that y is running in the TOPLEVEL context accessing local vars set in the other file fails
TvL2386 has joined #ruby
nowhere_man has quit [Ping timeout: 252 seconds]
wolfshappen has quit [Ping timeout: 246 seconds]
nicesignal has quit [Remote host closed the connection]
nicesignal has joined #ruby
nowhere_man has joined #ruby
<phaul> we shall crack this mystery tomorrow :) cya all
wolfshappen has joined #ruby
<mroutis> bye, phaul
xfbs has quit [Read error: Connection reset by peer]
phaul has quit [Ping timeout: 252 seconds]
bmurt has joined #ruby
nchambers has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xfbs has joined #ruby
MoritaShinobu has joined #ruby
ansraliant has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
jcarl43 has quit [Quit: WeeChat 2.3]
discopatrick has quit [Quit: Connection closed for inactivity]
xuanrui has joined #ruby
danguita has quit [Quit: Connection closed for inactivity]
cloaked1 has quit [Ping timeout: 240 seconds]
jp has joined #ruby
marmotini_ has joined #ruby
marmotini_ has quit [Ping timeout: 240 seconds]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marmotini_ has joined #ruby
ph88 has joined #ruby
<ph88> how can i upgrade ruby to latest stable with rvm ?
<ph88> i tried a bunch of commands but they don't seem to have effect
<havenwood> ph88: I'd suggest going ahead and using master, since a release is imminent: rvm get head
<havenwood> ph88: The command to update to the stable release is: rvm get stable
xfbs has quit [Quit: afk]
<ph88> havenwood, i did that now https://bpaste.net/show/5420cd9c9293
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ph88> when i open new shell and do ruby -v i get ruby 2.4.0p0 (2016-12-24 revision 57164) [x86_64-linux]
xfbs has joined #ruby
mroutis has quit [Ping timeout: 252 seconds]
shakes has joined #ruby
<ph88> rvm change a lot of things in my config files ..
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kurko__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhere_man has quit [Remote host closed the connection]
<havenwood> ph88: rvm install ruby
<havenwood> ph88: The latest stable Ruby is 2.5.3.
nowhere_man has joined #ruby
<havenwood> ph88: Then: rvm --default use 2.5.3
<ph88> Using /home/ph88/.rvm/gems/ruby-2.5.3
<ph88> when i open new shell i get ruby 2.4
<havenwood> ph88: Did you set?: rvm --default use 2.5.3
<ph88> yes, output was: Using /home/ph88/.rvm/gems/ruby-2.5.3
<havenwood> and when you open a new shell, what is?: which -a ruby
<ph88> it's 2 lines: /home/ph88/.rvm/rubies/ruby-2.4.0/bin/ruby /usr/bin/ruby
<havenwood> ph88: is 2.5.3 listed under?: rvm list
<havenwood> ph88: what is?: rvm -v
mroutis has joined #ruby
<havenwood> ph88: so current Ruby is 2.4 but default is 2.5.3. hmm
<havenwood> do you have a .ruby-version, Gemfile or the like in your current directory?
<ph88> no
<havenwood> ph88: If you explicitly run `rvm use 2.5.3` what is?: which ruby
<ph88> it's /home/ph88/.rvm/rubies/ruby-2.5.3/bin/ruby
<ph88> but when i open another shell it's 2.4
<havenwood> ph88: So it seems mksh isn't using the default for some reason. I don't know why.
<ph88> shall i remove all rvm code that rvm put in my dotfiles ?
<havenwood> ph88: I don't think RVM properly supports mksh: https://github.com/rvm/rvm/issues/3142
<ph88> i don't know what mksh is
<ph88> i use zsh
<havenwood> ph88: Hrm, I swear I saw mksh in your pastes. maybe I've just been up too long.
<havenwood> ph88: Ah, maybe it just detected you had a dotfile. Yeah, that's all.
xfbs has quit [Quit: afk]
<ph88> i don't know why the .mkshrc dotfile is there
<ph88> i never used mksh AFAIK
<havenwood> ph88: It's nothing, just me not paying close enough attention to realize it's irrelevant.
<havenwood> ph88: And I assume `rvm current` from a fresh shell also says 2.4?
<ph88> yes
<ph88> this is what my PATH looks like after i replace colon with newline https://bpaste.net/show/bef82fe45296
<havenwood> ph88: Is `which ruby` the RVM 2.4?
<ph88> yes
<ph88> it's /home/ph88/.rvm/rubies/ruby-2.4.0/bin/ruby
<havenwood> ph88: and `rvm default && ruby -v` is 2.5.3 from a fresh shell?
<havenwood> I assume it is. I don't know why the default is getting overridden with 2.4.
<ph88> rvm default && ruby -v from fresh shell 2.5.3
<ph88> maybe i can just remove all and start over ?
<havenwood> ph88: Yeah, that's a good bet. Turn it off and back on again!
<havenwood> ph88: rvm implode --force
<havenwood> ph88: your .rvm/bin dir is also far back in PATH
<havenwood> you might want to move the RVM stuff to the front of PATH
<havenwood> RVM likes to be first in PATH, to ensure it can switch.
<ph88> how do i start over now ?
<havenwood> ph88: \curl -sSL https://get.rvm.io | bash
<havenwood> ph88: rvm install ruby
<lupine> *sob*
<havenwood> ph88: rvm --default use 2.5.3
<havenwood> ph88: You're on Ubuntu?
<ph88> 16.04
<ph88> i don't think i used my package manager before to install rvm the last time
<havenwood> mm
<havenwood> I don't know about that.
<havenwood> Someone else here might.
<ph88> ill just go with \curl -sSL https://get.rvm.io | bash
shakes has quit [Quit: Leaving]
<ph88> don't i need to do rvm get head before rvm install ruby ?
<havenwood> ph88: that ^ command should have already fetched master
<havenwood> iir
<ph88> i see
<havenwood> ph88: then sanity check: rvm list
<ph88> all good now
<ph88> thx for the help
<havenwood> nice, you're welcome
openstruct has joined #ruby
Dimik has joined #ruby
<openstruct> I'm in a situation where I need to use two versions of the elasticsearch gem to write to two instances of elasticsearch that are different versions. Is my best bet to fork the gem and rename it to something else so that I can use them both?
esrse has joined #ruby
bhaak has joined #ruby
akosednar has quit [Ping timeout: 245 seconds]
jp has joined #ruby
akosednar has joined #ruby
marmotini_ has quit [Ping timeout: 264 seconds]
agent_white has joined #ruby
mroutis has quit [Ping timeout: 240 seconds]
AJA4350 has quit [Quit: AJA4350]
pharma_joe has quit [Ping timeout: 244 seconds]
m0nty0ne has joined #ruby
arekushi has quit [Ping timeout: 276 seconds]
dnewkerk has quit [Ping timeout: 240 seconds]
nofxx has joined #ruby
tdy has joined #ruby
dogweather has quit [Quit: dogweather]
Puffball has joined #ruby
evdubs_ has quit [Quit: Leaving]
Dimik has quit [Ping timeout: 246 seconds]
<lupine> openstruct: I'd expect that to get very messy, very quicklyt
<lupine> can you split into two separate processes, one for each version, each with their own Gemfile ?
<openstruct> lupine: Was mostly a temporary idea while I do the upgrade, but I'm an hour into renaming elasticsearch and it is quite messy.
<openstruct> I suppose I could have two processes running...
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
openstruct has quit [Ping timeout: 256 seconds]
evdubs has joined #ruby
akaiiro has quit [Remote host closed the connection]
zacts has joined #ruby
mangold has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
m0nty0ne is now known as KoBuzz
dnewkerk has joined #ruby
tdy has quit [Ping timeout: 264 seconds]
dellavg_ has joined #ruby
KoBuzz is now known as m0nty0ne
xfbs has joined #ruby
xfbs has quit [Client Quit]
Inline has quit [Quit: Leaving]
xfbs has joined #ruby
kapil____ has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
danguita has joined #ruby
mroutis has joined #ruby
lytol_ has quit [Remote host closed the connection]
mangold has joined #ruby
m0nty0ne is now known as PellIT
xfbs has quit [Quit: afk]
marmotini_ has joined #ruby
bga57 has quit [Quit: Leaving.]
nowhereman has joined #ruby
nowhereman is now known as Guest75806
nowhere_man has quit [Read error: Connection reset by peer]
dogweather has joined #ruby
tdy has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
za1b1tsu has joined #ruby
arescorpio has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
dellavg_ has quit [Ping timeout: 252 seconds]
Vashy has left #ruby ["Leaving"]
jetchisel has quit [Ping timeout: 240 seconds]
marmotini_ has quit [Ping timeout: 240 seconds]
arescorpio has quit [Quit: Leaving.]
SteenJobs has joined #ruby
agent_white has quit [Quit: leaving]
bga57 has joined #ruby
mroutis has quit [Remote host closed the connection]
reber has joined #ruby
NpcOrangeManBad is now known as OrangeManBad
aupadhye has joined #ruby
OrangeManBad is now known as NpcOrangeManBad
NpcOrangeManBad is now known as OrangeManBad
Emmanuel_Chanel has quit [Quit: Leaving]
venmx has joined #ruby
venmx has quit [Ping timeout: 268 seconds]
mangold has joined #ruby
voolik has joined #ruby
SuperL4g has joined #ruby
Sup3rLurk has quit [Ping timeout: 264 seconds]
Emmanuel_Chanel has joined #ruby
SuperLag has quit [Ping timeout: 245 seconds]
SuperLag has joined #ruby
za1b1tsu has quit [Ping timeout: 268 seconds]
sirecote has quit [Ping timeout: 272 seconds]
cpallares has quit [Ping timeout: 272 seconds]
sirecote has joined #ruby
cpallares has joined #ruby
cxl has quit [Quit: bye]
mangold has quit [Quit: This computer has gone to sleep]
dionysus69 has joined #ruby
voolik has quit [Quit: Taking a nap...]
SteenJobs has quit [Quit: SteenJobs]
dionysus69_ has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
dionysus69_ is now known as dionysus69
cloaked1 has joined #ruby
Guest75806 has quit [Ping timeout: 250 seconds]
voolik has joined #ruby
clemens3 has joined #ruby
cloaked1 has quit [Ping timeout: 264 seconds]
drbrain has quit [Ping timeout: 268 seconds]
drbrain has joined #ruby
Tuor has joined #ruby
phaul has joined #ruby
DoubleMalt has joined #ruby
DoubleMalt has quit [Remote host closed the connection]
esrse has quit [Ping timeout: 264 seconds]
mangold has joined #ruby
za1b1tsu has joined #ruby
mikecmpbll has joined #ruby
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
dogweather has quit [Quit: dogweather]
dogweather has joined #ruby
dogweather has quit [Client Quit]
dogweather has joined #ruby
negev has joined #ruby
zapata has joined #ruby
danguita has quit [Quit: Connection closed for inactivity]
venmx has joined #ruby
<negev> hi, does this: https://gist.github.com/m4rkw/1dcdbb3dfe63b29b5343b70a28ce1c5b indicate a memory leak or am i misunderstanding how that should work?
ineb has quit [Ping timeout: 252 seconds]
Bish has joined #ruby
<Bish> >> [true,false].repeated_permutation(5).first
<ruby[bot]> Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<Bish> is that thing broken?
danguita has joined #ruby
nexraf1_ has joined #ruby
nexraf1_ has quit [Client Quit]
nexraf1_ has joined #ruby
nexraf1_ has quit [Client Quit]
nexraf1_ has joined #ruby
nexraf1_ has quit [Client Quit]
nexraf1_ has joined #ruby
nexraf1_ has quit [Client Quit]
nexraf1_ has joined #ruby
lytol_ has joined #ruby
nexraf1 has quit [Quit: WeeChat 2.2]
dogweather has quit [Quit: Leaving]
leitz has joined #ruby
ineb has joined #ruby
apparition has joined #ruby
<Bish> >> true
<ruby[bot]> Bish: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
xfbs has joined #ruby
<phaul> Bish: it's eval.in
<Bish> that was too musk to ask sorry ruby[bot]
<phaul> it's been giving 500 internal server errors for weeks now
<Bish> didn't notice
vondruch_ has joined #ruby
kurko_ has joined #ruby
mikecmpbll has quit [Read error: Connection reset by peer]
mikecmpbll has joined #ruby
vondruch has quit [Ping timeout: 276 seconds]
vondruch_ is now known as vondruch
leitz has quit [Quit: Leaving]
VladGh has quit [Remote host closed the connection]
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
<phaul> ?pizza
<ruby[bot]> here's your pizza: 🍕
<phaul> thank you
<phaul> ?snowman
<ruby[bot]> Here's a snowman for you: ☃
ldnunes has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roshanavand has joined #ruby
rubydoc has quit [Ping timeout: 240 seconds]
rubydoc has joined #ruby
Guest75806 has joined #ruby
<Bish> i've seen that snowman in a stackoverflow post regarding csv in ruby
<Bish> that guy did quote_char:'☃' so it doesn't quote anything
<Bish> since you cannot provide nil there
drale2k_ has joined #ruby
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has joined #ruby
roshanavand has quit [Ping timeout: 244 seconds]
whysthatso has joined #ruby
roshanavand has joined #ruby
wojnar has joined #ruby
<Bish> whysthatso: nice nick
<whysthatso> it's my long time companion :)
xfbs has quit [Quit: afk]
Guest75806 has quit [Ping timeout: 240 seconds]
<Bish> would fit me well :>
xfbs has joined #ruby
jottr has joined #ruby
whysthatso has quit [Quit: whysthatso]
xfbs has quit [Quit: afk]
whysthatso has joined #ruby
bmurt has joined #ruby
xfbs has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.2]
<whysthatso> @Bish well, that's not an option any more now, is it
xfbs has quit [Quit: afk]
za1b1tsu has joined #ruby
MuffinPimp has quit [Quit: Goodbye.]
MuffinPimp has joined #ruby
PellIT is now known as m0nty
bak1an has joined #ruby
dionysus69_ has joined #ruby
dionysus69 has quit [Ping timeout: 268 seconds]
dionysus69_ is now known as dionysus69
jottr has quit [Quit: WeeChat 2.2]
chongtxtx has joined #ruby
nexraf1_ has quit [Quit: WeeChat 2.2]
nchambers has quit [Ping timeout: 264 seconds]
zacts has quit [Ping timeout: 264 seconds]
cxl has joined #ruby
Rapture has joined #ruby
nexraf1 has joined #ruby
nexraf1 has quit [Client Quit]
nexraf1 has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.2]
vondruch_ has joined #ruby
vondruch has quit [Ping timeout: 264 seconds]
vondruch_ is now known as vondruch
apparition has quit [Quit: Bye]
Inline has joined #ruby
discopatrick has joined #ruby
dionysus69 has quit [Ping timeout: 272 seconds]
rubydoc has quit [Remote host closed the connection]
rubydoc has joined #ruby
nchambers has joined #ruby
gnufied has quit [Quit: Leaving]
dionysus69 has joined #ruby
nexraf1_ has joined #ruby
nexraf1 has quit [Quit: WeeChat 2.2]
gnufied has joined #ruby
vondruch has quit [Quit: vondruch]
Azure|dc has quit [Ping timeout: 272 seconds]
vondruch has joined #ruby
Azure has joined #ruby
<dionysus69> any idea why these two examples are returning incorrect results? https://gist.github.com/webzorg/b4e3d783ea1aa8a37970ecca8f1b43e5
<dionysus69> the icorrect one should return 0.778457 instead of 0.08
rubydoc has quit [Ping timeout: 245 seconds]
samort7 has joined #ruby
marmotini_ has joined #ruby
SteenJobs has joined #ruby
rubydoc has joined #ruby
MoritaShinobu has quit [Remote host closed the connection]
<Cork> anyone know how to convert the integer 257 to [1,1] in ruby? (bytes in an array)
<phaul> 257.divmod 256 would result in [1,1]
<phaul> but Im not sure what the conversion rules are here
<Cork> well as one byte can't be more then 256 the rest ends up in the next byte
<Cork> but ya divmod might be a solution
<Cork> but ya, cool that is exactly what i needed! thx!
<phaul> you are welcome
rubydoc has quit [Remote host closed the connection]
rippa has joined #ruby
chouhoulis has joined #ruby
orbyt_ has joined #ruby
justicefries has joined #ruby
<phaul> ?float, dionysus69
<phaul> ?float
<ruby[bot]> Your numbers don't add up? You get "weird" results? read http://floating-point-gui.de/
mangold has quit [Quit: This computer has gone to sleep]
<dionysus69> phaul: no it is big_decimal
justicefries has quit [Quit: Textual IRC Client: www.textualapp.com]
<phaul> what makes it bigdecimal?
<dionysus69> I converted it above and then I also checked later on second line it is also Bdecimal
<dionysus69> incorrect i is being returned
<dionysus69> it should return 5 or 6 instead of 1
<dionysus69> in the incorrect example
clemens3 has quit [Ping timeout: 252 seconds]
<phaul> but isnt the issue that by that time you convert to bigdecimal you already lost some precision with floats?
<dionysus69> that's not the issue though in this particular example, it is regex :S
whysthatso has quit [Quit: whysthatso]
beowuff has joined #ruby
eddof13 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Yxhuvud has quit [Quit: No Ping reply in 180 seconds.]
nchambers has quit [Quit: WeeChat 2.2]
ph88 has quit [Ping timeout: 264 seconds]
akaiiro has joined #ruby
<Cork> anybody know how to parse a OpenSSL::PKey::EC key from a byte string?
voolik has quit [Ping timeout: 246 seconds]
xuanrui has quit [Remote host closed the connection]
<Cork> OpenSSL::PKey::EC.new doesn't seam capable of parsing
DTZUZU has quit [Read error: Connection reset by peer]
orbyt_ has joined #ruby
<juri_> part
Guest75806 has joined #ruby
juri_ has left #ruby [#ruby]
blackmesa has joined #ruby
dbugger_ has joined #ruby
beefjoe has joined #ruby
<ineb> urgh how would i imeplement a long running task that returns something and reports its status? ret = task.run { |progress| p progress }
<ineb> in this case its a push based design and if 'p progress' blocks, everything blocks.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<ineb> does some sort of async yield makes sense here? or does make a pull based approach more sense?
<ineb> job_status = job.run; while job_status.finished?; p status.progress; job_status.value
<ineb> or something like that
<baweaver> ineb: y'mean until job finished?
SteenJobs has quit [Quit: SteenJobs]
<baweaver> Set a variable in the loop that you define above it.
<baweaver> Blocks set up a lexical closure. That's fancy talk for saying they remember the area around where they were defined, and if a variable is defined outside, it can set stuff to it.
<baweaver> Otherwise that new variable is only in the block, and it's not getting out.
<baweaver> Don't remember if while and until work like that though
<phaul> no whle and until are not scopes
Tuor has quit [Quit: Konversation terminated!]
<baweaver> Stuck in Rambda land again
<baweaver> n = 5; while n > 0; x = n; n -= 1; end; p x
* baweaver should get some coffee
<ineb> here are my two solutions i can think of https://paste.xinu.at/y3NGJQ/rb
tdy has quit [Ping timeout: 240 seconds]
<ineb> whats the better variant for an api? like a fileupload or something
<baweaver> How does task_status work?
<baweaver> using S3 uploaders mostly
<baweaver> or ActiveStorage
<baweaver> Most of them defer to a job queue of some sort that's built in
jcarl43 has joined #ruby
anothertorusr has quit [Quit: Moving onto the afterlife]
<phaul> ineb: so here you are providing the task API, and you are asking how to give control to your users if they want to print progres..?
<ineb> phaul: yes
<phaul> who creates the task? you or them?
<phaul> ie who defines what's in the task
<ineb> me. its really just one possible task here
<ineb> no configuration needed so far
<phaul> I like your first solution then. Its simple
<ineb> ok thanks
conta1 has joined #ruby
SteenJobs has joined #ruby
anothertorusr has joined #ruby
ramfjord has joined #ruby
Creatornator has joined #ruby
chamunks has quit [Quit: Don't worry I'm not gone yet.]
beefjoe has quit [Remote host closed the connection]
beefjoe has joined #ruby
rubydoc has joined #ruby
orbyt_ has joined #ruby
chamunks has joined #ruby
dmitch has joined #ruby
eckhardt_ has joined #ruby
kurko_ has joined #ruby
darkhanb has joined #ruby
mikecmpb_ has joined #ruby
mikecmpb_ has quit [Client Quit]
mikecmpbll has quit [Ping timeout: 272 seconds]
blackmesa has quit [Ping timeout: 252 seconds]
akem has quit [Ping timeout: 252 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
beefjoe has quit [Quit: <3]
ramfjord has quit [Ping timeout: 268 seconds]
blackmesa has joined #ruby
nexraf1_ has quit [Ping timeout: 264 seconds]
ramfjord has joined #ruby
wojnar has quit [Remote host closed the connection]
akem has joined #ruby
mzo has joined #ruby
xuanrui has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 245 seconds]
aupadhye has quit [Remote host closed the connection]
akem has quit [Remote host closed the connection]
ramfjord has joined #ruby
akem has joined #ruby
desperek has joined #ruby
sauvin has quit [Ping timeout: 264 seconds]
ramfjord has quit [Ping timeout: 272 seconds]
mzo has quit [Quit: b-bye :3]
Xiti has quit [Quit: Xiti]
venmx has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
xfbs has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
<_ari> hello
<phaul> hi _ari
chouhoulis has joined #ruby
tdy has joined #ruby
Xiti has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
Synthead has joined #ruby
<Synthead> is there a lib that'll help convert something like "200M" (a string from user input) to bytes in 200 MiB?
Eiam has quit [Quit: Textual IRC Client: www.textualapp.com]
conta1 has quit [Quit: conta1]
desperek has quit [Quit: xoxo]
<Synthead> Filesize.from seems to do the trick! Thanks!
Synthead has quit [Remote host closed the connection]
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 264 seconds]
akem has quit [Remote host closed the connection]
SteenJobs has quit [Read error: Connection reset by peer]
SteenJobs has joined #ruby
akem has joined #ruby
ramfjord has joined #ruby
Eiam has joined #ruby
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dmitch has joined #ruby
jottr has joined #ruby
Creatornator has joined #ruby
AJA4350 has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 264 seconds]
AJA4350 has joined #ruby
AJA4350 has quit [Client Quit]
dmitch has quit [Ping timeout: 252 seconds]
AJA4350 has joined #ruby
akem has quit [Ping timeout: 264 seconds]
akem has joined #ruby
akem__ has joined #ruby
akem has quit [Ping timeout: 264 seconds]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kurko_ has joined #ruby
SteenJobs has quit [Read error: Connection reset by peer]
SteenJobs has joined #ruby
akem__ has quit [Ping timeout: 252 seconds]
discopatrick has quit [Quit: Connection closed for inactivity]
OrangeManBad has quit [Quit: Bye]
OrangeManBad has joined #ruby
donofrio_ has joined #ruby
cthu| has joined #ruby
marmotini has joined #ruby
MyMind has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lytol has joined #ruby
flips_ has joined #ruby
catsed has joined #ruby
LenPayne_ has joined #ruby
r3m_ has joined #ruby
ged_ has joined #ruby
m4rCsi has joined #ruby
chihhsin has joined #ruby
ohcibi_ has joined #ruby
dostoyev1ky has joined #ruby
crankhar1er has joined #ruby
miah_ has joined #ruby
c0ncealed4 has joined #ruby
Freeaqingme has quit [Ping timeout: 246 seconds]
Freeaqingme has joined #ruby
rippa has quit [*.net *.split]
marmotini_ has quit [*.net *.split]
Rapture has quit [*.net *.split]
drale2k_ has quit [*.net *.split]
lytol_ has quit [*.net *.split]
braincrash has quit [*.net *.split]
wolfshappen has quit [*.net *.split]
c0ncealed3 has quit [*.net *.split]
Bish has quit [*.net *.split]
jidar has quit [*.net *.split]
cthulchu_ has quit [*.net *.split]
donofrio has quit [*.net *.split]
fribmendes has quit [*.net *.split]
funnel has quit [*.net *.split]
cats has quit [*.net *.split]
Sembei has quit [*.net *.split]
ohcibi has quit [*.net *.split]
m27frogy has quit [*.net *.split]
leafyleong has quit [*.net *.split]
ged has quit [*.net *.split]
veloutin has quit [*.net *.split]
z3uS has quit [*.net *.split]
maxmanders_ has quit [*.net *.split]
crankharder has quit [*.net *.split]
mahlon has quit [*.net *.split]
LenPayne has quit [*.net *.split]
paraxial has quit [*.net *.split]
pabs has quit [*.net *.split]
aloy has quit [*.net *.split]
connor_goodwolf has quit [*.net *.split]
dous has quit [*.net *.split]
silviu has quit [*.net *.split]
guardian has quit [*.net *.split]
dostoyevsky has quit [*.net *.split]
TheBrayn has quit [*.net *.split]
r3m has quit [*.net *.split]
Biohazard has quit [*.net *.split]
miah has quit [*.net *.split]
chihhsin_ has quit [*.net *.split]
flips has quit [*.net *.split]
ged_ is now known as ged
flips_ is now known as flips
catsed is now known as cats
r3m_ is now known as r3m
TheBrayn has joined #ruby
fribmendes has joined #ruby
jidar has joined #ruby
Creatornator has joined #ruby
m27frogy has joined #ruby
ramfjord has joined #ruby
leafyleong has joined #ruby
funnel has joined #ruby
troulouliou_div2 has joined #ruby
troulouliou_div2 has quit [Max SendQ exceeded]
aloy has joined #ruby
xuanrui has quit [Ping timeout: 245 seconds]
paraxial has joined #ruby
troulouliou_div2 has joined #ruby
clemens3 has joined #ruby
akem has joined #ruby
ujjain has quit [Ping timeout: 245 seconds]
akem has quit [Ping timeout: 264 seconds]
cd has joined #ruby
xfbs has quit [Quit: afk]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akem has joined #ruby
mikecmpbll has joined #ruby
cd has quit [Quit: cd]
bmurt has joined #ruby
Xiti has quit [Quit: Xiti]
eddof13 has quit [Quit: eddof13]
cd has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
blackmesa has quit [Ping timeout: 260 seconds]
ellcs has joined #ruby
akem__ has joined #ruby
blackmesa has joined #ruby
Xiti has joined #ruby
Nicmavr has joined #ruby
akem has quit [Ping timeout: 252 seconds]
Xiti has quit [Quit: Xiti]
orbyt_ has joined #ruby
xfbs has joined #ruby
troulouliou_div2 has quit [Read error: Connection reset by peer]
whysthatso has joined #ruby
orbyt_ has quit [Ping timeout: 252 seconds]
dbugger_ has quit [Quit: Leaving]
Xiti has joined #ruby
lytol has quit [Remote host closed the connection]
ramfjord has quit [Ping timeout: 268 seconds]
mochiyoda has quit [Quit: Konversation terminated!]
dostoyev1ky is now known as dostoyevsky
jottr has quit [Ping timeout: 240 seconds]
whysthatso has quit [Quit: whysthatso]
SteenJobs has quit [Quit: SteenJobs]
negev has left #ruby [#ruby]
jottr has joined #ruby
xuanrui has joined #ruby
SteenJobs has joined #ruby
xfbs has quit [Quit: afk]
<samort7> having trouble sorting an array of hashes
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<samort7> ed-e6e4f709.png"]], :kit_num=>"15", :kit_name=>"Artillery Truck"}, {:item_list=>[["0", "Ground Support Attack Plane", "https://eaassets-a.akamaihd.net/battlelog/battlebinary/gamedata/Tunguska/113/23/ground-support-2-seater-71e9cea3.png"]], :kit_num=>"13", :kit_name=>"Attack Plane"}]
<samort7> How would I sort the array of hashes based on the value of the :kit_num key?
reber has quit [Remote host closed the connection]
<phaul> array.sort_by { |h| h[:kint_num] }
<samort7> Here's a better formatted version
<samort7> phaul: I tried that but I keep getting undefined method 'kin_num' error
<samort7> *kit_num
<phaul> that's a typo. kit_num
<phaul> that's because you are missing the :
<phaul> read my version carefully
<phaul> :kit_num
<samort7> oh
<samort7> it did work
<samort7> shouldn't sort_by!(&:kit_num) also work?
<phaul> no
<phaul> that would assume you have a method on the items kit_num
<phaul> it would work with openstructs instead of hashes for instance
<phaul> its a shortened form of sort_by! { |x| x.kit_num }
<samort7> oooh
<samort7> ok, i was confusing symbols with methods i guess
<samort7> thanks!
<phaul> np
<phaul> to be fair :something is always a symbol.
<phaul> this &: is a bit of magic syntax to shorten blocks..
<phaul> but what's after the & is a symbol
Creatornator has joined #ruby
<phaul> a = :length ; ['a', 'bb'].sort_by(&a)
<phaul> also works
mochiyoda has joined #ruby
eddof13 has joined #ruby
<phaul> well this isn't true : phaul | but what's after the & is a symbol
orbyt_ has joined #ruby
nexraf1_ has joined #ruby
<phaul> anything that responds to to_proc ... Symbol, Proc, Method
c0ncealed4 has quit [Remote host closed the connection]
s2013 has joined #ruby
c0ncealed4 has joined #ruby
<samort7> ah, that can be a bit confusing i guess
<phaul> [1,2,3].map(&-> x { 2 * x })
akem__ has quit [Read error: Connection reset by peer]
akem__ has joined #ruby
kujira has joined #ruby
<phaul> class X; def to_proc; -> x { x }; end; end; [1,2,3].map(&X.new)
chouhoulis has joined #ruby
chouhoulis has quit [Ping timeout: 245 seconds]
chouhoulis has joined #ruby
blackmesa has quit [Ping timeout: 276 seconds]
chouhoulis has quit [Ping timeout: 250 seconds]
dmitch has joined #ruby
ldnunes has quit [Quit: Leaving]
cd has quit [Quit: cd]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
trif has quit [Ping timeout: 260 seconds]
Creatornator has joined #ruby
cliluw has quit [Ping timeout: 244 seconds]
phenom has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
trif has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kujira has quit []
ujjain has joined #ruby
jottr has quit [Quit: WeeChat 2.2]
blackmesa has joined #ruby
<baweaver> phaul: want to know something real magic?
<phaul> hit me
<baweaver> ....there's one more thing that responds to to_proc
<baweaver> Hash
<baweaver> Hash#to_proc ~ -> key { self[key] }
<phaul> &list to_proc
<rubydoc> Hash#to_proc, Method#to_proc, Proc#to_proc, Symbol#to_proc
<phaul> makes sense though
cd has joined #ruby
<baweaver> >> [:a, :b, :c].map(&{a: 1, b: 2, c: 3})
<baweaver> => [1,2,3]
ellcs has quit [Ping timeout: 260 seconds]
<phaul> cool, learning something new every day :)
<zenspider> doesn't mean it's a good idea...
OrangeManBad has quit [Quit: Bye]
OrangeManBad has joined #ruby
tdy has quit [Ping timeout: 264 seconds]
havenwood has quit [Quit: ZNC 1.7.1 - https://znc.in]
jtdowney has quit [Quit: Ping timeout (120 seconds)]
jtdowney has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
agrecascino has quit [Ping timeout: 245 seconds]
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
akem__ has quit [Remote host closed the connection]
havenwood has joined #ruby
akem__ has joined #ruby
knight_ has quit [Quit: No Ping reply in 180 seconds.]
mikecmpbll has quit [Quit: inabit. zz.]
agrecascino has joined #ruby
<phaul> interesting... ruby[bot] did not even bother apologising this time.
<phaul> >> 1
<ruby[bot]> phaul: I'm terribly sorry, I could not evaluate your code because of an error: NoMethodError:undefined method `[]' for nil:NilClass
<phaul> there we go :)
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #ruby
xfbs has joined #ruby
eddof13 has quit [Quit: eddof13]
leitz has joined #ruby
tdy has joined #ruby
<zenspider> ugh
eddof13 has joined #ruby
venmx has joined #ruby
<baweaver> zenspider: ugh?
Dimik has joined #ruby
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
clemens3 has quit [Ping timeout: 272 seconds]
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
dmitch has joined #ruby
dmitch has quit [Client Quit]
<phaul> i was just checking out hanami this afternoon, which led me to read most of dry-ruby docs. I'm not convinced. I mean,, I was doing haskell before. so most concepts are familiar to me. But some things just feel so over-engineered in Ruby in those examples.
Creatornator has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
<phaul> the dry-matcher.. the dependency container thing.. It's all about whats fashionable, but I dont like the trend
<phaul> funny how rails is the opposite of what the cool kids are doing these days.
bmurt has joined #ruby
<phaul> good old fahsioned DSL in your classes :D
orbyt_ has quit [Read error: Connection reset by peer]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<phaul> I think we are heading somewhere with functional to where we had been with UML in the 2000s
marmotini has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
juria_roberts has joined #ruby
<juria_roberts> How does ruby provide configure_args and envroot?
nexraf1_ has quit [Ping timeout: 260 seconds]
Creatornator has joined #ruby
<baweaver> juria_roberts: for?
* baweaver doesn't know what either of those are
<zenspider> juria_roberts: not sure your words/question make sense...
<zenspider> phaul: I tend to agree
<baweaver> The problem with most FP gems in Ruby is that they try and be Haskell
<zenspider> I try as much as possible to stick to "do the simplest thing that can possibly work" and that pushes back heavy on all of the dry-* packages (last I looked)
<baweaver> It's a flawed premise from the start, as Ruby has a ton of power to do similar things in its own ways
akem__ has quit [Remote host closed the connection]
<baweaver> That said, making an eloquent DSL / syntax for it is danged hard.
<phaul> yeah, nice to hear Im not alone
Puffball has quit [Remote host closed the connection]
akem__ has joined #ruby
<zenspider> phaul: calibrate accordingly... I'm an edge case. :P
<baweaver> and I'm a basket case
Puffball has joined #ruby
<phaul> Im in good company then
<phaul> fit right in
<baweaver> I've mentioned some of this to them in the past, they're aware, it's just a really hard problem to come up with a good API for it
<phaul> juria_roberts: I don't know these things either, but Im guessing this is a packaging question? like configure_args was what was used to build ruby binary?
<hays> anyone do chruby as a local/user install only?
<hays> i guess just build it with --prefix=$HOME or something?
ellcs has joined #ruby
<hays> one thing i like about rbenv is you can tuck it away in a user directory
orbyt_ has joined #ruby
cliluw has quit [Ping timeout: 240 seconds]
cliluw has joined #ruby
im0nde has quit [Ping timeout: 250 seconds]
xuanrui has quit [Ping timeout: 276 seconds]
<havenwood> hays: I use a home dir for chruby.
eddof13 has quit [Quit: eddof13]
<havenwood> hays: With ruby-install, the default is ~/.rubies if you don't use sudo.
<hays> you just put it in $HOME/.local?
<hays> for chruby itself
<havenwood> hays: ah, I see what you're saying - no, I haven't bothered with that but it does work to prefix, like you suggested
im0nde has joined #ruby
<havenwood> hays: that's ^ an example i wroteup a while ago
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #ruby
<hays> why --no-install-deps
<havenwood> hays: assuming no permissions to do so
<hays> ..fair
xfbs has quit [Quit: afk]
<zenspider> juria_roberts: ...
mangold has joined #ruby
<zenspider> havenwood: wget -O ruby-install-0.6.0.tar.gz https://github.com/postmodern/ruby-install/archive/v0.6.0.tar.gz ?!?
<zenspider> a tarball? oh... because bootstrap issue if it were a gem?
<zenspider> still... why not a git checkout?
<zenspider> man... I'm trying to profile and optimize this code and while the profile is pointing me at things worth working on and my microbenchmarks are definitely showing improvements... the actual improvement on the top level benchmark is ... zero
SeepingN has joined #ruby
zxq2 has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.3]
phaul has quit [Ping timeout: 244 seconds]
ellcs has quit [Ping timeout: 264 seconds]
beowuff has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
SteenJobs has quit [Quit: SteenJobs]
venmx has quit [Ping timeout: 252 seconds]
Creatornator has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Creatornator has joined #ruby
leitz has quit [Quit: Leaving]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
SteenJobs has joined #ruby
houhoulis has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]