<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
<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?
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)
<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
<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
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
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
<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
<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
<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]
<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:
<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>
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
<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
<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
<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>
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]