havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
kvda has joined #ruby
akaiiro has quit [Ping timeout: 265 seconds]
yokel has quit [Ping timeout: 248 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
mupt has joined #ruby
starseed0000 has quit [Ping timeout: 265 seconds]
caleBOT_ has joined #ruby
mupt has quit [Ping timeout: 265 seconds]
yokel has joined #ruby
FernandoBasso has quit [Quit: Leaving]
karapetyan has joined #ruby
jottr has joined #ruby
caleBOT_ has quit [Ping timeout: 265 seconds]
karapetyan has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 268 seconds]
Jushy has quit [Ping timeout: 240 seconds]
RealUnix28200 has quit []
ellcs has quit [Ping timeout: 256 seconds]
mikeiniowa has quit [Remote host closed the connection]
zachk has quit [Quit: Leaving]
mikeiniowa has joined #ruby
houhoulis has quit [Remote host closed the connection]
ciscam has quit [Ping timeout: 264 seconds]
<baweaver> apeiros / Bish: xf
ciscam has joined #ruby
<baweaver> hashes.select(&Xf[:key_name])
BloopMonster has joined #ruby
<baweaver> Ah, wait, it was Mf for that one.
<baweaver> Mf (modifier functions, overrided operators) - Xf (Scope/Trace for deep hashes) - Qo (Pattern Matching) - Yet (you'll see, but already got the gem name :D)
bradleyprice has joined #ruby
Jushy has joined #ruby
bradleyprice has quit [Ping timeout: 265 seconds]
Azure has quit [Quit: Oops.]
jottr has joined #ruby
Azure has joined #ruby
jottr has quit [Ping timeout: 265 seconds]
cadillac_ has quit [Ping timeout: 240 seconds]
bsamorim has quit [Ping timeout: 240 seconds]
blackmesa has joined #ruby
cadillac_ has joined #ruby
tolerablyjake has joined #ruby
\void has quit [Quit: So long, and thanks for all the fish.]
zlogan2003 has quit [Ping timeout: 240 seconds]
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]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
r0nin has joined #ruby
bjpenn has joined #ruby
r0nin has quit []
gell5 has joined #ruby
gell5 has quit []
blackmesa has quit [Ping timeout: 255 seconds]
roamingdog has joined #ruby
gell5 has joined #ruby
gell5 has quit [Client Quit]
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]
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]
MagePsycho has quit [Ping timeout: 256 seconds]
subroot has joined #ruby
nicht has joined #ruby
RougeT430 has quit [Ping timeout: 245 seconds]
mupt has joined #ruby
jottr has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mupt has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 256 seconds]
karapetyan has joined #ruby
houhoulis has joined #ruby
MagePsycho has joined #ruby
akaiiro has joined #ruby
mrBen2k2k2k has joined #ruby
tolerablyjake has joined #ruby
karapetyan has quit [Ping timeout: 260 seconds]
bonhoeffer has quit [Ping timeout: 252 seconds]
caleBOT has joined #ruby
taylorzr has quit [Ping timeout: 256 seconds]
taylorzr has joined #ruby
subroot has quit [Read error: Connection reset by peer]
jinie has quit [Ping timeout: 264 seconds]
Francisco has quit [Quit: Francisco]
jinie has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kryptoz has joined #ruby
bsamorim has joined #ruby
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
houhoulis has quit [Remote host closed the connection]
braincrash has quit [Quit: bye bye]
nicht has quit [Ping timeout: 256 seconds]
starseed0000 has joined #ruby
braincrash has joined #ruby
s3nd1v0g1us has joined #ruby
s3nd1v0g1us has quit [Max SendQ exceeded]
bjpenn has quit [Ping timeout: 240 seconds]
kvda has joined #ruby
kvda has quit [Client Quit]
kvda has joined #ruby
kobain has quit [Ping timeout: 256 seconds]
duderonomy has quit [Ping timeout: 256 seconds]
xuyuheng has joined #ruby
xuyuheng has quit [Client Quit]
shinnya has quit [Ping timeout: 240 seconds]
noobineer has quit [Ping timeout: 240 seconds]
xuyuheng has joined #ruby
gix- has joined #ruby
gix has quit [Disconnected by services]
cagomez has quit [Read error: Connection reset by peer]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xuyuheng has quit [Client Quit]
akaiiro has quit [Remote host closed the connection]
bjpenn has joined #ruby
ciscam has quit [Ping timeout: 240 seconds]
ciscam has joined #ruby
pauliesaint has joined #ruby
bsamorim has quit [Ping timeout: 240 seconds]
Dimik has quit [Ping timeout: 248 seconds]
rshetty has joined #ruby
bsamorim has joined #ruby
shinnya has joined #ruby
nightw0lf has quit [Read error: Connection reset by peer]
mupt has joined #ruby
rshetty has quit [Remote host closed the connection]
jottr has joined #ruby
kujira has quit [Quit: leaving]
rshetty has joined #ruby
shinnya has quit [Ping timeout: 264 seconds]
mupt has quit [Ping timeout: 268 seconds]
jottr has quit [Ping timeout: 260 seconds]
rshetty has quit [Ping timeout: 264 seconds]
karapetyan has joined #ruby
bradleyprice has joined #ruby
rshetty has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
bairyn is now known as ByronJohnson
bradleyprice has quit [Ping timeout: 256 seconds]
leah2 has quit [Ping timeout: 240 seconds]
shinnya has joined #ruby
leah2 has joined #ruby
lupine has quit [Remote host closed the connection]
lupine has joined #ruby
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
mynameisdebian has joined #ruby
bsamorim has quit [Ping timeout: 240 seconds]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
NightMonkey has joined #ruby
roamingdog has joined #ruby
NightMonkey has quit [Ping timeout: 240 seconds]
BloopMonster has quit [Ping timeout: 240 seconds]
reber has joined #ruby
apeiros has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
schleppel has joined #ruby
kvda has joined #ruby
mozzarella has quit [Quit: WeeChat 2.0.1]
apeiros has joined #ruby
anisha has joined #ruby
aupadhye has joined #ruby
apeiros has quit [Remote host closed the connection]
mtkd has joined #ruby
cyberg has quit [Ping timeout: 265 seconds]
cyberg has joined #ruby
npgm has quit [Quit: Connection closed for inactivity]
zlogan2003 has joined #ruby
mozzarella has joined #ruby
alex`` has joined #ruby
Guest96099 has quit [Read error: Connection reset by peer]
mupt has joined #ruby
Nicmavr has joined #ruby
Nicmavr is now known as Guest20471
jottr has joined #ruby
taylorzr has quit [Ping timeout: 245 seconds]
mupt has quit [Ping timeout: 264 seconds]
jottr has quit [Ping timeout: 265 seconds]
karapetyan has joined #ruby
ByronJohnson has quit [Remote host closed the connection]
karapetyan has quit [Ping timeout: 265 seconds]
brahmana has joined #ruby
ellcs has joined #ruby
bairyn has joined #ruby
graphene has quit [Remote host closed the connection]
dionysus69 has joined #ruby
starseed0000 has quit [Ping timeout: 265 seconds]
ellcs has quit [Ping timeout: 260 seconds]
graphene has joined #ruby
mozzarella has quit [Quit: WeeChat 2.0.1]
suukim has joined #ruby
brahmana has quit [Ping timeout: 252 seconds]
starseed0000 has joined #ruby
TomyWork has joined #ruby
TvL2386_ has joined #ruby
yohji has joined #ruby
mozzarella has joined #ruby
TvL2386 has quit [Ping timeout: 256 seconds]
brahmana has joined #ruby
Mike11 has joined #ruby
<brahmana> Hi all.. I am sending a HTTP POST request from my ruby program. The post body size is : 12026283. I am getting an EPIPE error. But the server has received all the data.
mynameisdebian has quit [Remote host closed the connection]
<brahmana> What could have caused the EPIPE error?
sysvalve has joined #ruby
simmaniac has joined #ruby
troys has quit [Quit: Bye]
claudiuinberlin has joined #ruby
sysvalve has quit [Ping timeout: 268 seconds]
zapata has quit [Ping timeout: 256 seconds]
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
BloopMonster has joined #ruby
<MagePsycho> anyone using capistrano here?
SuperLag has quit [Remote host closed the connection]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kryptoz has quit [Remote host closed the connection]
kryptoz has joined #ruby
kryptoz has quit [Remote host closed the connection]
brahmana has quit [Ping timeout: 252 seconds]
kryptoz has joined #ruby
kvda has joined #ruby
lxsameer has joined #ruby
NightMonkey has joined #ruby
naftilos76 has joined #ruby
kryptoz has quit [Ping timeout: 260 seconds]
Burgestrand has joined #ruby
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
zapata has joined #ruby
ellcs has joined #ruby
kvda has joined #ruby
alem0lars has joined #ruby
tvw has joined #ruby
pauliesaint has quit [Remote host closed the connection]
pauliesaint has joined #ruby
pauliesaint has quit [Client Quit]
pauliesaint has joined #ruby
graphene has quit [Remote host closed the connection]
bairyn has quit [Ping timeout: 256 seconds]
graphene has joined #ruby
pauliesaint has quit [Quit: pauliesaint]
mikecmpbll has joined #ruby
pauliesaint has joined #ruby
Beams has joined #ruby
pauliesaint has quit [Quit: pauliesaint]
blackmesa has joined #ruby
za1b1tsu has joined #ruby
bairyn has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
mupt has joined #ruby
Mike11 has quit [Ping timeout: 256 seconds]
agent_white has quit [Quit: bbl]
jraavis has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
mupt has quit [Ping timeout: 260 seconds]
ellcs has quit [Ping timeout: 264 seconds]
rshetty has quit [Ping timeout: 276 seconds]
pauliesaint has joined #ruby
blackmesa has quit [Quit: WeeChat 2.1]
kvda has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
andikr has joined #ruby
mikecmpbll has quit [Ping timeout: 248 seconds]
mikecmpbll has joined #ruby
NL3limin4t0r has joined #ruby
amar_ has joined #ruby
nowhere_man has joined #ruby
starseed0000 has quit [Ping timeout: 255 seconds]
jottr has joined #ruby
konsolebox has joined #ruby
amar_ has quit [Ping timeout: 245 seconds]
biberu has joined #ruby
ellcs has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
Hexafox[I] has joined #ruby
<Hexafox[I]> Hi o/
rshetty has joined #ruby
dhollin3 has joined #ruby
Gbardis has joined #ruby
alem0lars has quit [Quit: Leaving]
conta has joined #ruby
alem0lars has joined #ruby
Gbardis has quit [Read error: Connection reset by peer]
anikras has joined #ruby
dhollinger has quit [Ping timeout: 260 seconds]
<anikras> hi, i have an application in ruby&rails and I have my app.po with language translated
Hexafox[I] has quit [Ping timeout: 256 seconds]
<anikras> but, when I am changed language I have this error
<anikras> No such file or directory @ rb_sysopen - config/locale/ca/app.po
Gbardis has joined #ruby
Hexafox[I] has joined #ruby
<Hexafox[I]> My internet just cut out and I can't tell if my last messages sent so I'll resend them.
<Hexafox[I]> Does anyone here have advice for getting "go to definition" working in vim?
<Hexafox[I]> I have been trying to see if vim is a usable replacement for rubymine but this feature is absolutely critical and I can't see much up to date info
<anikras> I am using this version: ruby 2.3.1p112
WinterFox[m] has joined #ruby
<Gbardis> hey everyone , i want to read a larger txt file(8gb) . i use File.foreach to read the file, but i alway get this error 'ArgumentError: negative string size (or size too big)'
<Gbardis> There is a way to read this file ?
JackMc has quit [Ping timeout: 256 seconds]
<konsolebox> Hexafox[I]: it would be a little bit surprising if vim has that feature
<Hexafox[I]> konsolebox, Not by default but I'm pretty sure it can with plugins.
<Hexafox[I]> I just can't see how vim is useful for ruby development without this.
<konsolebox> Hexafox[I]: yeah, i guess someone might have made a plugin for it
<konsolebox> anikras: try #RubyOnRails too
JackMc has joined #ruby
<konsolebox> Gbardis: are you using a 64-bit version of Ruby?
<konsolebox> Gbardis: ruby --version
<Gbardis> konsolebox: i have no idea if it is 64 bit , ruby version 2.5.1
rippa has joined #ruby
<Gbardis> konsolebox: ruby 2.5.1p57 (2018-03-29 revision 63029) [x86_64-linux]
simmaniac is now known as sysvalve
gregf_ has joined #ruby
karapetyan has joined #ruby
sphenxes has joined #ruby
sylario has joined #ruby
karapetyan has quit [Ping timeout: 256 seconds]
<konsolebox> Gbardis: how about the output of `ruby -e 'puts 0.size'`?
<konsolebox> Gbardis: i tried it on a 5G file (size greater than 2^32), and it doesn't show the error
amar_ has joined #ruby
<Gbardis> konsolebox: The output is 8
rshetty has quit [Remote host closed the connection]
<konsolebox> well that's odd
rshetty has joined #ruby
jinie has quit [Quit: ZNC 1.6.1 - http://znc.in]
<konsolebox> Gbardis: the way you execute File.foreach is like this, correct? File.foreach('/path/to/file'){ |line| puts line }
<Gbardis> konsolebox: correct
sphenxes has quit [Remote host closed the connection]
<konsolebox> Gbardis: care to show a snippet of the command?
amar_ has quit [Remote host closed the connection]
amar_ has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
pnkl has joined #ruby
Gbardis has quit [Read error: Connection reset by peer]
Gbardis has joined #ruby
guille-moe has joined #ruby
amar_ has quit [Ping timeout: 256 seconds]
conta has quit [Quit: conta]
<anikras> konsolebox, ok, thanks
RougeR has joined #ruby
donofrio has quit [Remote host closed the connection]
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
clemens3 has joined #ruby
<Gbardis> konsolebox: i manage to create a smaller files and test the file read , i cant read file larger than 2gb
<konsolebox> Gbardis: that might be build or system-related
<Gbardis> konsolebox: hmmm ok ,what ruby version use to test file read ?
nowhere_man has quit [Ping timeout: 245 seconds]
tekk has quit [Quit: ZNC - http://znc.in]
<konsolebox> Gbardis: i don't think it really has something to do with versions of Ruby, (i tested it with 2.2 and 2.5). it's probably on how Ruby is configured during its compilation from source, or the features the system or the library provides
<konsolebox> Gbardis: perhaps you can ask your distro on how they built the ruby package, and report the error
suukim has quit [Quit: Konversation terminated!]
zapata has quit [Ping timeout: 256 seconds]
<Gbardis> konsolebox: I understand,thnx for your time.
BloopMonster has quit [Ping timeout: 264 seconds]
jraavis has joined #ruby
mupt has joined #ruby
kryptoz has joined #ruby
simmaniac has joined #ruby
agimenez has joined #ruby
mupt has quit [Ping timeout: 248 seconds]
sysvalve has quit [Disconnected by services]
agimenez is now known as sysvalve
anisha has quit [Read error: Connection reset by peer]
Technaton has joined #ruby
simmaniac has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
drale2k_ has joined #ruby
Technaton has quit [Quit: ZNC 1.6.4 - http://znc.in]
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
nowhere_man has joined #ruby
apeiros has joined #ruby
jottr has joined #ruby
mattb20 has joined #ruby
<mattb20> hi anyone here got a good handle on rspec? I am writing a bank app, I want to test my bank class will make a call to the transaction class when user makes a deposit, however it appears to not be calling it even if I have what I see, the correct code, can someone help? test snippet and method snippet here https://gist.github.com/mattb20/f98091f75dee6a07ed567fa4074bccc0
jrafanie has joined #ruby
<canton7> mattb20, first point: you need to set up the expectations *first8
InfinityFye has joined #ruby
jottr has quit [Ping timeout: 276 seconds]
InfinityFye has left #ruby [#ruby]
<mattb20> Thanks, I would appreciate any advice re: coupling using doubles etc as well!
<Radar> That seems to be written in an older syntax of RSpec.
<Radar> (should_receive vs expect(Transaction).to receive(:new))
<mattb20> what exactly do you mean set up the expectations?
<mattb20> so I would write my expectation as the first line and then underneath call the function?
<mattb20> I also had this issue where I was specifying 3 arguments it was only receiving 1
<mattb20> oh that's strange, putting on the bottom line passes it
<mattb20> why is that?
<Radar> Arrange, Act, Assert.
<Radar> Except when checking when methods get called ;)
<Radar> top line in your spec should be expect(Transaction).to receive(:new)
<mattb20> is it because the function finishes the call so it doesn't know anything to do with what goes on during the execution? if you put the expecation before its expecting a call?
<mattb20> thanks, and do you think I should be using a double in test?
<Radar> Not in this test.
amar_ has joined #ruby
<mattb20> thanks!
mattb20 has quit [Quit: Page closed]
amar_ has quit [Ping timeout: 240 seconds]
rshetty has quit [Read error: Connection reset by peer]
rshetty has joined #ruby
rshetty has quit [Ping timeout: 260 seconds]
RougeR has quit [Ping timeout: 260 seconds]
nowhere_man has quit [Ping timeout: 276 seconds]
nowhere_man has joined #ruby
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
ldnunes has joined #ruby
jottr has joined #ruby
kobain has joined #ruby
pnkl has quit [Quit: The Lounge - https://thelounge.github.io]
anisha has quit [Read error: No route to host]
kapil___ has joined #ruby
ikbenhet has joined #ruby
reber__ has joined #ruby
noobineer has joined #ruby
reber has quit [Ping timeout: 245 seconds]
jottr has quit [Ping timeout: 245 seconds]
AJA4350 has joined #ruby
Technaton has joined #ruby
anisha has joined #ruby
noobineer has quit [Ping timeout: 256 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
nowhereman_ has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
RougeR has quit [Read error: No route to host]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
anisha has quit [Ping timeout: 256 seconds]
jraavis has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
kobain has quit [Ping timeout: 256 seconds]
BloopMonster has joined #ruby
anisha has joined #ruby
zautomata has quit [Ping timeout: 240 seconds]
zautomata has joined #ruby
jottr has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rshetty has joined #ruby
<Bish> if i have [[1,[2,3,4]],[5,[6,7,9]]]
<Bish> is there a cool way to get
zautomata has quit [Read error: Connection reset by peer]
<Bish> [1,2],[1,3],[1,4],[5,6],[5,7]
<Bish> other than inject/each_with_object ?
drale2k_ has joined #ruby
jraavis has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
<Burgestrand> >> [[1,[2,3,4]],[5,[6,7,9]]].map { |(a, b)| [a].product(b) }.flatten(1)
<ruby[bot]> Burgestrand: # => [[1, 2], [1, 3], [1, 4], [5, 6], [5, 7], [5, 9]] (https://eval.in/1032030)
<Burgestrand> :D
rshetty has quit [Ping timeout: 256 seconds]
<Burgestrand> Bish ^
bak1an has joined #ruby
rain1 has quit [Ping timeout: 260 seconds]
Dbugger has joined #ruby
eblip has joined #ruby
def_jam has joined #ruby
eb0t has quit [Ping timeout: 240 seconds]
eb0t_ has quit [Ping timeout: 260 seconds]
<canton7> >> [[1,[2,3,4]],[5,[6,7,9]]].flat_map{|a,b|[a].product(b)}
<ruby[bot]> canton7: # => [[1, 2], [1, 3], [1, 4], [5, 6], [5, 7], [5, 9]] (https://eval.in/1032043)
* canton7 shaved a couple of characters off
desperek has joined #ruby
kryptoz has quit [Remote host closed the connection]
anisha has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
maasha has joined #ruby
ellcs1 has joined #ruby
<maasha> I forgot how to make ruby include gems in ~/.gem ?
<Bish> thanks}
<Bish> i figured something like that
<Bish> maasha: depends on your environment variables
<Bish> and or configuration
<maasha> Bish: none set
<maasha> On Debian/Linux
Jushy has quit [Read error: Connection reset by peer]
jrafanie has joined #ruby
<konsolebox> maasha: default setup should include them, unless Debian makes it act differently, or you're trying to include gems installed for a different version of ruby
jottr has joined #ruby
<maasha> konsolebox: this is deep inside some docker image - so everything is a bit funky
pauliesaint_ has joined #ruby
pauliesaint has quit [Ping timeout: 276 seconds]
<Bish> maasha: so it has nothing to do with your debian at all :D
<maasha> konsolebox: basically I have copied compiled gems from one image to another to reduce image size
<konsolebox> maybe a debian image
<Bish> maasha: are you root when installing them?
<maasha> Bish: well, it is a Unix type OS :o)
<Bish> maasha: so is mac os x
pauliesaint_ is now known as pauliesaint
<Bish> so is the the new windows kernel
<maasha> Bish: Debian could be Herd
<Bish> maasha: fair enough
<maasha> *hurd
<Bish> well, docker tends to be root inside the docker file
<Bish> you might have ran bundler or whatever as root
<Bish> which would result your games to be installed
<Bish> /usr/local
<Bish> or /usr/lib
<Bish> gems*
rshetty has joined #ruby
<maasha> So gems are in /home/biodsl/.gems/ - I think I need to set some GEM_HOME or GEM_PATH env
<konsolebox> or you need to run it as biodsl
<konsolebox> not root
jottr has quit [Ping timeout: 256 seconds]
anikras has quit [Quit: Ex-Chat]
kryptoz has joined #ruby
ellcs1 has quit [Ping timeout: 240 seconds]
<Bish> sudo -u biodsl bundler install
<Bish> or with docker natively
BloopMonster has quit [Ping timeout: 256 seconds]
<NL3limin4t0r> Burgestrand: use flat_map instead, it has a performance advantage over .map.flatten(1)
<NL3limin4t0r> >> [[1,[2,3,4]],[5,[6,7,9]]].flat_map { |(a, b)| [a].product(b) }
<ruby[bot]> NL3limin4t0r: # => [[1, 2], [1, 3], [1, 4], [5, 6], [5, 7], [5, 9]] (https://eval.in/1032103)
<NL3limin4t0r> Bish: ^
<konsolebox> maasha: maybe you can use them: https://unix.stackexchange.com/questions/203376/how-to-set-ruby-gem-home-and-gem-path. just watch out for binary incompatibilities.
<maasha> konsolebox: I am biodsl, but I get '`require': cannot load such file -- BioDSL (LoadError)'
addyluxe has joined #ruby
<Bish> NL3limin4t0r: somebody already said that
<konsolebox> maasha: run `ruby -e 'puts Gem.user_dir'` and see if the output matches your gems directory
<NL3limin4t0r> Bish: Look at my comment above.
<maasha> konsolebox: I did try GEM_HOME and GEM_PATH, but that didn't do the trick, perhaps that is specific to rvm
Asher has quit [Ping timeout: 256 seconds]
<konsolebox> maasha: no, perhaps your version of ruby is different like i said
jcalla has joined #ruby
<Bish> NL3limin4t0r: somebody already said that
<maasha> konsolebox: yes, hmm
cadillac_ has quit [Ping timeout: 260 seconds]
<konsolebox> maasha: it's really hacky to reuse gems that were built from a different system because of possible incompatibility with the system or the installed ruby
<maasha> konsolebox: yup, I want to reduce docker image size from ~800Mb. The goal is 130Mb (base image is 101Mb)
<konsolebox> why not just work on top of alpine
<maasha> konsolebox: this biodsl requires extensions to be build using gcc. I am most confident with Debian type systems.
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<maasha> konsolebox: so I need the build-essentials packages and they are bulky
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
kryptoz has quit [Remote host closed the connection]
bsamorim has joined #ruby
cadillac_ has joined #ruby
zapata has joined #ruby
hanmac has quit [Ping timeout: 265 seconds]
Inline has joined #ruby
mupt has joined #ruby
<konsolebox> maasha: you can try building the gems on a temporary image with build-essentials package. you then transfer the .gem directory to the real image. it may work if the built gems end up not requiring runtime dependencies from the build-essentials package. it's a risk that's up to you to take.
<maasha> konsolebox: that is exactly what I am working on. Got it to work even! Image is 287Mb, so still need to remove 50% if possible
mattb20 has joined #ruby
hanmac has joined #ruby
Mike11 has joined #ruby
<mattb20> hello, sorry I have another question about rspec https://gist.github.com/mattb20/c50851f5b3abe7ef0ada62af7d800136, this code and spec is giving me TypeError: no implicit conversion of Array into Integer on line 5, wtf!?
<konsolebox> maasha: a Gentoo-based distro or image is very ideal for your target, but unfortunately you want Debian
<maasha> konsolebox: ah, well, I always go back to Debian for stability
Dimik has joined #ruby
<konsolebox> stability is very relative in my opinion
drale2k_ has joined #ruby
desperek has quit [Quit: xoxo]
jottr has joined #ruby
jottr has quit [Ping timeout: 255 seconds]
za1b1tsu has quit [Quit: WeeChat 2.1]
suukim has joined #ruby
Burgestrand has quit [Quit: Closing time!]
maasha has quit [Quit: Page closed]
mtkd has quit [Read error: Connection reset by peer]
mtkd has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
riton has joined #ruby
zapata has quit [Ping timeout: 256 seconds]
Asher has joined #ruby
jraavis has quit [Quit: Textual IRC Client: www.textualapp.com]
<riton> hi guys, I'm trying to use a 'gem' installed with 'gem install -i /path/to/directory mygem' in this script https://pastebin.com/G1mNzdBJ . With ruby 2.2.x or ruby 2.3.1p112 (Ubuntu 16.04 version) this works. With ruby 2.4.x or 2.5.x this does not seem to work. How can I achieve this in those ruby versions ? Thanks
<ruby[bot]> riton: we in #ruby do not like pastebin.com, it loads slowly for most, has ads which are distracting and has terrible formatting. Please use https://gist.github.com
<riton> code reposted here https://gist.github.com/riton/21465ee4b23d50ab55e67cbb4ba76d20 to satisfy the ruby bot :)
Nomekrax has joined #ruby
cyberg has quit [Ping timeout: 276 seconds]
Gbardis has quit [Read error: Connection reset by peer]
cyberg has joined #ruby
beefjoe has joined #ruby
kryptoz has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sauvin has quit [Ping timeout: 245 seconds]
<darix> riton: try Gem.path << '/path/to/directory'
jottr has joined #ruby
mattb20 has quit [Ping timeout: 252 seconds]
amar_ has joined #ruby
aupadhye has quit [Ping timeout: 264 seconds]
mupt has quit [Ping timeout: 256 seconds]
Dimik has quit [Ping timeout: 264 seconds]
za1b1tsu has joined #ruby
mupt has joined #ruby
tvw has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 256 seconds]
chkhanch has joined #ruby
amar_ has quit [Ping timeout: 240 seconds]
wilbert has joined #ruby
kryptoz has quit [Remote host closed the connection]
kryptoz has joined #ruby
_lyte_ has joined #ruby
kurko_ has joined #ruby
zapata has joined #ruby
beefjoe has quit [Remote host closed the connection]
drale2k_ has joined #ruby
dhollin3 is now known as dhollinger
kryptoz has quit [Ping timeout: 268 seconds]
<chkhanch> Hello everyone, I am looking for a Russian-speaking mentor :) I will be grateful for the feedback :)
za1b1tsu has quit [Quit: WeeChat 2.1]
_lyte_ has quit [Remote host closed the connection]
kryptoz has joined #ruby
addyluxe has quit [Quit: Leaving]
amar_ has joined #ruby
spiette has joined #ruby
hinbody has joined #ruby
hinbody has left #ruby [#ruby]
akaiiro has joined #ruby
amar_ has quit [Ping timeout: 256 seconds]
Es0teric has joined #ruby
tdy has quit [Ping timeout: 265 seconds]
fredlinhares has joined #ruby
Hexafox[I] has quit [Ping timeout: 240 seconds]
jottr has joined #ruby
spiette has quit [Quit: ZNC 1.7.0 - https://znc.in]
Es0teric has quit [Quit: Computer has gone to sleep.]
BloopMonster has joined #ruby
riton has quit [Ping timeout: 264 seconds]
jottr has quit [Quit: WeeChat 2.1]
spiette has joined #ruby
riton has joined #ruby
AndroidKitKat has joined #ruby
rawste has joined #ruby
za1b1tsu has joined #ruby
mupt has quit [Ping timeout: 256 seconds]
<AndroidKitKat> Hi, I'm pretty new to Ruby and programming in general. I'm just curious if Ruby is a good first OOP language. I know python and a smidge of C, but people keep telling me to try Ruby.
<AndroidKitKat> Basically, if I've never done OOP before, will there be issues with picking up Ruby
RougeR has quit [Read error: Connection reset by peer]
RougeR has joined #ruby
RougeR has quit [Changing host]
RougeR has joined #ruby
dionysus69 has quit [Ping timeout: 264 seconds]
moei has quit [Read error: Connection reset by peer]
wilbert has quit [Read error: Connection reset by peer]
moei has joined #ruby
wilbert has joined #ruby
solocshaw has joined #ruby
tdy has joined #ruby
lele has quit [Ping timeout: 256 seconds]
<chkhanch> <AndroidKitKat> it depends entirely on you :)
lucas_ has quit [Ping timeout: 260 seconds]
lucas_ has joined #ruby
<AndroidKitKat> I've mainly done python, which isn't OOP more or less, but at the same time my python code is poorly written C just in python
scrptktty has joined #ruby
fredlinhares has quit [Ping timeout: 255 seconds]
<chkhanch> very sad story :)
fredlinhares has joined #ruby
Zaab1t has joined #ruby
_whitelogger has joined #ruby
bairyn is now known as ByronJohnson
<AndroidKitKat> Well, I hope I can learn it properly :3
<chkhanch> do not worry, everything will be ok
<chkhanch> just do it )
fredlinhares has quit [Ping timeout: 256 seconds]
chouhoulis has joined #ruby
nfsnobody has joined #ruby
<konsolebox> AndroidKitKat: i highly recommend you install and use `pry`
<AndroidKitKat> is it like a GDB for ruby?
<AndroidKitKat> also, dont know if this matters, but a lot of my development will be done on Windows
mupt has joined #ruby
<konsolebox> AndroidKitKat: it's like a shell so you can try execute simple Ruby syntax
<AndroidKitKat> ah
<AndroidKitKat> So kinda like the python interpreter?
<AndroidKitKat> will install it
fredlinhares has joined #ruby
m1st3rwr0ng has joined #ruby
caleBOT has quit [Remote host closed the connection]
caleBOT has joined #ruby
fernando_basso_ has joined #ruby
karapetyan has joined #ruby
<konsolebox> AndroidKitKat: like pyshell maybe
BTRE has quit [Read error: Connection reset by peer]
amar_ has joined #ruby
BTRE has joined #ruby
<AndroidKitKat> thanks, that makes testing snippets of where im trying to learn easier than just making a file and doing `ruby $file.rb` everytime
<konsolebox> AndroidKitKat: are you using and installer from here? https://rubyinstaller.org/downloads/. i suggest you install one with devkit, and if you're using a 64-bit windows, install the 64bit one. e.g. https://github.com/oneclick/rubyinstaller2/releases/download/rubyinstaller-2.5.1-2/rubyinstaller-devkit-2.5.1-2-x64.exe
<AndroidKitKat> I did use the devkit one, and the 64bit windows one
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amar_ has quit [Remote host closed the connection]
ikbenhet has quit [Quit: Textual IRC Client: www.textualapp.com]
amar_ has joined #ruby
amar_ has quit [Remote host closed the connection]
<konsolebox> nice
<konsolebox> you would have less problems installing gems
ellcs has quit [Remote host closed the connection]
caleBOT has quit [Ping timeout: 264 seconds]
drale2k_ has joined #ruby
mattb20 has joined #ruby
<konsolebox> AndroidKitKat: i suggest this as a reference for Ruby's modules and classes: https://ruby-doc.org/core-2.5.1/
karapetyan has quit [Ping timeout: 265 seconds]
<mattb20> Please could somebody help me regarding rspec, using doubles and stubs https://gist.github.com/mattb20/c50851f5b3abe7ef0ada62af7d800136, this code and spec is giving me TypeError: no implicit conversion of Array into Integer on line 5, wtf!?
sphenxes has joined #ruby
fredlinhares has quit [Ping timeout: 265 seconds]
drale2k_ has quit [Client Quit]
fredlinhares has joined #ruby
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<konsolebox> mattb20: i haven't coded in rspec yet. i only used minitest. can you make it more complete so i can run it here as well? i'm not sure how to set it up, like what 'require' line to add for rspec stuff.
<konsolebox> mattb20: basically the idea to find the problem is to verify what type of objects those variables contain. e.g. you place `puts "bank.class: #{bank.class}"; puts "bank.transaction_history: #{bank.transaction_history}"; bank.transaction_history.each do |transaction| puts "transaction: #{transaction}"; puts transaction.join( ' || '); end
wilbert has quit [Ping timeout: 276 seconds]
<mattb20> thanks @konsolebox here https://gist.github.com/mattb20/6eb5e9a388e356dc6be7a45f9e09ed5d is the complete code, spec file on top, class file below it
kapil___ has quit [Quit: Connection closed for inactivity]
naftilos76 has quit [Ping timeout: 240 seconds]
shinnya has quit [Ping timeout: 260 seconds]
clemens3 has quit [Ping timeout: 240 seconds]
mattb20 has quit [Ping timeout: 252 seconds]
tty has quit [Ping timeout: 256 seconds]
lidenbrock has joined #ruby
alem0lars has quit [Ping timeout: 240 seconds]
mupt has quit [Quit: Lost terminal]
Zaab1t has quit [Quit: Zaab1t]
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
apeiros has quit [Ping timeout: 240 seconds]
anisha has quit [Quit: Leaving]
anisha has joined #ruby
Beams has quit [Quit: .]
tolerablyjake has joined #ruby
alem0lars has joined #ruby
fernando_basso_ has quit [Ping timeout: 252 seconds]
mattb20 has joined #ruby
pauliesaint has quit [Quit: pauliesaint]
SeepingN has joined #ruby
Cthulu201 has quit [Ping timeout: 240 seconds]
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
anisha has quit [Ping timeout: 255 seconds]
amar_ has joined #ruby
HashNuke has left #ruby [#ruby]
tdy has quit [Ping timeout: 260 seconds]
pauliesaint has joined #ruby
chouhoulis has quit [Remote host closed the connection]
<konsolebox> mattb20: you seem to have gone offline. i can't test it: `require': cannot load such file -- printer (LoadError)
chouhoulis has joined #ruby
apeiros has joined #ruby
<mattb20> ive tried debugging it with puts statement and the object I want is going there
<mattb20> and i've tested the method in IRB
guille-moe has quit [Ping timeout: 255 seconds]
<mattb20> it's like it's getting lost somewhere
drale2k_ has joined #ruby
<mattb20> sorry maybe my gist wasn't clear
<konsolebox> mattb20: like this? https://bpaste.net/show/bfd3b364c16c
<mattb20> that's the two separate files, I'm trying it without mocks and stubs now so you'd have to mock bank
amar_ has quit [Remote host closed the connection]
bsamorim has quit [Ping timeout: 240 seconds]
RougeR has quit [Ping timeout: 240 seconds]
<mattb20> it's something to do with the method because everyone is correct until the each do loop
<mattb20> but what I don't understand is I've tested it in IRB and it works how i'd like it too
<konsolebox> if you think it should completely work, maybe the problem is in the describe stuff
herbmillerjr has quit [Quit: Konversation terminated!]
<konsolebox> and i'd also debug that part if i were you
Alayde has joined #ruby
apeiros has quit [Remote host closed the connection]
dionysus69 has joined #ruby
anisha has joined #ruby
Alayde has quit [Client Quit]
jcarl43 has joined #ruby
<mattb20> thank you you were right
apeiros has joined #ruby
<mattb20> I hadn't defined the stub properly
lytol has joined #ruby
[Butch] has joined #ruby
darkhanb has joined #ruby
andikr has quit [Remote host closed the connection]
caleBOT has joined #ruby
<AndroidKitKat> Hey, so I'm trying out the Try Ruby online quickstart, and I have a few questions
<AndroidKitKat> in the "Are you Harsh" section from the link here: https://ruby.github.io/TryRuby/
<AndroidKitKat> It has me do this https://www.irccloud.com/pastebin/Pa3rCHHE/
<ruby[bot]> AndroidKitKat: we in #ruby do not like irccloud.com, it has no syntax highlighting, distracting formatting and loads slowly for most. Please use https://gist.github.com
mynameisdebian has joined #ruby
<AndroidKitKat> noted
fmcgeough has joined #ruby
<AndroidKitKat> So, if I understand correctly, Line 1, just obviously makes me a new has
<elomatreb> Line 1 is where pretty much all the magic happens in this specific example
<AndroidKitKat> line 3 and 4 is what is confusing
TomyWork has quit [Ping timeout: 240 seconds]
<AndroidKitKat> i understand that for each of the values in books do something
<AndroidKitKat> i think?
<elomatreb> Right, the block (the part between { and }) is run once for each value from books
<AndroidKitKat> but what is that thing I'm doing, and why am I incrementing by one?
<AndroidKitKat> the output looks like: {"splendid"=>1, "abyssmal"=>1, "mediocre"=>2}
<mattb20> you'll need to look up the hash for that answer
<elomatreb> That depends on the setting of your example. You're effectively counting how often each value in books occurs
<AndroidKitKat> ah
<mattb20> ratings[rate] this is a key for the ratings hash that will access a specific value
<elomatreb> (Where rate is the current value from books for which the block is run)
sysvalve has quit [Quit: Leaving]
<AndroidKitKat> so, for each type of rating, put it into the ratings hash and then add one to that total?
kryptoz has quit [Remote host closed the connection]
<konsolebox> "add one to the current value"
<elomatreb> You don't need to put it into the Hash as you defined a default value in line one
kryptoz has joined #ruby
<konsolebox> >> h = {}; h[:rate] = 0; h[:rate] += 1; h[:rate]
kryptoz has quit [Remote host closed the connection]
<ruby[bot]> konsolebox: # => 1 (https://eval.in/1032304)
<elomatreb> The default value gets used when you try to access a key that doesn't exist, and since += assigns it will create the key
<AndroidKitKat> so line one creates a new hash, ratings, where every new value is set to 0?
apeiros has quit [Remote host closed the connection]
<AndroidKitKat> This feels different than python, but a good different
<elomatreb> Yep. More correctly, it runs the block (the curly braces) each time you access an undefined key and uses its return value, you can do anything in it
<elomatreb> For an exhaustive overview of what Hash.new can do: https://ruby-doc.org/core-2.5.1/Hash.html#method-c-new
<AndroidKitKat> so it isnt iterating through the list, its finding all the values with a given name and doing that thing?
<elomatreb> It is iterating through the list, that's the .each part of line 3
mikecmpbll has quit [Quit: inabit. zz.]
<AndroidKitKat> but its only iterating for each unique value
Es0teric has joined #ruby
<AndroidKitKat> hashes are kinda weird for me at least to wrap my head arond
wilbert has joined #ruby
<konsolebox> AndroidKitKat: he's referring to books.values
<elomatreb> You are iterating over books.values, which is a plain Array
<elomatreb> Try inserting `p books.values` to see the data you're dealing with
<konsolebox> AndroidKitKat: the hash has unique keys, so "finding all the values with a given name" doesn't apply there
anisha has quit [Quit: This computer has gone to sleep]
yohji has quit [Remote host closed the connection]
<AndroidKitKat> Maybe I'm just a little confused as to what keys are, they are what is returned when you do `books.values`?
MagePsycho_ has joined #ruby
sauvin_ has joined #ruby
tdy has joined #ruby
<elomatreb> I assume books is given by the example? It's probably a hash, which means it's a collection of key-value pairs where the keys are unique
<elomatreb> Calling .values on it goes through it and gives you all the values (without the keys) in a big list
<elomatreb> You said you know Python? Hashes are the Ruby equivalent of dictionaries
<AndroidKitKat> I'm still pretty green in python
tty has joined #ruby
sauvin_ has quit [Read error: Connection reset by peer]
za1b1tsu has quit [Ping timeout: 256 seconds]
<AndroidKitKat> So the keys are like unique things like people, or in this case books, and the values are like, in this case, something that can be applied to every key
<AndroidKitKat> so if you had different people, but wanted to put their hair colors in, you could do like john=>brown, amanda=> black, mike=>blonde, greg=> black
fmcgeough has quit [Quit: fmcgeough]
<AndroidKitKat> where the people are keys, and the values are the hair colors
MagePsycho_ has quit [Ping timeout: 240 seconds]
<elomatreb> Pretty much, yeah
<AndroidKitKat> that makes more sense
mattb20 has quit [Ping timeout: 252 seconds]
<elomatreb> You can use any type of object as keys and values, e.g. strings and symbols are commonly used
<AndroidKitKat> Another question, you can ofc apply multiple values to a key
wilbert has quit [Quit: wilbert]
<AndroidKitKat> can you label those values like age, color, build etc?
<elomatreb> Just assigning different values to a single key overwrites, so to actually store multiple values you'd need to use an array as the value
caleBOT has quit [Remote host closed the connection]
caleBOT_ has joined #ruby
<AndroidKitKat> ah
<elomatreb> You can also nest Hashes, but at a certain point it makes more sense to construct a proper class for your objects
<konsolebox> or a Struct
* AndroidKitKat has a lot to learn
Guest20471 has quit [Read error: Connection reset by peer]
mynameisdebian has quit [Remote host closed the connection]
Nicmavr has joined #ruby
Nicmavr is now known as Guest64032
apeiros has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
_aeris_ has quit [Ping timeout: 250 seconds]
al2o3-cr has quit [Quit: WeeChat 2.1]
claudiuinberlin has joined #ruby
_aeris_ has joined #ruby
MagePsycho_ has joined #ruby
jhill__ is now known as jhill
amar_ has joined #ruby
za1b1tsu has joined #ruby
fredlinhares has quit [Quit: WeeChat 1.4]
Mike11 has quit [Ping timeout: 260 seconds]
motstgo has joined #ruby
bsamorim has joined #ruby
kurko_ has joined #ruby
amar_ has quit [Ping timeout: 255 seconds]
al2o3-cr has joined #ruby
rshetty has quit [Remote host closed the connection]
<AndroidKitKat> For those here, do you omit the parens in most cases?
<AndroidKitKat> I feel wrong when I omit them
bsamorim has quit [Ping timeout: 240 seconds]
armyriad has quit [Quit: Leaving]
bradleyprice has joined #ruby
<konsolebox> AndroidKitKat: personally no if it feels like i'm executing a command, but no otherwise, especially when it's returning values.
<konsolebox> AndroidKitKat: (i was talking about methods)
<AndroidKitKat> ah
<konsolebox> AndroidKitKat: sorry, i mean personally yes ...
<konsolebox> got confused with the negation there
<AndroidKitKat> I was a bit curious
<AndroidKitKat> but that makes sense
<AndroidKitKat> I'm just not used to leaving them off
<AndroidKitKat> but im glad I can include them
jasmith has quit [Remote host closed the connection]
suukim has quit [Quit: Konversation terminated!]
bsamorim has joined #ruby
rshetty has joined #ruby
armyriad has joined #ruby
rshetty has quit [Ping timeout: 240 seconds]
graphene has quit [Remote host closed the connection]
za1b1tsu has quit [Ping timeout: 260 seconds]
graphene has joined #ruby
nowhereman_ has quit [Ping timeout: 276 seconds]
pauliesaint has quit [Read error: Connection reset by peer]
pauliesaint has joined #ruby
vindvaki has joined #ruby
Es0teric has joined #ruby
mynameisdebian has joined #ruby
r29v has joined #ruby
sphenxes has quit [Quit: Leaving]
sameerynho has joined #ruby
fmcgeough has joined #ruby
pauliesaint has quit [Quit: pauliesaint]
pauliesaint has joined #ruby
rshetty has joined #ruby
m1st3rwr0ng has quit [Quit: Textual IRC Client: www.textualapp.com]
eckhardt_ has joined #ruby
rshetty has quit [Ping timeout: 248 seconds]
naftilos76 has joined #ruby
<cthulchu> folks, is there something in minitest that...
<cthulchu> that has a way to making it possible to pause a test and resuming it via a hotkey in browser
<cthulchu> in the testing browser
<cthulchu> I don't think so
<cthulchu> I mean, I believe I could make it to do so with a bit of hacking around
<cthulchu> but no native solutions
fmcgeough has quit [Quit: fmcgeough]
nowhereman_ has joined #ruby
kobain has joined #ruby
starseed0000 has joined #ruby
roamingdog has quit [Remote host closed the connection]
Es0teric has quit [Quit: Computer has gone to sleep.]
roamingdog has joined #ruby
nowhere_man has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
samosaphile has joined #ruby
fmcgeough has joined #ruby
meinside has quit [Quit: Connection closed for inactivity]
leitz has joined #ruby
mtkd has quit []
zachk has joined #ruby
zachk has quit [Changing host]
zachk has joined #ruby
FernandoBasso has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
\void has joined #ruby
mtkd has joined #ruby
agent_white has joined #ruby
SuperLag has joined #ruby
<konsolebox> cthulchu: i don't think that's easy. you can hack the source code of minitest maybe
tag has joined #ruby
<MagePsycho_> Can anyone explain me this code: on roles(:app), in: :sequence, wait: 1 do
TinkerT has quit [Read error: Connection reset by peer]
<Eiam> reads like some dsl to me
<Eiam> also sounds like #RubyonRails
BTRE has quit [Ping timeout: 240 seconds]
TinkerT has joined #ruby
cschneid_ has quit [Ping timeout: 260 seconds]
<Eiam> MagePsycho_: as a guess, it enumerates whatever Roles (a model) exist in :app and then waits 1 (second?) and executes the do block
cschneid has joined #ruby
<Eiam> probably passing the role models in order to the block to do whatever with it
kobain has quit [Ping timeout: 256 seconds]
<Eiam> someone smarter than me could confirm but it might make more sense to read it as.. on(roles(:app), {in => :sequence}, {wait => 1})
<Eiam> I don't personally use first class support for keyword arguments
clemens3 has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
bak1an has quit [Read error: Connection reset by peer]
BTRE has joined #ruby
<jrich523> is im giving a "no confirm" param, is there a common name for that? i would use --confirm if the default was to not confirm, but in this case the default is to confirm
bak1an has joined #ruby
<jrich523> sorry, from a CLI standpoint
jamesaxl has joined #ruby
amar_ has joined #ruby
drale2k_ has joined #ruby
za1b1tsu has joined #ruby
amar_ has quit [Ping timeout: 256 seconds]
drale2k_ has quit [Ping timeout: 256 seconds]
cozachk has joined #ruby
amar_ has joined #ruby
za1b1tsu has quit [Client Quit]
BloopMonster has quit [Ping timeout: 264 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amar_ has quit [Remote host closed the connection]
zachk has quit [Ping timeout: 245 seconds]
pauliesaint has quit [Quit: pauliesaint]
pauliesaint has joined #ruby
guille-moe has joined #ruby
quobo has joined #ruby
mtkd has quit []
<cthulchu> I can have a listener on the site that listens to a hotkey and creates a variable when it occurs. I can sit in minitest and run lots of checks for that variable in browser
<cthulchu> when the variable is there, I can execute byebug from minitest
amar_ has joined #ruby
<cthulchu> that will effectively pause the execution of the test
<cthulchu> allowing me to look in the browser's console and inspect things I'm interested in
<cthulchu> and then I'll be able to continue the test from the console
shinnya has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
vindvaki has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vindvaki has joined #ruby
samosaphile has quit [Quit: Page closed]
<bsamorim> Is Ruby 2.5.1 stable?
<miah> yes
<NL3limin4t0r> bsamorim: https://www.ruby-lang.org/en/downloads/ "Here you can get the latest Ruby distributions in your favorite flavor. The current stable version is 2.5.1."
<bsamorim> miah, NL3limin4t0r: thanks!
vindvaki has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has joined #ruby
amar_ has quit [Remote host closed the connection]
<bsamorim> is it common to implicitly use dependencies in Ruby code? I mean, if I require 'baz' and 'bar' in 'foo' (in that oreder) and I use 'baz' in 'bar', should I do "require 'baz'" in 'bar'?
ramfjord has joined #ruby
<ineb> bsamorim: it makes your intention clearer if you do so
guille-moe has quit [Ping timeout: 268 seconds]
<bsamorim> ineb: and requiring the same code twice is a gotcha-free situation?
<bsamorim> or should I be aware of something?
duderono_ has joined #ruby
duderonomy has quit [Ping timeout: 276 seconds]
bradleyp_ has joined #ruby
bradleyp_ has quit [Remote host closed the connection]
<NL3limin4t0r> AndroidKitKat: I'm a bit late to the party, but you can see hashes basicly as arrays with named indexes. In other languages you encounter them under the name "HashMap" or "Dict" (Dictionary).
<ineb> bsamorim: require avoids double loading, gotcha would be if you require the same file with different paths
<bsamorim> ineb: ok, thanks!
<ineb> bsamorim: like require './foo' and require '../lib/foo'
<AndroidKitKat> Thanks NL3limin4t0r
<NL3limin4t0r> Although they are a pair you can request an array of only the keys, or only the values. Which you are doing on line 3. By calling `books.values`
<bsamorim> got it, thanks!
bradleyprice has quit [Ping timeout: 256 seconds]
<NL3limin4t0r> Than you loop through the array by calling `.each`
<NL3limin4t0r> AndroidKitKat: I don't know how new you are to programming but the `ratings[rate] += 1` is a shortcut for `ratings[rate] = ratings[rate] + 1`.
Cthulu201 has joined #ruby
motstgo_ has joined #ruby
<AndroidKitKat> I know that little trick, I guess I’m just used to writing C code in other languages, if that makes sense
<AndroidKitKat> When I write python it’s not very pythonic
<ineb> bsamorim: i have to take that back. i tested it and it doesnt get loaded twice. so different paths seem ok aswell
<AndroidKitKat> Which I’m trying to change with ruby
jasmith has joined #ruby
<NL3limin4t0r> If you have questions about certain classes or methods you find almost everyting explained at http://ruby-doc.org/core-2.5.1/
Es0teric has joined #ruby
<bsamorim> ineb: Yeah, that seemed rather arbitrary...thanks for the update!
motstgo has quit [Ping timeout: 268 seconds]
<NL3limin4t0r> AndroidKitKat: If you don't know where to look you can just ask ruby. For example:
amar has joined #ruby
claudiuinberlin has joined #ruby
<NL3limin4t0r> >> books = {}; books.method(:values)
<ruby[bot]> NL3limin4t0r: # => #<Method: Hash#values> (https://eval.in/1032350)
<NL3limin4t0r> >> books = {}; books.values.method(:each)
<ruby[bot]> NL3limin4t0r: # => #<Method: Array#each> (https://eval.in/1032351)
<zenspider> I'm not sure how that's useful to a newb. Much more useful is realizing you have documentation locally
<zenspider> eg: `ri Hash`; `ri Hash.values`
<zenspider> (or even `ri values`)
<NL3limin4t0r> zenspider: But you first have to understand what value you call something on, otherwise you don't know where to look.
<zenspider> and teaching them #method helps with that? no.
Es0teric has quit [Client Quit]
<zenspider> >> books = {}; books.class # MIGHT be more useful
<ruby[bot]> zenspider: # => Hash (https://eval.in/1032354)
<NL3limin4t0r> zenspider: It outputs the class and method name.
r29v has quit [Quit: r29v]
<zenspider> so? Like you said, "you first have to understand what value [you have]" yet you want them to know the name of a method. That seems like a stretch to me.
<zenspider> knowing how to use irb, knowing ri, and knowing some basic methods like #class will let someone explore and poke around and learn on their own
<zenspider> >> books = {}; books.methods.first 5
<ruby[bot]> zenspider: # => [:<, :>, :<=, :>=, :==] (https://eval.in/1032359)
<zenspider> >> books = {}; books.methods.sample 5
<ruby[bot]> zenspider: # => [:respond_to?, :rassoc, :public_method, :is_a?, :default_proc=] (https://eval.in/1032360)
<zenspider> >> books = {}; books.class.public_instance_methods(false).sample 5
<ruby[bot]> zenspider: # => [:size, :inspect, :each_key, :reject!, :has_key?] (https://eval.in/1032361)
dionysus69 has quit [Ping timeout: 240 seconds]
<zenspider> I have that aliased to #pim in my .irbrc
bradleyprice has joined #ruby
Mike11 has joined #ruby
pauliesaint has quit [Remote host closed the connection]
cthulchu has quit [Read error: Connection reset by peer]
mynameisdebian has joined #ruby
pauliesaint has joined #ruby
capitalsav has joined #ruby
<capitalsav> Hello everybody!
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
pauliesaint has left #ruby [#ruby]
<capitalsav> Please help me. I need to run cron task, which will execute my .rb file. I have tried to execute in terminal /home/capitalsav/.rvm/wrappers/ruby-2.4.0@test_cron/ruby /home/capitalsav/RubymineProjects/test_cron/test.rb - and it didnt work. But if I run this command in the directory of file, which I need to run: /home/capitalsav/.rvm/wrappers/ruby-2.4.0@test_cron/ruby test.rb - it works OK. But I need the first command execute successf
<capitalsav> Here is my crontab:
<capitalsav> 30 21 * * 4 /home/capitalsav/.rvm/wrappers/ruby-2.4.0@test_cron/ruby /home/capitalsav/RubymineProjects/test_cron/test.rb > /home/capitalsav/CRONOUTPUT.log 2> /home/capitalsav/CRONERROR.log
ldnunes has quit [Quit: Leaving]
FernandoBasso has quit [Quit: Page closed]
<SeepingN> set MAILTO="your@email.com" appropriately before that cron entry so it emails you any output
<SeepingN> most likely you have environment variables that need to be in place, and aren't when cron runs
<SeepingN> a quick n dirty is to source one or more of your dot files first. 30 21 * * 4 source /home/username/.bashrc; /original/stuff/goes here
caleBOT_ has quit [Remote host closed the connection]
<zenspider> it'll email the user on that machine by default if you don't...
NL3limin4t0r is now known as NL3limin4t0r_afk
<zenspider> capitalsav: when I'm having crontab issues, it's usually pathing that screws things up. But you have full paths to stuff
MagePsycho_ has quit [Quit: MagePsycho_]
<zenspider> what I usually do is start a new BARE shell that doesn't have all my stuff confusing things. I use this:
<zenspider> alias newshell='env -i HOME=$HOME $SHELL --norc'
<SeepingN> paths and environment. but until you can see what's failing, it's hard to fix!
<SeepingN> good idea
<zenspider> then just try running your command straight up
<zenspider> I would recommend getting off of rvm for this very reason tho. It's just the messiest thing ever
MagePsycho_ has joined #ruby
MagePsycho_ has quit [Client Quit]
<SeepingN> well you should be able to run "ruby" which should point to the latest. or some sort of magic.
<baweaver> zenspider: You see that RubyMine just got chruby support?
<baweaver> Should help with some of the fun shenanigans.
<baweaver> (at least for the crowd that uses it)
<AndroidKitKat> Is it normal for a .rb to end with a blank line?
<AndroidKitKat> my linter says there should be one
<zenspider> I have emacs set up to ALWAYS have a newline at the end... but not a blank line, no
<baweaver> Mostly a git thing iirc
<SeepingN> seems best not to end a line with only EOF
<AndroidKitKat> That makes sense
<baweaver> Bingo, that has some history lessons on it too
r29v has joined #ruby
<zenspider> AndroidKitKat: sounds like your linter focuses on minutia
<zenspider> (as they do in the ruby world... kinda sad)
<AndroidKitKat> ah
<zenspider> and by "end in a newline but not a blank line", I mean the file should end in "\n", but not "\n\n"
<AndroidKitKat> ah
<AndroidKitKat> I just know that hitting return at the end of my line code made my linter happy
<SeepingN> also makes "wc -l" happy
<SeepingN> it counts carriage returns, so if the last one isn't there, you'll think your file is 1 line shorter than it kinda-is (if it had that \n)
<zenspider> AndroidKitKat: you should be focusing on more important things. Your "linter" is noise.
naftilos76 has quit [Quit: Leaving]
<AndroidKitKat> I should focus on writing good code lol
<AndroidKitKat> so far my ruby is very sad
<zenspider> your lint tool will probably not help with that. but we can.
<AndroidKitKat> :>
rikkipitt has joined #ruby
<Eiam> yeah our advice is worth what it costs!
<AndroidKitKat> I tried installing pry, which was recommended earlier
<Eiam> I've Definitely Never Broken Production With My Code
<AndroidKitKat> But I don't know i'm using it properly
stephenmac7 has joined #ruby
<Eiam> AndroidKitKat: I find the value of tools is easier to understand when you have a problem the tool solves, rather than just looking at tools in isolation
<zenspider> if you're a beginner, I recommend using irb and just focus on the code
bjpenn has quit [Ping timeout: 240 seconds]
<zenspider> bells and whistles just serve to confuse and distract until you're ready for them
<AndroidKitKat> Ah
<AndroidKitKat> Thats very true
<Eiam> so, write some ruby, get into some problems that some specialized tools can help you sort out.
<stephenmac7> Hey, I'm trying to add commas to numbers. I was wondering if s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/, '\&,') or s.gsub(/(\d)(?=(\d\d\d)+(?!\d))/) { |x| "#{x}," } is more efficient
<AndroidKitKat> :> will do
<Eiam> stephenmac7: whats the input
<stephenmac7> Eiam: An integer, but s = n.to_i
<Eiam> so like you have 1000 and you want 1,000 ?
<stephenmac7> Yes
<Eiam> what about if its european or otherwise?
<stephenmac7> It's not.
<stephenmac7> In this case, I just need the fastest way to do it in american style
<Eiam> as well as some performance comparisons between the solutions
iceden has joined #ruby
caleBOT has joined #ruby
<Eiam> (note the link contains non rails solutions as well)
<zenspider> stephenmac7: to_s.reverse.gsub(...).reverse
rikkipitt has quit [Quit: Leaving...]
<zenspider> or that
<stephenmac7> The reverse and then un-reverse is better than the complicated regex above?
<zenspider> stephenmac7: but... you should also learn how to answer this question yourself. Using the benchmark class (stdlib) or better the benchmark-ips gem
jcalla has quit [Quit: Leaving]
<Eiam> I personally prefer to not write regex but, preference
<zenspider> a stupid simple benchmark answers this question objectively
rawste has quit [Quit: Sleep....]
<stephenmac7> zenspider: I'll try it
BloopMonster has joined #ruby
<zenspider> benchmark-ips takes a lot of work out of experiment design
vindvaki has joined #ruby
vindvaki has quit [Client Quit]
fmcgeough has quit [Quit: fmcgeough]
alem0lars has quit [Ping timeout: 256 seconds]
<stephenmac7> zenspider: Did it with the builtin benchmarking library
<stephenmac7> Apparently { |x| s = x.to_s; s.reverse!.gsub!(/...(?=.)/) { |x| "#{x}," }; s.reverse! } is the speediest
<Eiam> make sure you comment that line for the next poor fool
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
<Eiam> (yourself in 4 months)
<stephenmac7> Eiam: That was just for the benchmark
<stephenmac7> And so I could get it in one line for IRC.
canurabus has joined #ruby
<zenspider> stephenmac7: don't use bang methods when you don't have to
<zenspider> s.reverse.gsub.reverse
kvda has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.1]
reber__ has quit [Remote host closed the connection]
<canurabus> Hi all. I'm completely new to ruby (but not programming). Having a bit of trouble with some syntax. I see the following line in a class definition: "validates :title, :presence => true, :length => { :minimum => 5 }"
<zenspider> canurabus: *nod* what's the problem for you?
<canurabus> Is the correct interpretation: call a class method "validates" with the arguments (:title, {:presence => true}, {:length => {:minimum => 5}})
<zenspider> canurabus: not quite. One hash (w/ an inner hash)
edwardly has quit [Ping timeout: 245 seconds]
<zenspider> :presence and :length are in the same hash
<zenspider> >> "abc".gsub!(/x/, "")
<ruby[bot]> zenspider: # => nil (https://eval.in/1032431)
<zenspider> stephenmac7: ^^^
mikecmpbll has joined #ruby
<zenspider> and you don't need the fastest. You need "fast enough" + "clearest"
<zenspider> this will not be your bottleneck
<canurabus> zenspider, thanks! how can you tell that the comma is not separating arguments to the validates function?
<canurabus> (vs multiple kv pairs in the same hash I guess)
ur5us has joined #ruby
<zenspider> canurabus: because ruby only allows for one implicit hash arg. adjacent k=>v pairs are one hash
cthulchu has joined #ruby
jcarl43 has joined #ruby
kobain has joined #ruby
biberu has quit []
hfp_work has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<stephenmac7> zenspider: Checked and the bangs make it slightly faster. The fact that gsub! returns nil is really annoying. Unfortunately, one of the largest eaters of memory in my application seems to be this method. It's being called extremely often.
<stephenmac7> I'm honestly a fan of immutability, but in this case, it's a problem.
DTZUZO has quit [Ping timeout: 264 seconds]
ramfjord has quit [Ping timeout: 256 seconds]
<stephenmac7> zenspider: Are there any other reasons not to use the bang methods other than the usual mutability is a problem considerations?
<Eiam> "Last parameter is always a hash"
<stephenmac7> I am creating a new string by using #to_s in this case
capitalsav has quit [Quit: Page closed]
tag has quit [Quit: Connection closed for inactivity]
bjpenn has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
jasmith has quit [Quit: Leaving]
leitz has quit [Quit: Nappy time]
RougeR has joined #ruby
RougeR has joined #ruby
RougeR has quit [Changing host]
Dbugger has quit [Quit: Leaving]
clemens3 has quit [Ping timeout: 240 seconds]
noobineer has joined #ruby
hfp_work has quit [Quit: bye]
lupine is now known as m00seknuckle
m00seknuckle is now known as lupine
clemens3 has joined #ruby
GodFather has quit [Remote host closed the connection]
bsamorim has quit [Ping timeout: 240 seconds]
jamesaxl has quit [Quit: WeeChat 2.1]
kurko_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
hfp_work has joined #ruby
amar_ has joined #ruby
mtkd has quit []
bradleyprice has quit [Ping timeout: 248 seconds]
lidenbrock has quit [Quit: Page closed]
amar has quit [Ping timeout: 265 seconds]
ramfjord has joined #ruby
chouhoulis has quit [Ping timeout: 264 seconds]
ramfjord has quit [Ping timeout: 240 seconds]
sameerynho has quit [Ping timeout: 256 seconds]
schleppel has quit [Quit: Konversation terminated!]
amar has joined #ruby
graphene has quit [Remote host closed the connection]
Mike11 has quit [Quit: Leaving.]
graphene has joined #ruby
amar_ has quit [Ping timeout: 248 seconds]
clemens3 has quit [Ping timeout: 256 seconds]
amar has quit [Remote host closed the connection]
mynameisdebian has quit [Remote host closed the connection]
zlogan2003 has quit [Ping timeout: 240 seconds]
nicht has joined #ruby
mynameisdebian has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
kilgore has joined #ruby
canurabus has quit [Quit: Leaving]
kilgore has quit [Remote host closed the connection]
cagomez has joined #ruby
stephenmac7 has quit [Ping timeout: 252 seconds]
jasmith has joined #ruby
bradleyprice has joined #ruby
lytol has quit [Remote host closed the connection]
ramfjord has joined #ruby
bjpenn has quit [Quit: Lost terminal]
ramfjord has quit [Ping timeout: 248 seconds]
caleBOT has quit [Remote host closed the connection]
bradleyprice has quit [Remote host closed the connection]
bradleyprice has joined #ruby
raynold has joined #ruby
apeiros has quit [Ping timeout: 260 seconds]
nicht_ has joined #ruby
nicht has quit [Ping timeout: 256 seconds]
nicht has joined #ruby
caleBOT_ has joined #ruby
nicht_ has quit [Ping timeout: 256 seconds]
cagmz has joined #ruby
DTZUZO has joined #ruby
Hexafox[I] has joined #ruby
cagomez has quit [Ping timeout: 265 seconds]
DTZUZO has quit [Ping timeout: 256 seconds]
SeepingN has quit [Disconnected by services]
SeepingN_ has joined #ruby
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
graphene has quit [Read error: Connection reset by peer]
graphene has joined #ruby
apeiros has joined #ruby
<zenspider> I missed that message... but my explanation is above.
edwardly has quit [Ping timeout: 260 seconds]
bradleyprice has quit [Remote host closed the connection]
quobo has quit [Quit: Connection closed for inactivity]
caleBOT_ has quit [Remote host closed the connection]
edwardly has joined #ruby
edwardly has joined #ruby
edwardly has quit [Changing host]
bradleyprice has joined #ruby
punnie has joined #ruby
bradleyprice has quit [Remote host closed the connection]
bak1an has joined #ruby
ramfjord has joined #ruby