havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.2, 2.5.5, 2.4.6: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
mangold has joined #ruby
duderonomy has joined #ruby
terens has quit [Ping timeout: 245 seconds]
duderonomy has quit [Client Quit]
crankharder has joined #ruby
orbyt_ has joined #ruby
bambanx has quit [Read error: Connection reset by peer]
bambanx has joined #ruby
crankharder has quit [Ping timeout: 255 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
wald0 has quit [Quit: Lost terminal]
zachk has quit [Quit: Leaving]
violentE has quit [Quit: Leaving]
mniip has quit [Ping timeout: 600 seconds]
mangold has joined #ruby
starseed0000 has quit [Ping timeout: 255 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 246 seconds]
AJA4351 is now known as AJA4350
AJA4350 has quit [Remote host closed the connection]
starseed0000 has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
catbusters has quit [Quit: Connection closed for inactivity]
crankharder has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
Dirak has quit [Ping timeout: 245 seconds]
doodlebug has joined #ruby
doodleb45 has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
jmcgnh has quit [Ping timeout: 250 seconds]
doodlebug has quit [Ping timeout: 240 seconds]
jmcgnh_ has joined #ruby
jmcgnh_ is now known as jmcgnh
renich has joined #ruby
Axy has quit [Ping timeout: 245 seconds]
Axy has joined #ruby
duderonomy has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
ur5us has quit [Ping timeout: 255 seconds]
ur5us has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
doodleb45 has quit [Read error: Connection reset by peer]
doodlebug has joined #ruby
duderonomy has joined #ruby
GodFather has quit [Remote host closed the connection]
GodFather has joined #ruby
duderonomy has quit [Client Quit]
KeyJoo has joined #ruby
duderonomy has joined #ruby
mistergibson has quit [Quit: Leaving]
duderonomy has quit [Client Quit]
hightower3 has quit [Ping timeout: 245 seconds]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
t0xik has joined #ruby
violentE has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
<violentE> I don't understand what I'm doing wrong, maybe I shouldn't be writing this in ruby https://bpaste.net/show/fd485244b5c7. The first bit there is a ruby script meant to ping a range of ips. which it does and I've included the output. But then if I run fping (similar to ping) it returns more hosts than the ruby script does. why? I took out wait incase that was a problem. idk just need a sanity check
pwnd_nsfw` has joined #ruby
<adam12> violentE: Maybe the 1 count is the issue.
<adam12> violentE: I'm not sure of your network or configuration, but a 1 count might mean a dropped packet could cause a failure. And some routers have been known to deprioritize ICMP so that could even compound it.
<adam12> violentE: That said, I'm sure this would likely be fine in Ruby, albeit it with some tweaks. Could use something like the parallel gem to run multiple pings in parallel. You could then remove the 1 count and keep a short wait in case a few of the hosts take too long to respond.
<violentE> just realized thats not latest code https://bpaste.net/show/41a24d7293c1
<violentE> increase count to 3 still the same
UncleCid__ has quit [Ping timeout: 250 seconds]
<adam12> violentE: It's always the same host? .7?
<violentE> yeah
<adam12> violentE: Out of curiosity, wha'ts the exit status if you run the ping manually? ping -q -c 3 10.10.10.7 ; echo $?
<violentE> 1
<violentE> that if $?.exitstatus.zero? was when I was trying to Process.wait pid but I decided against that route
<adam12> violentE: Presuming Linux?
<violentE> yeah
KeyJoo has quit [Quit: KeyJoo]
<adam12> violentE: Whats the exit code for one of the other ips?
<violentE> 0
renich_ has joined #ruby
renich has quit [Ping timeout: 245 seconds]
crankharder has joined #ruby
<adam12> violentE: I doubt this is Ruby related. My guess for this specifically is a differing of how the ICMP packet is generated by fping and ping.
pwnd_nsfw` has quit [Ping timeout: 244 seconds]
pwnd_nsfw has joined #ruby
<adam12> violentE: Maybe fping is wrong and ping is correct? can you verify?
<violentE> oh shit, you're right
bambanxx has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
<violentE> yup .7 is a thing
<violentE> did an nmap scan on .7 but I didn't have to include -Pn
<violentE> I'm so confused right now
<adam12> violentE: me too. what about just manually pinging .7 with no arguments. Timeouts?
<violentE> yeah it times out
bambanx has quit [Ping timeout: 246 seconds]
<adam12> violentE: Maybe ICMP is blocked on the machine and nmap/fping can use some sort of SYN or fragmented ICMP packet to determine response. Hard to say and likely way offtopic for this channel.
jenrzzz has joined #ruby
<violentE> but if it doesn't respond to icmp request, I wouldn't be able to get results on a basic nmap scan
<violentE> I'm only doing - nmap -sV 10.10.10.7 - nothing fancy
<adam12> violentE: Instead of shelling out to ping you might be able to try using the net-ping gem. It's been a while since I used it so can't comment on it, and last I remember ICMP through it was reasonably unsafe due to packet creation. YMMV
<adam12> violentE: But it might get you another datapoint to see if you can figure out whats wrong. But it sounds like ping is broken :)
<violentE> lol fuck
segy has quit [Quit: ZNC - http://znc.in]
jenrzzz has quit [Ping timeout: 246 seconds]
<violentE> I was kind of hoping to not use any gems, is there anything off the top of your head that wouldn't involve using a gem
<adam12> violentE: can you use fping?
braincrash has quit [Quit: bye bye]
<adam12> violentE: you could pair ruby + fping if you really wanted. What's your ultimate goal?
<violentE> yes but the purpose is to build a script in ruby. I feel like thats cheating, the bit of ruby then would be the system() bit
<violentE> + only +
segy has joined #ruby
<havenwood> violentE: +1 net-ping to see how it implements a solution in pure Ruby
tdy has joined #ruby
braincrash has joined #ruby
<violentE> mmmh okay I'll take a look
<adam12> violentE: I'd just shell out to fping instead, but use a single host. You could craft your own packet like havenwood is suggesting, if you feel so inclined.
<havenwood> best tool for the job!
<violentE> this is supposed to be a simple script, maybe I'm over thinking it
starseed0000 has quit [Ping timeout: 268 seconds]
<violentE> but I can't go with what I have, its missing data
mangold has quit [Quit: This computer has gone to sleep]
Fenhl has quit [Ping timeout: 264 seconds]
Fenhl has joined #ruby
fredolinhares has quit [Quit: WeeChat 1.9.1]
kent\n has quit [Ping timeout: 255 seconds]
jenrzzz has joined #ruby
mangold has joined #ruby
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
brool has quit [Ping timeout: 250 seconds]
tau has quit [Ping timeout: 258 seconds]
mr_rich101 has quit [Quit: ZNC - http://znc.in]
mr_rich101 has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
jenrzzz has joined #ruby
houhoulis has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 250 seconds]
jenrzzz has joined #ruby
starseed0000 has joined #ruby
crankharder has joined #ruby
ferr has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
dar123 has joined #ruby
Puffball_ has quit [Remote host closed the connection]
crankharder has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
esrse has joined #ruby
Swyper has quit [Remote host closed the connection]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sauvin has joined #ruby
tau has joined #ruby
reber has joined #ruby
reber__ has joined #ruby
reber__ has quit [Remote host closed the connection]
Inline has quit [Quit: Leaving]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
starseed0000 has quit [Ping timeout: 245 seconds]
eckhardt has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
t0xik has quit [Quit: Connection closed for inactivity]
v01d4lph4 has joined #ruby
DmitryBochkarev has joined #ruby
crankharder has joined #ruby
mniip has joined #ruby
DmitryBochkarev has quit [Remote host closed the connection]
crankharder has quit [Ping timeout: 255 seconds]
DmitryBochkarev has joined #ruby
DmitryBochkarev_ has joined #ruby
duderonomy has joined #ruby
jenrzzz has quit [Ping timeout: 250 seconds]
dionysus69 has joined #ruby
jenrzzz has joined #ruby
lele has quit [Ping timeout: 258 seconds]
DmitryBochkarev has quit [Ping timeout: 268 seconds]
tdy has quit [Ping timeout: 268 seconds]
hightower3 has joined #ruby
dar123 has joined #ruby
dionysus69 has quit [Quit: ZNC 1.7.2+deb1 - https://znc.in]
reber has quit [Remote host closed the connection]
hightower3 has quit [Changing host]
hightower3 has joined #ruby
dionysus69 has joined #ruby
terens has joined #ruby
eckhardt has quit [Quit: Textual IRC Client: www.textualapp.com]
dionysus69 has quit [Client Quit]
dionysus69 has joined #ruby
pwnd_nsfw` has joined #ruby
schleppel has joined #ruby
pwnd_nsfw has quit [Ping timeout: 250 seconds]
themsay has joined #ruby
lxsameer has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
lxsameer has quit [Ping timeout: 244 seconds]
ur5us has quit [Ping timeout: 246 seconds]
crankharder has joined #ruby
themsay has quit [Read error: Connection reset by peer]
sidx64 has joined #ruby
dionysus69 has quit [Quit: ZNC 1.7.2+deb1 - https://znc.in]
dionysus69 has joined #ruby
crankharder has quit [Ping timeout: 250 seconds]
SiliconDon has joined #ruby
briarcliff has joined #ruby
tau has quit [Remote host closed the connection]
nowhereman has joined #ruby
SiliconDon has quit [Quit: SiliconDon]
_joes_ has joined #ruby
ellcs1 has joined #ruby
andikr has joined #ruby
Tempesta_ has left #ruby ["Closing Channel, bye."]
Tempesta has joined #ruby
crankharder has joined #ruby
conta1 has joined #ruby
_joes_ has quit [Ping timeout: 245 seconds]
crankharder has quit [Ping timeout: 268 seconds]
nowhereman has quit [Ping timeout: 258 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
lele has joined #ruby
clemens3 has joined #ruby
briarcliff has quit [Remote host closed the connection]
lxsameer has joined #ruby
crankharder has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bambanxx has quit [Quit: Leaving]
crankharder has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
andikr has quit [Ping timeout: 255 seconds]
wildermind has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
aufi has joined #ruby
alem0lars has joined #ruby
alem0lars_ has joined #ruby
alem0lars_ has quit [Remote host closed the connection]
alem0lars has quit [Ping timeout: 246 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
claudiuinberlin has joined #ruby
segy has quit [Quit: ZNC - http://znc.in]
TomyWork has joined #ruby
aupadhye has joined #ruby
Ai9zO5AP has joined #ruby
code_zombie has quit [Quit: Leaving]
claudiuinberlin has quit [Ping timeout: 268 seconds]
segy has joined #ruby
TomyWork has quit [Remote host closed the connection]
briarcliff has joined #ruby
TomyWork has joined #ruby
prestorium has joined #ruby
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
andikr has joined #ruby
imadper is now known as zhejiujuku
crankharder has joined #ruby
ur5us has quit [Remote host closed the connection]
ur5us has joined #ruby
crankharder has quit [Ping timeout: 245 seconds]
_joes_ has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
BH23 has joined #ruby
tdy has joined #ruby
ur5us has joined #ruby
jenrzzz has joined #ruby
andikr has quit [Ping timeout: 244 seconds]
tau has joined #ruby
marz_d`ghostman has joined #ruby
kyrylo has joined #ruby
tdy has quit [Ping timeout: 245 seconds]
crankharder has joined #ruby
marz_d`ghostman has quit [Ping timeout: 256 seconds]
crankharder has quit [Ping timeout: 245 seconds]
dellavg_ has joined #ruby
_joes_ has quit [Ping timeout: 264 seconds]
BH23 has quit [Ping timeout: 245 seconds]
DmitryBochkarev_ has quit [Quit: Leaving]
_joes_ has joined #ruby
DmitryBochkarev has joined #ruby
BH23 has joined #ruby
felipe has joined #ruby
felipe is now known as Guest52407
jottr has joined #ruby
DmitryBochkarev has quit [Max SendQ exceeded]
DmitryBochkarev has joined #ruby
DmitryBochkarev has quit [Max SendQ exceeded]
andikr has joined #ruby
dhollin3 has joined #ruby
crankharder has joined #ruby
jottr has quit [Ping timeout: 255 seconds]
dhollinger has quit [Ping timeout: 246 seconds]
_joes_ has quit [Ping timeout: 257 seconds]
BH23 has quit [Ping timeout: 250 seconds]
tau has quit [Remote host closed the connection]
crankharder has quit [Ping timeout: 245 seconds]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
linduxed has joined #ruby
jottr has joined #ruby
briarcliff has left #ruby [#ruby]
briarcliff has joined #ruby
tdy has joined #ruby
ur5us has quit []
ellcs1 has quit [Ping timeout: 245 seconds]
briarcliff has quit [Ping timeout: 252 seconds]
dviola has joined #ruby
tdy has quit [Ping timeout: 250 seconds]
aufi has quit [Ping timeout: 246 seconds]
crankharder has joined #ruby
dar123 has joined #ruby
briarcliff has joined #ruby
phage has quit [Max SendQ exceeded]
phage has joined #ruby
phage has quit [Changing host]
phage has joined #ruby
crankharder has quit [Ping timeout: 246 seconds]
mangold has joined #ruby
Guest52407 has quit [Ping timeout: 244 seconds]
briarcliff has quit [Client Quit]
ellcs1 has joined #ruby
sidx64 has joined #ruby
phaul has quit [Quit: :wq]
phaul has joined #ruby
teclator has quit [Ping timeout: 246 seconds]
UncleCid__ has joined #ruby
pwnd_nsfw` has quit [Ping timeout: 245 seconds]
briarcliff has joined #ruby
teclator has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mangold has quit [Quit: This computer has gone to sleep]
crankharder has joined #ruby
briarcliff has quit [Quit: briarcliff]
sagax has quit [Ping timeout: 268 seconds]
crankharder has quit [Ping timeout: 250 seconds]
sidx64 has joined #ruby
cfjk has quit [Ping timeout: 244 seconds]
doodleb77 has joined #ruby
rubydoc has quit [Read error: Connection reset by peer]
phaul has quit [Read error: Connection reset by peer]
doodlebug has quit [Read error: Connection reset by peer]
doodleb77 has quit [Read error: Connection reset by peer]
doodleb49 has joined #ruby
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aqd has joined #ruby
ferr has quit [Ping timeout: 250 seconds]
DmitryBochkarev has joined #ruby
briarcliff has joined #ruby
ferr has joined #ruby
ferr has quit [Client Quit]
ferr has joined #ruby
nowhereman has joined #ruby
cfjk has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
nowhereman has quit [Ping timeout: 250 seconds]
nowhere_man has joined #ruby
mangold has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
briarcliff has quit [Quit: briarcliff]
briarcliff has joined #ruby
crankharder has joined #ruby
crankharder has quit [Ping timeout: 268 seconds]
sidx64 has joined #ruby
doodleb49 has quit [Read error: Connection reset by peer]
doodleb38 has joined #ruby
<terens> does calling benchmark.bm etc in production has any side effects?
teclator has quit [Remote host closed the connection]
doodleb38 has quit [Read error: Connection reset by peer]
doodlebug has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
teclator has joined #ruby
AJA4350 has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has joined #ruby
sidx64 has quit [Client Quit]
sidx64 has joined #ruby
v01d4lph4 has joined #ruby
kapil____ has joined #ruby
crankharder has joined #ruby
briarcliff has quit [Quit: briarcliff]
crankharder has quit [Ping timeout: 246 seconds]
hightower2 has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hightower3 has quit [Ping timeout: 246 seconds]
sidx64 has joined #ruby
sidx64 has quit [Read error: Connection reset by peer]
sidx64 has joined #ruby
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4350 has joined #ruby
DmitryBochkarev has quit [Remote host closed the connection]
nowhere_man has joined #ruby
DTZUZO has joined #ruby
DmitryBochkarev has joined #ruby
ldnunes has joined #ruby
crankharder has joined #ruby
DmitryBochkarev_ has joined #ruby
DmitryBochkarev has quit [Ping timeout: 250 seconds]
nowhereman has joined #ruby
nowhere_man has quit [Ping timeout: 245 seconds]
hightower2 has quit [Changing host]
hightower2 has joined #ruby
nowhereman has quit [Ping timeout: 245 seconds]
aqd has quit [Ping timeout: 246 seconds]
aqd has joined #ruby
aqd has quit [Max SendQ exceeded]
aqd has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sidx64 has joined #ruby
ldnunes has quit [Ping timeout: 257 seconds]
doodleb52 has joined #ruby
Liothen- has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
doodleb52 has quit [Read error: Connection reset by peer]
Liothen has quit [Ping timeout: 250 seconds]
phaul has joined #ruby
doodlebug has joined #ruby
Liothen- has quit [Client Quit]
InfinityFye has joined #ruby
Liothen has joined #ruby
Liothen has quit [Changing host]
Liothen has joined #ruby
rubydoc has joined #ruby
moei has joined #ruby
ldnunes has joined #ruby
doodleb71 has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
doodleb71 has quit [Read error: Connection reset by peer]
doodlebug has joined #ruby
vondruch has quit [Ping timeout: 245 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4351 is now known as AJA4350
phaul has quit [Ping timeout: 268 seconds]
conta1 has quit [Quit: conta1]
phaul has joined #ruby
esrse has quit [Ping timeout: 246 seconds]
dhollin3 is now known as dhollinger
jottr_ has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
jottr has joined #ruby
TobiFrano has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
TobiFrano has quit [Client Quit]
jottr_ has quit [Ping timeout: 264 seconds]
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
DTZUZO has quit [Ping timeout: 244 seconds]
Swyper has joined #ruby
sidx64 has joined #ruby
Swyper has quit [Remote host closed the connection]
Swyper has joined #ruby
hightower2 has quit [Ping timeout: 246 seconds]
violentE has quit [Remote host closed the connection]
violentE has joined #ruby
sidx64 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
segy has quit [Ping timeout: 245 seconds]
AJA4351 has joined #ruby
Inline has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
violentE has quit [Quit: Leaving]
ellcs1 has quit [Ping timeout: 245 seconds]
segy has joined #ruby
segy has quit [Excess Flood]
dar123 has joined #ruby
doodlebug has quit [Remote host closed the connection]
larissa has quit [Ping timeout: 252 seconds]
larissa has joined #ruby
doodlebug has joined #ruby
Rapture has joined #ruby
Swyper has quit [Remote host closed the connection]
dar123 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has joined #ruby
Dbugger has joined #ruby
gigetoo has quit [Ping timeout: 250 seconds]
v01d4lph4 has quit [Remote host closed the connection]
segy has joined #ruby
v01d4lph4 has joined #ruby
tau has joined #ruby
lucasb has joined #ruby
gigetoo has joined #ruby
v01d4lph4 has quit [Ping timeout: 244 seconds]
DmitryBochkarev_ has quit [Ping timeout: 255 seconds]
AJA4350 has quit [Ping timeout: 250 seconds]
gigetoo has quit [Ping timeout: 244 seconds]
eckhardt has joined #ruby
gigetoo has joined #ruby
rbasak has joined #ruby
dar123 has joined #ruby
conta1 has joined #ruby
crankharder has quit [Ping timeout: 244 seconds]
AJA4350 has joined #ruby
<rbasak> Hello! Where would be good to post about Ubuntu packages of gems please? I'm an Ubuntu developer and raised something on the Ubuntu developer list. I'd like to connect with the right part of the community on the Ruby side of things. https://lists.ubuntu.com/archives/ubuntu-devel/2019-April/040622.html for details.
n13z has quit [Quit: bleh]
<rbasak> For Rails I posted to rubyonrails-talk (awaiting moderation), but the topic also applies to Ruby generally.
cisco has joined #ruby
mangold has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
BrianWGray has joined #ruby
tdy has joined #ruby
DmitryBochkarev_ has joined #ruby
polishdub has joined #ruby
n13z has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
hightower2 has joined #ruby
mangold has joined #ruby
tau is now known as wolf-patacho
houhoulis has joined #ruby
ua has quit [Excess Flood]
aqd has quit [Ping timeout: 255 seconds]
rippa has joined #ruby
dviola has quit [Quit: WeeChat 2.4]
aupadhye has quit [Ping timeout: 246 seconds]
gigetoo has quit [Ping timeout: 245 seconds]
<towo> Noobish question here. If I have a class and inherit like `class foo < bar`, is bar's initialize() called?
orbyt_ has joined #ruby
<phaul> if you don't override it with foo'sinitialize. Otherwise you can call super
AJA4350 has quit [Ping timeout: 245 seconds]
<phaul> initialize is not a special method, works exactly like any other. The new method on the class first allocates an object then calls initialize on it, with normal method lookup
DTZUZO has joined #ruby
orbyt_ has quit [Client Quit]
<towo> phaul: (Beware, I may be wrong on terms here) So is the class foo an instanced bar? https://github.com/rubocop-hq/ruby-style-guide#single-line-classes seems to imply this. For context, I'm trying to extend https://github.com/puppetlabs/puppetlabs-ruby_task_helper/blob/master/files/task_helper.rb to have some common objects already instanced and don't need to do it for every inheriting class
<towo> i.e. class SomethingTask < TaskHelper begin (something) foo = bar.baz(quux) end; and in class SomeSubTask < SomethingTask I can use foo.
<towo> (Yes, I'm learning Ruby with the "welp, learn to swim already, you're in the ocean" approach...)
<phaul> oh. You are trying to define local var in the class definition? Local vars are local. They are lexically bound to the scope they are defined in
ua has joined #ruby
<phaul> Other class definitions won't see it, even methods in that class won't see it
<phaul> they slip though block definitions but that's all
gigetoo has joined #ruby
<towo> Ah.
<towo> I figured I was trying to be too fancy.
andikr has quit [Remote host closed the connection]
<towo> Any common practices on getting some objects (assigned to variables) to be there when making a new class? Or is that just not a thing?
Emmanuel_Chanel has quit [Read error: Connection reset by peer]
<phaul> it is a thing, but I am sure if I tell you how I will send you down the wrong path
<towo> :D
<phaul> it's almost certeanly not what you want, only useful in meta programming triicks
crankharder has joined #ruby
<towo> Fair enough. What should I look up instead? Don't need you to fully lay this out for me, just give me some hints for ze googles. :)
<phaul> do you want the value stored in the variable to be part of an instance of the class? do you want the value to belong to the class itself?
<towo> Hm; in the end, as far as I understand the constructs used, there'll only be my one object anyway; I don't need to reuse the values between instances as there is only one; main point is saving on code, as there will be multiple different sub-classes (which only ever get instantiated once)
<towo> At the front end, there's this tool just calling a ruby file and passing structured json on stdin, so no special magic sauce at any point needed, AFAIK
crankharder has quit [Ping timeout: 244 seconds]
<phaul> can you use a module instead of the class? and in the module you can get into the singleton class of it and just use instance variables. Let me demonstrate...
<towo> Well, I can do pretty much anything I want, really, since the front end AFAIK just does 'RUBYLIB=some:special:dirs echo $json | ruby $file.rb'
<towo> Maybe with more fancy stuff surrounding it, but that seems to be the gist of it
lxsameer has quit [Quit: out]
<towo> The task_helper I linked above is just some fancy aid to help with the meta issues
<phaul> &>> module X; class<< self ;attr_accessor :foo; def bar; self.foo * 3; end; end; end; X.foo = 10; p [X.foo, X.bar]
<rubydoc> # => [10, 30] (https://carc.in/#/r/6nhx)
<phaul> so here X has a value foo, you can only have 1 X, so it's already a singleton, and bar on X can access it
<phaul> ( you can also refer to foo as @foo inside the class<<self block
<phaul> )
reber has joined #ruby
<phaul> an other way would be with Singleton
<towo> Still parsing that mentally, stand by. :)
<phaul> I phrased this really confusingly: "here X has a value foo" .. read it as here X.foo is defined
<towo> Hmm, still trying to see how I'd implement that... I'd write a module and use the accessors in my common code to set up the object instances I need, so i.e. MyModule.foo = bar.baz(quux); and then I can use another function like MyModule.bar that can use the things defined for foo?
<bougyman> Ugh.
<bougyman> google is failing me on how to convert the string "1.345e8" to a number
<bougyman> I swore I used something called BigNumber for this before. But I can't find that, either.
<phaul> Integer "1.345e8"
<bougyman> I just tried that
<bougyman> [6] pry(main)> Integer '1.345e8'
<bougyman> ArgumentError: invalid value for Integer(): "1.345e8"
<havenwood> &>> require 'bigdecimal'; require 'bigdecimal/util'; "1.345e8".to_d
<towo> Float.new('1.345e8').to_i?
<rubydoc> # => 0.1345e9 (https://carc.in/#/r/6nhy)
<towo> apparently not
<bougyman> [7] pry(main)> 1.345e8
<bougyman> => 134500000.0
<bougyman> I don't need the decimal place.
<bougyman> and i'm not gonna eval the thing.
<bougyman> duh
<bougyman> [8] pry(main)> num = '1.345e8'
<bougyman> [9] pry(main)> num.to_f
<bougyman> => "1.345e8"
<bougyman> => 134500000.0
<havenwood> bougyman: How about: "1.345e8".to_d.to_i
<bougyman> [10] pry(main)> num.to_f.to_i.to_s
<bougyman> => "134500000"
<bougyman> got iy
<bougyman> *it
<phaul> &>> require 'singleton'; class X; include Singleton ; attr_accessor :foo; def bar; self.foo * 3; end; end; x= X.instance ; x.foo = 10; p [x.foo, x.bar] # towo
<rubydoc> # => [10, 30] (https://carc.in/#/r/6nhz)
<phaul> towo: if you would like to have a class rather than a module
gix has joined #ruby
<towo> phaul: that would make still using the TaskHelper easier. Thanks a bunch!
TomyWork has quit [Ping timeout: 246 seconds]
terens has quit [Ping timeout: 250 seconds]
crankharder has joined #ruby
clemens3 has quit [Ping timeout: 246 seconds]
<phaul> the difference is that in the former foo lives in the module, which cannot be instantiated, in the latter foo lives in the single instance of the class
<towo> Yeah, I think I *roughly* understand the pros/cons.
Emmanuel_Chanel has joined #ruby
zachk has joined #ruby
eckhardt has joined #ruby
zachk has quit [Changing host]
zachk has joined #ruby
eckhardt has quit [Client Quit]
terens has joined #ruby
hoffentl1chja has left #ruby [#ruby]
cschneid has joined #ruby
plantroon has joined #ruby
orbyt_ has joined #ruby
DmitryBochkarev_ has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
orbyt_ has quit [Ping timeout: 245 seconds]
plantroon has left #ruby ["WeeChat 2.3"]
DmitryBochkarev_ has joined #ruby
DmitryBochkarev_ has quit [Max SendQ exceeded]
cisco has quit [Ping timeout: 255 seconds]
ivanskie has joined #ruby
bambanx has joined #ruby
InfinityFye has quit [Quit: Leaving]
hightower2 has quit [Ping timeout: 246 seconds]
ferr has quit [Quit: WeeChat 2.4]
prestorium has quit [Ping timeout: 245 seconds]
kyrylo has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aqd has joined #ruby
lxsameer has joined #ruby
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
terens has quit [Ping timeout: 246 seconds]
Guest52407 has joined #ruby
starseed0000 has joined #ruby
cliluw has quit [Ping timeout: 245 seconds]
cliluw has joined #ruby
jottr has quit [Ping timeout: 250 seconds]
terens has joined #ruby
hiroaki has joined #ruby
ivanskie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mangold has quit [Quit: This computer has gone to sleep]
doodleb88 has joined #ruby
v01d4lph4 has joined #ruby
doodleb88 has quit [Read error: Connection reset by peer]
doodlebug has quit [Ping timeout: 245 seconds]
doodlebug has joined #ruby
zapata has quit [Quit: WeeChat 2.4]
Nicmavr has quit [Read error: Connection reset by peer]
cliluw has quit [Ping timeout: 268 seconds]
rprimus has quit [Ping timeout: 245 seconds]
cliluw has joined #ruby
Nicmavr has joined #ruby
rprimus has joined #ruby
pwnd_nsfw` has joined #ruby
Guest52407 has quit [Remote host closed the connection]
<havenwood> "on March 31, 2019, all support of the Ruby 2.3 series ends"
* havenwood checks the calendar
UncleCid__ has quit [Ping timeout: 246 seconds]
<havenwood> 2.3 is dead! Long live 2.6!
ivanskie has joined #ruby
<havenwood> 2.4 is now in security maintenance mode - so no more bug fixes. Time to bump to 2.5 or 2.6 if you haven't already!
hightower2 has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
ivanskie has quit [Ping timeout: 246 seconds]
segy has quit [Ping timeout: 245 seconds]
conta1 has quit [Quit: conta1]
ua has quit [Excess Flood]
code_zombie has joined #ruby
DTZUZO has quit [Ping timeout: 250 seconds]
orbyt_ has joined #ruby
sharma has joined #ruby
<sharma> can I post about jobs here
also_uplime has joined #ruby
<havenwood> sharma: if they're Ruby jobs!
sauvin has quit [Ping timeout: 245 seconds]
Swyper has quit [Remote host closed the connection]
segy has joined #ruby
ua has joined #ruby
jenrzzz has joined #ruby
aqd has quit [Remote host closed the connection]
aqd has joined #ruby
<sharma> Opportunity to be a Senior Backend Engineer at a VC funded startup. 2-5 yrs exp. and expertise in Ruby On Rails required. https://flow.invidelabs.com/jobPosting/5c80d2cb9e591c8421a92377
sharma has quit [Quit: Page closed]
also_uplime has quit [Remote host closed the connection]
bambanx has quit [Quit: Yaaic - Yet another Android IRC client - http://www.yaaic.org]
lytol has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 250 seconds]
lytol has joined #ruby
wolf-patacho is now known as \tau
briarcliff has joined #ruby
wallace_mu has joined #ruby
<wallace_mu> anyone know what's the correct syntax for alias_method? i am monkey patching a method from a class and that class is under a module, here is the gist https://gist.github.com/warm200/f18f217de1f4a942417d194d4b2b3fb0
<wallace_mu> module ActiveSupport::Cache::Store # Store is actually a class but i don't know the correct way to put it
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<wallace_mu> nvm figured out, should just define class under
noboruma has quit [Ping timeout: 245 seconds]
wallace_mu has left #ruby [#ruby]
briarcliff has quit [Read error: Connection reset by peer]
briarcliff has joined #ruby
noboruma has joined #ruby
jenrzzz has joined #ruby
shortdudey123 has quit [Ping timeout: 245 seconds]
briarcliff has quit [Quit: briarcliff]
shortdudey123 has joined #ruby
troulouliou_div2 has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
zleap has joined #ruby
zleap has quit [Changing host]
zleap has joined #ruby
zapata has joined #ruby
Swyper has joined #ruby
Swyper has quit []
orbyt_ has joined #ruby
AJA4350 has joined #ruby
kyrylo has joined #ruby
jenrzzz has quit [Ping timeout: 245 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
troulouliou_div2 has joined #ruby
cd has quit [Quit: cd]
jenrzzz has joined #ruby
nowhereman has joined #ruby
jottr has joined #ruby
orbyt_ has quit [Ping timeout: 244 seconds]
jenrzzz has quit [Ping timeout: 245 seconds]
jenrzzz has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
cisco has joined #ruby
cisco is now known as Guest64459
jottr has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 246 seconds]
troulouliou_div2 has quit [Read error: Connection reset by peer]
SeepingN has joined #ruby
d10n-work has joined #ruby
zleap has quit [Quit: WeeChat 1.6]
Guest64459 has quit [Ping timeout: 246 seconds]
zleap has joined #ruby
doodleb53 has joined #ruby
doodleb53 has quit [Read error: Connection reset by peer]
doodleb17 has joined #ruby
doodlebug has quit [Read error: Connection reset by peer]
doodlebug has joined #ruby
AJA4350 has quit [Remote host closed the connection]
lucasb has joined #ruby
graft has quit [Ping timeout: 244 seconds]
doodleb17 has quit [Read error: Connection reset by peer]
doodlebug has quit [Read error: Connection reset by peer]
cisco has joined #ruby
doodlebug has joined #ruby
cisco is now known as Guest47007
AJA4350 has joined #ruby
terens has quit [Ping timeout: 246 seconds]
lxsameer has quit [Ping timeout: 255 seconds]
fredolinhares has joined #ruby
hightower2 has quit [Changing host]
hightower2 has joined #ruby
graft has joined #ruby
jcalla has quit [Ping timeout: 246 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
dellavg_ has quit [Ping timeout: 250 seconds]
ur5us has joined #ruby
Guest47007 has quit [Ping timeout: 244 seconds]
\tau has quit [Quit: HAEU]
schleppel has quit [Quit: Konversation terminated!]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
priodev has quit [Ping timeout: 244 seconds]
priodev has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 244 seconds]
AJA4351 is now known as AJA4350
nowhereman has quit [Ping timeout: 258 seconds]
jenrzzz has joined #ruby
SeepingN has joined #ruby
AJA4350 has quit [Remote host closed the connection]
terens has joined #ruby
zleap has quit [Quit: WeeChat 1.6]
shortdudey123 has quit [Ping timeout: 246 seconds]
ldnunes has quit [Quit: Leaving]
troulouliou_div2 has joined #ruby
priodev has quit [Ping timeout: 245 seconds]
crankharder has quit [Ping timeout: 246 seconds]
crankharder has joined #ruby
shortdudey123 has joined #ruby
shortdudey123 has quit [Excess Flood]
kent\n has joined #ruby
priodev has joined #ruby
AJA4350 has joined #ruby
shortdudey123 has joined #ruby
crankhar1er has joined #ruby
crankharder has quit [Read error: Connection reset by peer]
spacesuitdiver has joined #ruby
AJA4350 has quit [Remote host closed the connection]
AJA4350 has joined #ruby
crankhar1er has quit [Ping timeout: 255 seconds]
sagax has joined #ruby
crankharder has joined #ruby
mahlon has quit [Quit: WeeChat 2.1]
mahlon has joined #ruby
orbyt_ has joined #ruby
aufi has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yokel has quit [Ping timeout: 246 seconds]
aufi has quit [Ping timeout: 245 seconds]
yokel has joined #ruby
wallace_mu has joined #ruby
wallace_mu has quit [Remote host closed the connection]
yokel has quit [Ping timeout: 250 seconds]
orbyt_ has joined #ruby
yokel has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
hiroaki has quit [Ping timeout: 250 seconds]
yokel has quit [Remote host closed the connection]
shortdudey123 has quit [Ping timeout: 246 seconds]
kaleido has quit [Quit: out]
shortdudey123 has joined #ruby
noboruma has quit [Ping timeout: 250 seconds]
noboruma has joined #ruby
reber has quit [Remote host closed the connection]
AJA4350 has quit [Ping timeout: 245 seconds]
bambanx has joined #ruby
terens has quit [Ping timeout: 245 seconds]
AJA4350 has joined #ruby
troulouliou_div2 has quit [Remote host closed the connection]
spacesuitdiver has quit [Ping timeout: 245 seconds]
wallace_mu has joined #ruby
D9 has joined #ruby
shortdudey123 has quit [Ping timeout: 245 seconds]
shortdudey123 has joined #ruby
shortdudey123 has quit [Excess Flood]
polishdub has quit [Quit: leaving]
dar123 has quit [Read error: Connection reset by peer]
shortdudey123 has joined #ruby
moei has quit [Quit: Leaving...]
Ai9zO5AP has quit [Quit: WeeChat 2.4]
shortdudey123 has quit [Ping timeout: 268 seconds]
shortdudey123 has joined #ruby
TreyG has joined #ruby
TreyG has quit [Client Quit]
terabytes has joined #ruby
hightower2 has quit [Ping timeout: 246 seconds]
mikeiniowa has quit [Remote host closed the connection]
riceandbeans has joined #ruby
shortdudey123 has quit [Ping timeout: 245 seconds]
shortdudey123 has joined #ruby
<riceandbeans> What's the net/http version of curl -s -i -H "Accept: application/json" example.com/routehere
shortdudey123 has quit [Excess Flood]
shortdudey123 has joined #ruby
<riceandbeans> https://bin.disroot.org/?7f3da819d3bcf444#p+znpiw8LgyE+45QBj/TStSDf+wSq2FBNuXqJqgH4D8=
renich_ has quit [Remote host closed the connection]
mikeiniowa has joined #ruby
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 255 seconds]
AJA4351 is now known as AJA4350
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> riceandbeans: https://bin.disroot.org/
orbyt_ has joined #ruby
<havenwood> riceandbeans: should be `request["Accept"] = "application/json"`, right?
<havenwood> riceandbeans: (the response header will be "Content-Type")
<havenwood> What you you all expect the result to be for this??:
<havenwood> (0..).cover?(..0)
<havenwood> (valid code in Ruby 2.7, but not the return value I expected)
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
_whitelogger has joined #ruby
<havenwood> riceandbeans: ^