Chew has quit [Quit: Connection closed for inactivity]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 265 seconds]
fphilipe has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
sergioro has quit [Quit: leaving]
sergioro has joined #ruby
houhoulis has quit [Remote host closed the connection]
schne1der has joined #ruby
gnufr33d0m has quit [Quit: gnufr33d0m]
infinityfye has joined #ruby
pandakekok9 has joined #ruby
TomyWork has joined #ruby
pandakekok9 has quit [Quit: leaving]
pandakekok9 has joined #ruby
markopasha has joined #ruby
markopasha has quit [Remote host closed the connection]
duderonomy has quit [Ping timeout: 268 seconds]
markopasha has joined #ruby
duderonomy has joined #ruby
NODE has quit [Quit: changing servers]
fphilipe has quit [Ping timeout: 246 seconds]
ldepandis has joined #ruby
NODE has joined #ruby
iNs_ has joined #ruby
iNs has quit [Remote host closed the connection]
conta has joined #ruby
drincruz has joined #ruby
nibbo has quit [Ping timeout: 240 seconds]
drincruz has quit [Ping timeout: 268 seconds]
kristian_on_linu has joined #ruby
cc_ has joined #ruby
flughafen has quit [Quit: WeeChat 2.1]
markopasha has quit [Ping timeout: 268 seconds]
dinfuehr has quit [Ping timeout: 240 seconds]
dinfuehr has joined #ruby
NODE has quit [Excess Flood]
TomyWork has quit [Ping timeout: 256 seconds]
NODE has joined #ruby
mossplix has quit [Remote host closed the connection]
c0san0stra has quit [Ping timeout: 260 seconds]
vondruch has joined #ruby
ellcs has joined #ruby
c0san0stra has joined #ruby
conta has quit [Quit: conta]
nibbo has joined #ruby
fphilipe has joined #ruby
phaul__ has joined #ruby
TomyWork has joined #ruby
drincruz has joined #ruby
cthulchu_ has quit [Ping timeout: 265 seconds]
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
mossplix has quit [Read error: Connection reset by peer]
mossplix has joined #ruby
drincruz has quit [Ping timeout: 265 seconds]
bruce_lee has joined #ruby
bruce_lee has quit [Changing host]
bruce_lee has joined #ruby
mossplix has quit [Ping timeout: 260 seconds]
sphex has quit [Remote host closed the connection]
tpanarch1st has joined #ruby
sphex has joined #ruby
hramrach has quit [Ping timeout: 240 seconds]
hramrach has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
NL3limin4t0r has joined #ruby
Neha has joined #ruby
<Neha>
Hi
<Neha>
[1, 2, 2, 3, 4, 4, 5].select do |e| e if (e == 2) .. (e == 4) end # => [2, 2, 3, 4] It stops when e==4 .That's why second 4 is not printed in the output.((1..5).to_a * 2).select do |e| e if (e == 2) .. (e == 4) end # => [2, 3, 4, 2, 3, 4] Why this doesn't stop on 4?Why 2,3,4 are given in the output after 4?
<Neha>
[1, 2, 2, 3, 4, 4, 5].select do |e| e if (e == 2) .. (e == 4) end # => [2, 2, 3, 4] It stops when e==4 . That's why the second 4 is not printed in the output.((1..5).to_a * 2).select do |e| e if (e == 2) .. (e == 4) end # => [2, 3, 4, 2, 3, 4] Why this doesn't stop on 4?Why 2,3,4 are given in the output after 4?
Mayur37 has joined #ruby
<Mayur37>
Wah Neha wah, Jordar question
Mayur_02 has joined #ruby
Mayur37 has quit [Remote host closed the connection]
suukim has quit [Ping timeout: 272 seconds]
<Mayur_02>
suukim bhai ni Jai!
<Neha>
rubydoc can any one knows why it's happen in filpflop opratter ----> . [1, 2, 2, 3, 4, 4, 5].select do |e| e if (e == 2) .. (e == 4) end # => [2, 2, 3, 4] It stops when e==4 .-------->That's why second 4 is not printed in the output.------------->((1..5).to_a * 2).select do |e| e if (e == 2) .. (e == 4) end # => [2, 3, 4, 2, 3, 4] Why this doesn't
<Neha>
stop on 4?Why 2,3,4 are given in the output after 4?
<Mayur77>
[1, 2, 2, 3, 4, 4, 5].select do |e| e if (e == 2) .. (e == 4) end # => [2, 2, 3, 4] It stops when e==4 .That's why second 4 is not printed in the output.((1..5).to_a * 2).select do |e| e if (e == 2) .. (e == 4) end # => [2, 3, 4, 2, 3, 4] Why this doesn't stop on 4?Why 2,3,4 are given in the output after 4?
<jhass>
why do you spam this?
lxsameer has joined #ruby
<Mayur77>
I am also interested to know about this
<Mayur_02>
Keep it up Guys. . .!
Mayur77 has left #ruby [#ruby]
<jhass>
Neha: it does stop, note how the second output doesn't include 1
<jhass>
then it encounters 2 and is true again until it encounters 4 again
<Neha>
jhass soory can you explain litle bit more i can't understand this
Mayur_02 has quit [Remote host closed the connection]
<jhass>
Neha: do you understand why p [1, 2, 3, 1, 2, 3].select {|e| e if (e == 2) .. (e == 3) } gives [2, 3, 2, 3]?
suukim has joined #ruby
_whitelogger has joined #ruby
hongkongphooey has joined #ruby
chalkmonster has joined #ruby
hongkongphooey has quit [Client Quit]
hongkongphooey has joined #ruby
hongkongphooey has quit [Client Quit]
BH23 has joined #ruby
<Neha>
@jhass yes but in case of your array in why 3 again not print
<Jookia>
Is it possible to set the default string encoding in ruby to ASCII-8BIT? would this stop any encoding to unicode?
mossplix has joined #ruby
mossplix has quit [Remote host closed the connection]
<jhass>
Jookia: sounds like the wrong way around :D (you realize unicode is a strict superset of ascii, right?) Anyways, several ways, calling ruby with -E or calling Encoding.default_external= early on are the first two that come to my mind
<jhass>
I think it also should respect LOCALE or some of the LC_ env vars
drincruz has joined #ruby
<jhass>
but yeah, seems like an XY question tbh :P
<Jookia>
jhass: ASCII-8BIT isn't technically ASCII is it? I thought it allowed any bytes. I want to use bytestrings for things like I/O and OS APIs
<Jookia>
And not have LOCALE and encodings interfere with that
NL3limin4t0r has quit [Ping timeout: 260 seconds]
<jhass>
mh, still something I'd set per IO then, see encoding argument to the various open functions, or IO#binwrite, IO#binread
drincruz has quit [Ping timeout: 265 seconds]
NL3limin4t0r has joined #ruby
<Jookia>
Does that work for OS APIs too? Like filesystems
<NL3limin4t0r>
Neha: Have you already read the flip-flop documentation?
<NL3limin4t0r>
It turns "on" (evaluating to true) when the first expression evaluates to true and turns "off" (evaluating to false) when the second expression eveluates to true.
<NL3limin4t0r>
Neha: In your example when the first 4 is evaluested the flip-flop turns off, evaluating everything after it to false.
<Jookia>
jhass: My main concern is trying to program Unix APIs that use bytestrings and have input/output automatically marshalled to a set encoding
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
mossplix has joined #ruby
strmpnk has quit []
_Joes_ has quit [Quit: Leaving]
BH23 has joined #ruby
mossplix has quit [Ping timeout: 260 seconds]
donofrio has joined #ruby
Helenah has quit [Ping timeout: 268 seconds]
pandakekok9 has quit [Quit: brb, using lxterminal]
mossplix has joined #ruby
pandakekok9 has joined #ruby
pandorian has joined #ruby
VoidVextor0 has quit [Ping timeout: 265 seconds]
chalkmonster has joined #ruby
phaul__ has quit [Ping timeout: 260 seconds]
drincruz has joined #ruby
mossplix has quit [Remote host closed the connection]
mossplix has joined #ruby
gitter1234 has joined #ruby
pandakekok9 has quit [Quit: Good night Freenoders]
drincruz has quit [Ping timeout: 268 seconds]
AJA4350 has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
lucasb has joined #ruby
phaul__ has joined #ruby
gearnode has quit [Quit: WeeChat 2.5]
drincruz has joined #ruby
mossplix has quit [Remote host closed the connection]
ldepandis has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TCZ has quit [Quit: Bye Bye]
m_antis has joined #ruby
m_antis has quit [Remote host closed the connection]
drincruz has joined #ruby
phaul__ has quit [Ping timeout: 268 seconds]
m_antis has joined #ruby
m_antis has quit [Remote host closed the connection]
wallace_mu has joined #ruby
phaul__ has joined #ruby
conta1 has joined #ruby
chalkmonster has joined #ruby
conta1 has quit [Remote host closed the connection]
sagax has quit [Remote host closed the connection]
ldepandis has joined #ruby
sagax has joined #ruby
mossplix has quit [Remote host closed the connection]
NODE has quit [Quit: changing servers]
TorpedoSkyline has joined #ruby
NODE has joined #ruby
mossplix has joined #ruby
Tuor has joined #ruby
<Tuor>
hi, I tryed to update the version of gem with this command `gem update --system` and now I get this error when using gem:
<Tuor>
/usr/lib/ruby/vendor_ruby/rubygems/defaults/operating_system.rb:10: warning: constant Gem::ConfigMap is deprecated
<Tuor>
How can I fix that?
mossplix has quit [Remote host closed the connection]
infinityfye has quit [Ping timeout: 265 seconds]
mossplix has joined #ruby
Helenah has joined #ruby
alex`` has quit [Ping timeout: 268 seconds]
mossplix has quit [Remote host closed the connection]
fercell has quit [Quit: WeeChat 2.7]
alex`` has joined #ruby
TorpedoSkyline has quit [Read error: Connection reset by peer]
TorpedoSkyline has joined #ruby
TorpedoSkyline has quit [Client Quit]
lxsameer has quit [Ping timeout: 265 seconds]
VoidVextor0 has quit [Ping timeout: 240 seconds]
TorpedoSkyline has joined #ruby
ttoocs has quit [Ping timeout: 240 seconds]
Jonopoly has joined #ruby
impermanence has joined #ruby
<adam12>
Tuor: What is the output of `ruby -v` and `gem -v`?
mossplix has joined #ruby
<Tuor>
Just rebooting (to see if all works still). Maybe I managed to purge all what belongs to ruby, delete all remaining files and install again. Maybe. I'll see in a sec
dinfuehr has quit [Ping timeout: 268 seconds]
fphilipe_ has joined #ruby
fphilipe has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
<Tuor>
Warning is gone system still works.
dinfuehr has joined #ruby
<Tuor>
I tryed to get some gems working and tried a lot of things. It seems to many things.
<Tuor>
Maybe I should use something like rvm, so I don't mess up my system ruby installation...
<adam12>
Tuor: That's generally best for flexibility.
<Tuor>
I used rvm befor (1 year ago) on a different system.
<Tuor>
I didn't like that I had to change my terminals to start bash with --login and some wired stuff in .bashrc I didn't really understand. I think about rbenv or asdf but I don't really know what is best for me^^
<Tuor>
If I'm honest, I don't like to curl url | bash... I prefer using apt/snap/flatpack what ever.
fercell has joined #ruby
cc_ has quit [Read error: Connection reset by peer]
cc_ has joined #ruby
oncall-pokemon has joined #ruby
<adam12>
Tuor: If you're on Ubuntu you could look at the apt repo from Brightbox.
<Tuor>
Ubuntu 18.04
<Tuor>
I'll decide tomorow. :)
<Tuor>
I'll sleep over it.
<Tuor>
thx!
cthulchu_ has joined #ruby
cc_ has quit [Read error: Connection reset by peer]
fphilipe_ has quit [Read error: Connection reset by peer]
markopasha has joined #ruby
<adam12>
Tuor: Doesn't help you wanting to install from apt repo but on FreeBSD, I just compile from source and manipulate path using direnv. So all my rubies are in ~/.rubies and in a project, I add `PATH_add ~/.rubies/ruby-2.6/bin` to a .envrc file. No tools other than direnv which I already use.
davidw has joined #ruby
gix has joined #ruby
TorpedoSkyline has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Tuor>
Intresting. 😀
cd has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
dinfuehr has joined #ruby
TorpedoSkyline has joined #ruby
Helenah has quit [Ping timeout: 272 seconds]
markopasha has quit [Remote host closed the connection]
orbyt_ has joined #ruby
markopasha has joined #ruby
dinfuehr has quit [Ping timeout: 265 seconds]
bvdw has quit [Read error: Connection reset by peer]
<TorpedoSkyline>
So it seems like static methods don't play nice in method_missing
<adam12>
TorpedoSkyline: You want self.class.valid_method_names likely.
<TorpedoSkyline>
ah you're right adam12
<TorpedoSkyline>
thanks yall. I'm still trying to figure out this meta-programming world.
<adam12>
TorpedoSkyline: your "static method" is defined on the eigenclass or the singleton class. You have to go through self.class to get to it (you can't use class directly since it's a keyword).