<manveru>
did you try passing the IO to nokogiri directly?
fphilipe has joined #ruby
eb0t_ is now known as eb0t
<sh7d>
nope, i need file_content anyway to determine if is changed after processing
<sh7d>
yes, i know, i can calculate checksum but im lazy :P
jottr has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
zacts has joined #ruby
englishm has quit [Ping timeout: 250 seconds]
DTZUZO has joined #ruby
englishm has joined #ruby
def_jam is now known as eblip
jottr has joined #ruby
Swyper has quit [Remote host closed the connection]
jottr has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
laaron- has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
laaron has quit [Ping timeout: 256 seconds]
apparition has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jottr has joined #ruby
Ltem has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
jottr has joined #ruby
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
jottr has quit [Ping timeout: 255 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
TomyLobo2 has joined #ruby
al2o3-cr has joined #ruby
TomyLobo has quit [Ping timeout: 248 seconds]
jottr has joined #ruby
wbollui has joined #ruby
<wbollui>
join #ruby
jottr has quit [Ping timeout: 258 seconds]
<wbollui>
I'm trying to figure out a better way to handle a method taking an argument that could be an Integer or an Array<Integer>
<wbollui>
At the moment I have a stupid implementation that just copies the method body and then switches based on the object type passed in using #is_a?
<manveru>
wbollui: something like `rooms = [*room]`, and then always iterate over `rooms`
<wbollui>
What would be a more rubyish way to do this kind of dispatch that intelligently handles multiple types of object parameters?
<wbollui>
at the beginning of the method body coerce an Int into an Array?
<manveru>
yeah
<wbollui>
thank you, great idea
<manveru>
personally, i'd just pass `rooms` always, it's not really clear from the method signature that it can take multiple
<wbollui>
that would be a better way to name it, I agree.
<wbollui>
Never realized you could splat an array and it returns itself
jottr has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
al2o3-cr has quit [Quit: If the universe is a machine where the future is uniquely determined by its present state, it would not be possible to calculate what the future will be.]
kyrylo has joined #ruby
MuffinPimp has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
orbyt_ has joined #ruby
jottr has joined #ruby
cthulchu_ has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
cthulchu_ has quit [Ping timeout: 244 seconds]
jottr has joined #ruby
xdrxs has quit [Quit: This computer has gone to sleep]
jottr has quit [Ping timeout: 248 seconds]
beeshk has joined #ruby
zacts has joined #ruby
jottr has joined #ruby
xdrxs has joined #ruby
jottr has quit [Ping timeout: 245 seconds]
nevada1 has joined #ruby
reber has quit [Remote host closed the connection]
reber__ has quit [Remote host closed the connection]
ellcs has joined #ruby
<nevada1>
Can you mimic for(int i = 2; i * i < n; i++) in Ruby's for loop?
jaequery has joined #ruby
jottr has joined #ruby
jottr has quit [Ping timeout: 258 seconds]
jottr has joined #ruby
u0_a238 has quit [Ping timeout: 245 seconds]
jottr has quit [Ping timeout: 245 seconds]
u0_a238 has joined #ruby
jottr has joined #ruby
xdrxs has quit [Quit: This computer has gone to sleep]
hightower2 has quit [Ping timeout: 245 seconds]
ur5us has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
Ai9zO5AP has quit [Quit: WeeChat 2.4]
nevada1 has quit [Quit: Leaving]
jottr has joined #ruby
jottr has quit [Ping timeout: 246 seconds]
jottr has joined #ruby
code_zombie has joined #ruby
Swyper has quit [Remote host closed the connection]
Ltem has quit [Quit: bye]
jottr has quit [Ping timeout: 252 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
cthulchu has joined #ruby
jottr has joined #ruby
beeshk has quit [Quit: beeshk]
jottr has quit [Ping timeout: 252 seconds]
Onwarion has quit [Quit: Leaving]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has joined #ruby
beeshk has joined #ruby
jottr has quit [Ping timeout: 252 seconds]
zacts has quit [Quit: WeeChat 2.4]
fphilipe_ has joined #ruby
jottr has joined #ruby
orbyt_ has joined #ruby
fphilipe_ has quit [Ping timeout: 252 seconds]
jottr has quit [Ping timeout: 250 seconds]
dinfuehr has quit [Ping timeout: 248 seconds]
dinfuehr has joined #ruby
jottr has joined #ruby
dsmythe has quit [Ping timeout: 250 seconds]
clemens3 has quit [Ping timeout: 255 seconds]
dsmythe has joined #ruby
clemens3 has joined #ruby
Mike11 has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
jottr has joined #ruby
jottr has quit [Ping timeout: 258 seconds]
dinfuehr has quit [Ping timeout: 246 seconds]
dinfuehr has joined #ruby
dar123 has joined #ruby
beeshk has quit [Quit: beeshk]
jottr has joined #ruby
beeshk has joined #ruby
chaus has joined #ruby
jottr has quit [Ping timeout: 248 seconds]
ellcs has quit [Ping timeout: 248 seconds]
riceandbeans has joined #ruby
jottr has joined #ruby
<riceandbeans>
What's the correct way to do this, I'm spacing, foo = ['one','two','three'] foo.each do | bar | baz = `biff -f #{bar}` end
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jottr has quit [Ping timeout: 245 seconds]
<riceandbeans>
ugh, "#{bar}"
<riceandbeans>
Couldn't focus with kids screaming in my ears
jottr has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
<baweaver>
riceandbeans: What're you trying to do?
nowhere_man has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
<baweaver>
because you probably want map.
<baweaver>
but placeholder names make that hard to know.
<riceandbeans>
baweaver: Sorry, I'm just....going nuts from kids right now, but I'll try to explain
<riceandbeans>
I have a series of hosts, I need to iterate through them to find a subset that meet a certain condition that is determined by output of a shell command
<baweaver>
map then select
<riceandbeans>
From those hosts I then need to do a mapping of one column to another column across the various hosts
<baweaver>
If you can get an example written that'd help
<riceandbeans>
Well the part here was that I needed to get info per host and so I was iterating on hosts and shoving them into the shell command
jottr has quit [Ping timeout: 252 seconds]
Mike11 has quit [Quit: Leaving.]
jottr has joined #ruby
beeshk has quit [Quit: beeshk]
jottr has quit [Ping timeout: 268 seconds]
jottr has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
batcat84 has joined #ruby
<batcat84>
Hello, all! I'm fairly new to CLI/Terminal and I'm getting an error from Ruby Version Manager.
<batcat84>
The error reads: Warning! PATH is not properly set up, /Users/stoney/.rvm/gems/ruby-2.6.1/bin is not at first place.
<batcat84>
I'm on macOS Mojave.
jottr has quit [Ping timeout: 255 seconds]
spacesuitdiver has joined #ruby
beeshk has joined #ruby
<al2o3-cr>
batcat84: add `export PATH="$GEM_HOME/bin:$PATH"` the last line of your `$HOME/.bashrc` if using bash
jottr has joined #ruby
<batcat84>
al2o3-cr: Thank you. How would I do that?
<al2o3-cr>
open $HOME/.bashrc in a text editor and add the line: export PATH="$GEM_HOME/bin:$PATH"
<al2o3-cr>
batcat84: you are using bash right?
<al2o3-cr>
batcat84: from the terminal type: printenv SHELL
<batcat84>
bin/bash
nowhere_man has quit [Ping timeout: 246 seconds]
jottr has quit [Ping timeout: 246 seconds]
<al2o3-cr>
batcat84: type this: echo 'export PATH="$GEM_HOME/bin:$PATH"' >> $HOME/.bashrc
<batcat84>
Ok, done.
<al2o3-cr>
batcat84: should be good to go now.
orbyt_ has joined #ruby
<al2o3-cr>
batcat84: make sure to restart shell session