idiocrash has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
idiocrash has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
<sam113101>
is it possible to create an array that returns nil when negative indexes are used?
grokify has quit [Remote host closed the connection]
Rounin has quit [Ping timeout: 265 seconds]
<aestheti1>
likely yes,
grokify has joined #ruby
<aestheti1>
yeah I just did it sam113101
<aestheti1>
just reopen Array class Array
<aestheti1>
and then override [] def [](index)
<aestheti1>
and then index.negative? ? nil : super(index)
<aestheti1>
and then thats it really
<aestheti1>
ymmv
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
nirvdrum has joined #ruby
nirvdrum has quit [Read error: Connection reset by peer]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
<sam113101>
now what about this
<sam113101>
I want my_array[index, 999] to return nils if it reaches the end
moldorcoder7 has quit [Ping timeout: 268 seconds]
grokify has quit [Remote host closed the connection]
<havenwood>
sam113101: You should be cautious monkeypatching core classes like Array. You'll have cascading breakage. Consider a refinement, where the change is local to your file and limited. Here's an example that prevents negatives for #[] and #fetch. https://gist.github.com/havenwood/bee780f8db0a221cf5aace64a0178e6d
grokify has joined #ruby
reset has quit [Quit: reset]
grokify has quit [Remote host closed the connection]
bastelfreak has quit [Ping timeout: 600 seconds]
grokify has joined #ruby
grokify has quit [Ping timeout: 264 seconds]
TiglatePileser has joined #ruby
ur5us has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
ur5us has quit [Ping timeout: 252 seconds]
TiglatePileser has quit [Quit: Leaving]
nirvdrum has joined #ruby
nirvdrum has quit [Quit: nirvdrum]
Sankalp has quit [Ping timeout: 268 seconds]
grokify has joined #ruby
grokify has quit [Ping timeout: 264 seconds]
mikecmpbll has joined #ruby
mikecmpbll has quit [Ping timeout: 252 seconds]
eddof13 has joined #ruby
eddof13 has quit [Client Quit]
eddof13 has joined #ruby
polishdub has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Sankalp has joined #ruby
agent_white has quit [Remote host closed the connection]
nyuszika7h|znc has quit [Quit: ZNC 1.8.2+deb2+b1 - https://znc.in]
nyuszika7h has quit [Client Quit]
nyuszika7h has joined #ruby
jpn has joined #ruby
grokify has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
eddof13 has joined #ruby
c10l8 has joined #ruby
c10l has quit [Read error: Connection reset by peer]
c10l8 is now known as c10l
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
c10l has quit [Quit: See ya! o/]
c10l has joined #ruby
grokify has quit [Remote host closed the connection]
yxhuvud has quit [Read error: Connection reset by peer]
eddof13 has joined #ruby
yxhuvud has joined #ruby
grokify has joined #ruby
eddof13 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
grokify has quit [Remote host closed the connection]
<leftylink>
hmm, I want to write something weird but valid. obviously the weird part is easy enough to achieve, but validity is harder. syntactically valid sure, but it errors at runtime
grokify has quit [Remote host closed the connection]
CrazyEddy has joined #ruby
grokify has joined #ruby
grokify has quit [Ping timeout: 252 seconds]
grokify has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
nabblet has joined #ruby
___nick___ has quit [Ping timeout: 265 seconds]
_ht has quit [Remote host closed the connection]
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
jpn has joined #ruby
grokify has quit [Ping timeout: 260 seconds]
jpn has quit [Ping timeout: 268 seconds]
swaggboi has quit [Quit: C-x C-c]
Vonter has quit [Ping timeout: 252 seconds]
jpn has joined #ruby
otisolsen70 has quit [Quit: Leaving]
swaggboi has joined #ruby
jpn has quit [Ping timeout: 260 seconds]
ur5us has joined #ruby
grokify has joined #ruby
jpn has joined #ruby
jpn has quit [Ping timeout: 268 seconds]
mikecmpbll has joined #ruby
mikecmpbll has quit [Ping timeout: 252 seconds]
jpn has joined #ruby
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
Vonter has joined #ruby
jpn has quit [Ping timeout: 252 seconds]
<nabblet>
"bundle install --deployment --local" -> "Could not find nokogiri-1.13.8-x86_64-linux in cached gems or installed locally" I don't know Ruby but am familiar with the concept of packages (from python). What step/command would you recommend?
<Guimauve>
nabblet - the --local option will force using only locally vendored gems
<Guimauve>
nabblet - which you don't have for nokogiri 1.13.8
ur5us has quit [Ping timeout: 248 seconds]
<Guimauve>
nabblet - just take out that option and it'll download the gem from rubygems.org to build
<Guimauve>
nabblet - or, switch to --prefer-local instead of --local which will use a vendored gem if found, and download if not
<nabblet>
Guimauve: thank you for your help & input. using --prefer-local or omitting --local -> same result
<nabblet>
I get a warning about --deplyoment being deprecated
<Guimauve>
i don't know a damn thing about the --deployment option unfortunately. looks like the docs say it shoves things into ./vendor
<nabblet>
I have a Gemfile.lock that seems to pin nokogiri to 1.13.8
<nabblet>
Please feel free to ask my any questions about that setup. It's some ruby code/set that I just need to get running - I may miss very obvious things, because I am not familiar
jpn has joined #ruby
<Guimauve>
nabblet - try taking out that option as well. it looks like it changed to be a setting, and the setting just enforces a gemfile.lock and no changes to the gemfile... this is stuff i don't think you care about.
<Guimauve>
nabblet - what are you trying to get running btw?
<Guimauve>
i'm eating peanut butter with a fork, so don't take anything i say too seriously
<nabblet>
Guimauve: some custom XML transformer
<nabblet>
Guimauve: enjoy! :)
<Guimauve>
XML is like violence. every problem can be solved by using more. =[
nullheroes has joined #ruby
<nabblet>
I tried to add gem 'nokogiri', '~> 1.13', '>= 1.13.8' to the Gemfile but I get a warning about not modifying the Gemfile when being in deployment mode
<Guimauve>
yeah, it won't let you. you can try turning off deployment mode: bundle config unset --local deployment
<nabblet>
did that. Now "bundle install --local" seems to be pulling gems
<nabblet>
-> that's an improvement
<Guimauve>
nabblet - also, just to make sure, if there's a binary in there you want to run, you should run it with bundle exec and not directly if you want that binary to have access to the bundled gems
<nabblet>
Guimauve: thanks for the heads up. I am seeing "bundle exec" in that README.txt I am following
<Guimauve>
ok cool
<nabblet>
progress! But now I am stuck at some cmake issue (via rake gem?)... well I think I will leave it at that for now
jpn has quit [Ping timeout: 268 seconds]
<Guimauve>
cmake? 0.o
<nabblet>
Guimauve: Thank you very much for your time, attention & support! I helped me to move forward
<Guimauve>
good luck
<nabblet>
Guimauve: heh, yea I could use some of that ;)
grokify has quit [Remote host closed the connection]
grokify has joined #ruby
RougeR has joined #ruby
grokify has quit [Remote host closed the connection]