darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CrazyEddy has joined #ruby
dviola has quit [Quit: WeeChat 2.3]
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tdy has quit [Ping timeout: 268 seconds]
_whitelogger has joined #ruby
Dimik has joined #ruby
arescorpio has quit [Quit: Leaving.]
bmurt has joined #ruby
AJA4350 has quit [Remote host closed the connection]
tdy has joined #ruby
nahra has quit [Remote host closed the connection]
nchambers has joined #ruby
esrse has joined #ruby
sshock has joined #ruby
patr0clus has quit [Ping timeout: 252 seconds]
cd has joined #ruby
cd has quit [Client Quit]
cd has joined #ruby
sshock has left #ruby [#ruby]
nahra has joined #ruby
darkhanb has joined #ruby
rivalomega has quit []
tonyhb has joined #ruby
Xiti has quit [Quit: Xiti]
venmx has joined #ruby
Xiti has joined #ruby
za1b1tsu has joined #ruby
tonyhb has quit [Quit: Page closed]
white_lilies has joined #ruby
nchambers has quit [Ping timeout: 268 seconds]
nchambers has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gnufied has quit [Ping timeout: 252 seconds]
braincrash has quit [Quit: bye bye]
_whitelogger has joined #ruby
braincrash has joined #ruby
roshanavand1 has joined #ruby
teardown has quit [Ping timeout: 246 seconds]
nowhere_man has quit [Read error: Connection reset by peer]
nowhereman has joined #ruby
nowhereman is now known as Guest24308
roshanavand has quit [Ping timeout: 276 seconds]
roshanavand1 is now known as roshanavand
ur5us has quit [Remote host closed the connection]
mangold has quit [Quit: This computer has gone to sleep]
MoritaShinobu has joined #ruby
kapil____ has joined #ruby
dellavg_ has joined #ruby
Exuma has joined #ruby
Exuma has quit [Client Quit]
Guest53511 has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Guest53511 has quit [Ping timeout: 246 seconds]
venmx has quit [Ping timeout: 268 seconds]
Exuma has joined #ruby
za1b1tsu has quit [Ping timeout: 272 seconds]
dionysus69 has quit [Ping timeout: 252 seconds]
za1b1tsu has joined #ruby
eckhardt_ has joined #ruby
Dimik has quit [Ping timeout: 272 seconds]
nchambers has quit [Quit: WeeChat 2.2]
houhoulis has quit [Remote host closed the connection]
<hays>
how should i implement equality tests for a class
<hays>
I guess I can define ==, but this means I need to make the internals public.. which isn't a bad thing per se, but just want to make sure im headed in the right direction here
<havenwood>
hays: It's either equal or not? There's not greater than, less than, etc?
dellavg_ has quit [Ping timeout: 244 seconds]
<havenwood>
hays: Defining #== makes sense if you want to check `==` and `!=`.
<hays>
well, lets just say its equality
<havenwood>
hays: If you want more comparisons, `include Comparable` and define #<=>.
<hays>
am i correct that i'lll need to be able to make this determination through public accessors
<havenwood>
hays: Usually you define a public #== method.
<hays>
since def ==(other) i need access to what's in other
<havenwood>
hays: You might consider also defining #eql? and #=== for your custom class, if those make sense.
aupadhye has joined #ruby
<hays>
im kinda stuck on this basic question
<hays>
seems ilke i need to know whats in other
<havenwood>
hays: it's the method argument
<havenwood>
&>> class NeverEqual; def == _; false end end; NeverEqual.new == 42
<hays>
ahh i see and to_i is allowed to be approximate, or truncate
<hays>
whereas to_int would not
<hays>
hmm. maybe not
<hays>
1.30.to_int works
white_lilies has quit [Ping timeout: 252 seconds]
conta has joined #ruby
<hays>
ok. this seems a bit mushy in my head but I think I get the general idea
<hays>
I kinda think Float.to_int shouldn't be implemented
aupadhye has quit [Remote host closed the connection]
<hays>
but maybe its ok, speaking more broadly, I might have Dog.to_i, that returns some sort of Dog id
<hays>
but clearly shouldn't be a Dog.to_int
<hays>
whereas the Float/Int thing is maybe a bit hazier, in terms of one just being a more precise, or different repressentation of the other
<hays>
So it does not require like a one-to-one mapping, but just semantic similarity
reber has joined #ruby
aupadhye has joined #ruby
<hays>
i came across pondering this question in a way where i have to compare two big fat json objects, and there's a lot of logic involved in how to compare the different members, right now i have a big fat block of conditional code that does the job, but was thinking of ways to clean it up
<hays>
i think the right way to do it would be to JSON.parse it, then go through it and replace the raw string/int/float data with objects of appropriate type. that way comparsons would work right and be encapsulated in the classes to which they belong
<hays>
not sure how JSON.generate would treat it on the way out through
roshanavand has quit [Remote host closed the connection]
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
akem has quit [Read error: Connection reset by peer]
dmitch has joined #ruby
akem has joined #ruby
cthu| has joined #ruby
bmurt has joined #ruby
darkhanb has joined #ruby
orbyt_ has joined #ruby
clemens3 has joined #ruby
phaul has quit [Ping timeout: 244 seconds]
jesfre has joined #ruby
despai has quit [Quit: ...]
dmitch has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 245 seconds]
lxsameer has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
queip has quit [Read error: Connection reset by peer]
clemens3 has quit [Ping timeout: 252 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
clemens3_ has joined #ruby
lxsameer has joined #ruby
queip has joined #ruby
c0ncealed4 has quit [Remote host closed the connection]
c0ncealed4 has joined #ruby
jamied has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sanscoeur has joined #ruby
dmitch has joined #ruby
ur5us has joined #ruby
<orbyt_>
Company office network has been having a strange issue when attempting to connect to rubygems. For whatever reason, it the connection will timeout, but making the network service inactive and then re-enabling it (macOS) seems to briefly resolve the issue.
<orbyt_>
Does anyone have a clue as to what might be going on? The internet works fine, it's just rubygems
cd has quit [Remote host closed the connection]
cd has joined #ruby
jamied has joined #ruby
lxsameer has quit [Ping timeout: 252 seconds]
altlock has joined #ruby
ur5us has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
akem has quit [Ping timeout: 245 seconds]
lxsameer has quit [Ping timeout: 272 seconds]
jesfre has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akaiiro has quit [Remote host closed the connection]
akem has joined #ruby
jesfre has joined #ruby
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
tag has joined #ruby
Puffball has quit [Remote host closed the connection]
roshanavand has quit [Remote host closed the connection]
roshanavand has joined #ruby
ivanskie has joined #ruby
roshanavand has quit [Remote host closed the connection]
discopatrick has joined #ruby
jesfre has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
altlock has quit [Ping timeout: 252 seconds]
queip has quit [Read error: Connection reset by peer]
jesfre has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.3]
al2o3-cr has joined #ruby
jesfre has quit [Quit: Oh snap. Looks like CMD + Q got the best of me.]
emerson has quit [Quit: WeeChat 2.2]
queip has joined #ruby
emerson has joined #ruby
akaiiro has joined #ruby
<z64>
hey all - i'm having some trouble making a simple pure ruby native extension. i have looked at docs and some example repos, and have `ext/mkrf_conf.rb` added to `s.extensions` & `s.files` but it does not seem to be executing
<z64>
the `mkrf_conf.rb` is suppoed to install some dependencies after doing some environment checks. nothing gets installed with `bundle install`, or even something like a `puts` is not displayed
maryo has quit [Quit: Leaving]
roshanavand has joined #ruby
OrangeManBad has quit [Ping timeout: 252 seconds]
akaiiro has quit [Ping timeout: 252 seconds]
lxsameer has joined #ruby
roshanavand has quit [Remote host closed the connection]
OrangeManBad has joined #ruby
roshanavand has joined #ruby
jamied has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
phaul has joined #ruby
ivanskie has quit [Read error: Connection reset by peer]
sauvin has quit [Read error: Connection reset by peer]
roshanavand has quit [Remote host closed the connection]
akaiiro has joined #ruby
eckhardt_ has joined #ruby
Nicmavr has quit [Read error: Connection reset by peer]
Nicmavr has joined #ruby
conta has quit [Quit: conta]
akaiiro has quit [Ping timeout: 240 seconds]
BTRE has quit [Remote host closed the connection]
alicef has quit [Ping timeout: 246 seconds]
Mike11 has joined #ruby
BTRE has joined #ruby
<z64>
ah nevermind i think.. it just isn't installed when running from within the gem repo itself. creating a quick dummy project with a Gemfile, bundle install builds the extension. maybe i just need to add running the ext/mkrf_conf.rb script to our dev rakefile then?
alicef has joined #ruby
im0nde has quit [Ping timeout: 252 seconds]
Xiti has quit [Quit: Xiti]
Xiti has joined #ruby
ellcs has joined #ruby
Inside has joined #ruby
<Inside>
Why is IRC so quiet? OH I AM NOT CONNECTED.
<Inside>
:|
<al2o3-cr>
that'll do it ;)
im0nde has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dbugger has quit [Ping timeout: 252 seconds]
despai has joined #ruby
DigitallyBorn has joined #ruby
ben has joined #ruby
cp_dev has joined #ruby
<ben>
Are gems always libraries or do applications also get packaged as gems?
<nchambers>
i've packaged applications as gems before
<nchambers>
ruby-gems actually has a guide for specifically that
<ben>
ah, cool, thank you
<ben>
I'm a bit lost with gemfiles and gemspecs and some half-packaged scripts floating around my machine :)
<ivanskie>
it adds .ap method to Logger class. and this used to work. and now it doesn't i don't get it.
<ivanskie>
so im now removing awesome_print dependency entirely since its not critical
bmurt has joined #ruby
queip has quit [Read error: Connection reset by peer]
AJA4350 has joined #ruby
<ivanskie>
which only means that i was doing something wrong
despai has quit [Ping timeout: 252 seconds]
im0nde has quit [Quit: im0nde]
queip has joined #ruby
ua has quit [Ping timeout: 240 seconds]
ua has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
cliluw has quit [Read error: Connection reset by peer]
phaul has quit [Ping timeout: 240 seconds]
defarge has quit [Quit: No Ping reply in 180 seconds.]
gigetoo has quit [Ping timeout: 268 seconds]
jyaworski has quit [Ping timeout: 268 seconds]
go|dfish has quit [Ping timeout: 268 seconds]
snickers has quit [Ping timeout: 268 seconds]
madhatter has quit [Ping timeout: 268 seconds]
z64 has quit [Ping timeout: 268 seconds]
jyaworski has joined #ruby
gigetoo has joined #ruby
madhatter has joined #ruby
weaksauce has quit [Read error: Connection reset by peer]
lytol has quit [Remote host closed the connection]
lytol has joined #ruby
DigitallyBorn has joined #ruby
cranq has quit [Ping timeout: 252 seconds]
TvL2386 has quit [Ping timeout: 268 seconds]
cranq has joined #ruby
gigetoo has quit [Ping timeout: 268 seconds]
gigetoo has joined #ruby
TvL2386 has joined #ruby
icarus has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
armyriad has joined #ruby
Emmanuel_Chanel has joined #ruby
blackmesa has joined #ruby
armyriad has quit [Read error: Connection reset by peer]
donofrio_ has joined #ruby
armyriad has joined #ruby
donofrio_ has quit [Remote host closed the connection]
donofrio_ has joined #ruby
go|dfish has joined #ruby
donofrio has quit [Ping timeout: 268 seconds]
queip has quit [Read error: Connection reset by peer]
Rapture has quit [Read error: Connection reset by peer]
venmx has quit [Ping timeout: 252 seconds]
whysthatso has quit [Quit: whysthatso]
Rapture has joined #ruby
bmurt has quit [Ping timeout: 246 seconds]
Rapture has quit [Client Quit]
yokel has quit [Ping timeout: 268 seconds]
queip has joined #ruby
bmurt has joined #ruby
yokel has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lxsameer has quit [Ping timeout: 244 seconds]
r3m is now known as C-o
venmx has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
voiceftp has quit [Remote host closed the connection]
voiceftp has joined #ruby
vondruch has quit [Quit: vondruch]
Guest24308 has joined #ruby
vondruch has joined #ruby
vondruch has quit [Client Quit]
vondruch has joined #ruby
venmx has quit [Ping timeout: 245 seconds]
nchambers has quit [Quit: WeeChat 2.2]
kapil____ has quit [Quit: Connection closed for inactivity]
venmx has joined #ruby
clemens3_ has quit [Ping timeout: 268 seconds]
relyks has joined #ruby
<relyks>
is there way to determine what exceptions can be produced from a method?
venmx_ has joined #ruby
jetchisel has quit [Ping timeout: 245 seconds]
venmx has quit [Ping timeout: 268 seconds]
DigitallyBorn has quit [Ping timeout: 246 seconds]
queip has quit [Read error: Connection reset by peer]
blackmesa1 has joined #ruby
<Radar>
relyks: what's the method?
venmx_ has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 252 seconds]
<relyks>
Radar: for any method? but preferably one that's not in the standard library? i'm curious how you go about handling all exceptions that might result from someone else's code
<Radar>
begin; TheirCode.a_method; rescue => e; <do something with e, the exception>; end
<relyks>
Radar: so there isn't a way without actually observing what exceptions are produced? nothing like calling .methods on an object to see its available methods?
<relyks>
I guess that's a problem with dealing with dynamically typed code lol
<relyks>
still love ruby <3
<Radar>
relyks: Exceptions could happen for many, many different reasons. Maybe it's a timeout because it failed to connect to a HTTP endpoint? But maybe it's an ArgumentError because of a typo in the code. It's hard to predict exceptions. They are exceptional.
<Radar>
It is not possible to predict.
<relyks>
yeah, true, but perhaps a method throws specific exception classes created by the maintainer