helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
Littlemyu__ has joined #ruby
allcentury has quit [Remote host closed the connection]
nettoweb has joined #ruby
allcentury has joined #ruby
finisherr has joined #ruby
fmcgeough has quit [Quit: fmcgeough]
raul782 has quit [Remote host closed the connection]
benlieb has quit [Quit: benlieb]
hahuang65 has quit [Read error: Connection reset by peer]
dnicole has joined #ruby
hahuang65 has joined #ruby
benlieb has joined #ruby
_sfiguser has quit [Ping timeout: 245 seconds]
chopin has quit [Ping timeout: 258 seconds]
Guest43 has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Jardayn_two has joined #ruby
railssmi_ has joined #ruby
allcentury has quit [Remote host closed the connection]
definity has quit [Ping timeout: 250 seconds]
raul782 has joined #ruby
rapha has joined #ruby
<rapha>
hi!
<havenwood>
rapha: hi!
railssmith has quit [Ping timeout: 260 seconds]
Jardayn has quit [Ping timeout: 240 seconds]
<rapha>
i'm wondering about an algorithm for saying "this array may contain 'x', but whether it does or not, it also contains 'y'"... ary.include?('x') is easy, but my head is still close to exploding o_O
allcentury has joined #ruby
<rapha>
ur sorry
<rapha>
"... but whether it does or not, it also contains at least one other thing"
<rapha>
i.e. one thing not being 'x', in addition to 'x', which may or may not be present
whiteline has quit [Read error: Connection reset by peer]
allcentury has quit [Remote host closed the connection]
whiteline has joined #ruby
allcentury has joined #ruby
<rapha>
if ary.include?('x') && ary.size >= 1; if ary.size == 1; !ary.include?('x'); ...; end; end is the best thing i can come up with so far and it's buggy
_sfiguser has joined #ruby
jackjackdripper has quit [Quit: Leaving.]
<nchambers>
you're wanting to test if ary contains x or y?
jenrzzz has quit [Ping timeout: 265 seconds]
troys_ is now known as troys
<rapha>
nchambers: no, sorry. I want to test if ary contains at least one element /besides/ x, no matter whether or not it does contain x.
jcao219 has quit [Ping timeout: 268 seconds]
JoshS has joined #ruby
<havenwood>
rapha: like?: ary.any? { |s| s != 'x' }
whathappens has quit [Remote host closed the connection]
<rapha>
oh, so any? takes a block!
<havenwood>
rapha: or none? and all?, etc
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
<rapha>
yes, that does what I need, and it looks so elegant at that! thank you havenwood!
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
tuxaddicted has quit [Quit: Leaving]
webguynow has quit [Ping timeout: 252 seconds]
webguynow has joined #ruby
gnufied has joined #ruby
gnufied has quit [Client Quit]
domgetter has joined #ruby
c0mrad3 has quit [Quit: Connection closed for inactivity]
pwnd_nsfw has joined #ruby
Higgy has joined #ruby
Robtop__ has quit [Ping timeout: 240 seconds]
railssmith has joined #ruby
AlexRussia has joined #ruby
Higgy has quit [Quit: Leaving]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
konsolebox has quit [Quit: Leaving]
CloCkWeRX has joined #ruby
aegis3121 has joined #ruby
tristanp_ has joined #ruby
zenguy_pc has quit [Ping timeout: 246 seconds]
tristanp has quit [Ping timeout: 260 seconds]
zenguy_pc has joined #ruby
alan_w has joined #ruby
konsolebox has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
gix has quit [Ping timeout: 256 seconds]
gix has joined #ruby
govg has quit [Ping timeout: 256 seconds]
ghr has quit [Ping timeout: 268 seconds]
<nchambers>
does cinch have the ability to interact with chanserv?
ghr has joined #ruby
allcentury has quit [Remote host closed the connection]
optiz0r has joined #ruby
astrobunny has quit [Remote host closed the connection]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
igniting has quit [Ping timeout: 244 seconds]
dnicole has quit [Remote host closed the connection]
Devalo has joined #ruby
nadir is now known as TrashCan
aegis3121 has quit [Ping timeout: 260 seconds]
Devalo has quit [Ping timeout: 246 seconds]
johnmccabe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TrashCan is now known as nadir
Moosashi has joined #ruby
c355e3b has quit [Quit: Connection closed for inactivity]
Moosashi has quit [Client Quit]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
etehtsea has quit [Ping timeout: 240 seconds]
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
govg has joined #ruby
prawnzy has joined #ruby
sneakerhax has quit [Max SendQ exceeded]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
prawnzy has quit [Ping timeout: 250 seconds]
wackydoo has quit [Ping timeout: 246 seconds]
xall has joined #ruby
Cohedrin has joined #ruby
arescorpio has joined #ruby
Illianthe has joined #ruby
Cohedrin has quit [Client Quit]
Cohedrin has joined #ruby
konsolebox has quit [Quit: Leaving]
rubyshop has joined #ruby
rubyshop has quit [Remote host closed the connection]
jcao219 has joined #ruby
aupadhye has joined #ruby
pawnbox has joined #ruby
alan_w has quit [Quit: WeeChat 1.4]
Guest43 has joined #ruby
astrobunny has joined #ruby
govg has quit [Ping timeout: 256 seconds]
astrobunny has quit [Remote host closed the connection]
astrobunny has joined #ruby
troys_ is now known as troys
Guest43 has quit [Ping timeout: 250 seconds]
benlieb has quit [Quit: benlieb]
arescorpio has quit [Quit: Leaving.]
babblebre has quit [Quit: Connection closed for inactivity]
tuxaddicted has joined #ruby
aupadhye_ has joined #ruby
bocaneri has joined #ruby
etehtsea has joined #ruby
infernix has quit [Ping timeout: 260 seconds]
raul782 has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
nankyokusei has joined #ruby
sdothum has quit [Quit: ZNC - 1.6.0 - http://znc.in]
Tharbakim has quit [Ping timeout: 268 seconds]
nankyokusei has quit [Ping timeout: 260 seconds]
Tharbakim has joined #ruby
sdwrage has quit [Ping timeout: 244 seconds]
raul782 has quit [Remote host closed the connection]
benlieb has joined #ruby
raul782 has joined #ruby
cinderhaze has left #ruby ["WeeChat 0.3.8"]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
aupadhye_ has quit [Quit: Leaving]
raul782 has quit [Ping timeout: 240 seconds]
Tharbakim has quit [Ping timeout: 248 seconds]
Tharbakim has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
sdwrage has joined #ruby
exchgr has quit [Ping timeout: 260 seconds]
igniting has joined #ruby
allcentury has joined #ruby
whathappens has joined #ruby
exchgr has joined #ruby
vdl has quit [Ping timeout: 244 seconds]
troys has quit [Quit: Bye]
solocshaw has joined #ruby
allcentury has quit [Ping timeout: 260 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
chris349 has quit [Ping timeout: 240 seconds]
volix has quit [Ping timeout: 246 seconds]
volix has joined #ruby
ICantCook has quit [Quit: bye]
infernix has joined #ruby
solocshaw has quit [Ping timeout: 256 seconds]
djbkd_ has joined #ruby
xall has quit [Ping timeout: 252 seconds]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
cyphase has quit [Ping timeout: 252 seconds]
muelleme has joined #ruby
izaac has quit [Ping timeout: 268 seconds]
jshjsh has quit [Quit: Leaving]
cyphase has joined #ruby
izaac has joined #ruby
jaguarmagenta has joined #ruby
raul782 has joined #ruby
vdl has joined #ruby
raul782 has quit [Remote host closed the connection]
raul782 has joined #ruby
whathappens has quit [Quit: Leaving...]
muelleme has quit [Ping timeout: 256 seconds]
Rickmasta has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
pwnd_nsfw` has joined #ruby
pwnd_nsfw has quit [Ping timeout: 245 seconds]
tvw has joined #ruby
jblack has quit [Ping timeout: 250 seconds]
muelleme has joined #ruby
jblack has joined #ruby
helpa has quit [Remote host closed the connection]
helpa-bot has joined #ruby
helpa-bot has joined #ruby
djbkd_ has quit [Ping timeout: 260 seconds]
helpa-bot has quit [Remote host closed the connection]
finisherr has quit [Quit: finisherr]
helpa has joined #ruby
sundhell has joined #ruby
sundhell has quit [Client Quit]
jblack has quit [Ping timeout: 268 seconds]
Devalo has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Devalo has quit [Remote host closed the connection]
yuki_is_bored has joined #ruby
govg has joined #ruby
bikram_ has joined #ruby
raeoks has joined #ruby
ledestin has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
prawnzy has joined #ruby
helpa-bot has joined #ruby
cyphase has joined #ruby
muelleme has quit [Ping timeout: 246 seconds]
helpa has quit [Remote host closed the connection]
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
prawnzy has quit [Ping timeout: 250 seconds]
sundhell has joined #ruby
Dimik has quit [Ping timeout: 250 seconds]
solocshaw has joined #ruby
konsolebox has joined #ruby
CloCkWeRX has quit [Ping timeout: 246 seconds]
aufi has joined #ruby
allcentury has joined #ruby
lxsameer has joined #ruby
gagrio has joined #ruby
pwnd_nsfw has joined #ruby
allcentury has quit [Ping timeout: 246 seconds]
CosmicTwitch has joined #ruby
<CosmicTwitch>
hi I'm trying to puts from socket, how can I print out the escape character symbol at the end of the line (square with numbers?) to "\x000" format ?
<CosmicTwitch>
I thought this was a unicode fail .encode(utf8) wasnt the solution
pwnd_nsfw` has quit [Ping timeout: 240 seconds]
solocshaw has quit [Ping timeout: 260 seconds]
mtkd has quit [Read error: Connection reset by peer]
cyphase has quit [Ping timeout: 245 seconds]
mtkd has joined #ruby
adgtl has joined #ruby
last_staff has joined #ruby
gingray has joined #ruby
pawnbox has quit [Ping timeout: 256 seconds]
zenguy_pc has quit [Ping timeout: 246 seconds]
xall has joined #ruby
vuoto has joined #ruby
CloCkWeRX has joined #ruby
cyphase has joined #ruby
djbkd_ has joined #ruby
zenguy_pc has joined #ruby
konsolebox has quit [Quit: Leaving]
<CosmicTwitch>
ok just print the characters
vuoto has quit [Remote host closed the connection]
<CosmicTwitch>
what a novice..
govg has quit [Ping timeout: 246 seconds]
xall has quit [Ping timeout: 248 seconds]
blaxter has joined #ruby
pawnbox has joined #ruby
blaxter has quit [Remote host closed the connection]
firstdayonthejob has joined #ruby
blaxter has joined #ruby
konsolebox has joined #ruby
quazimodo has quit [Ping timeout: 265 seconds]
blaxter has quit [Quit: foo]
firstdayonthejob has quit [Ping timeout: 268 seconds]
raeoks has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
CloCkWeRX has quit [Quit: Leaving.]
zenguy_pc has quit [Ping timeout: 246 seconds]
andikr has joined #ruby
jnj has joined #ruby
charliesome has joined #ruby
nankyokusei has joined #ruby
<jnj>
Could someone help me out with threading in ruby? I want to create a thread that runs a method that has a while loop that continually receives input. It then adds this input to an array - but when I run my code and perform logic on the array, it's as if the array was never populated.
<jnj>
I'm creating the thread by doing thread_name = Thread.new { method_with_while_loop }
<jnj>
And the variables I'm trying to manipulate are global
zenguy_pc has joined #ruby
charliesome has quit [Client Quit]
charliesome has joined #ruby
charliesome has quit [Client Quit]
nankyokusei has quit [Ping timeout: 256 seconds]
amclain has quit [Quit: Leaving]
ur5us has joined #ruby
dionysus69 has joined #ruby
adgtl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackwind_123 has quit [Ping timeout: 250 seconds]
<dminuoso>
jnj: Testcase please. You can use https://eval.in
* dminuoso
puts his money on a missing Thread#join
raul782 has quit [Remote host closed the connection]
cyphase has quit [Ping timeout: 260 seconds]
<jnj>
dminuoso: Hey, thanks for the response. I solved the problem. It wasn't a missing thread join, but rather there were issues in my code that was run by the thread that I did not know about. I was able to find the errors by using sprinkling thread.join in my code.
<jnj>
dminuoso: So, I guess I was missing a thread.join? haha
Macaveli has joined #ruby
JeanCarloMachado has joined #ruby
djbkd_ has quit [Remote host closed the connection]
biberu has joined #ruby
cyphase has joined #ruby
govg has joined #ruby
TomyWork has joined #ruby
raeoks has joined #ruby
aganov has joined #ruby
<nchambers>
are cinch questions allowed in here? the cinch channel is pretty dead
* tobiasvl
googles what cinch is
<dminuoso>
nchambers: I want to buy a Ford, but there was noone at the Ford shop, so I went to the Renault shop: "Why won't you sell me a Ford"?
bigkevmcd has joined #ruby
benlieb has quit [Quit: benlieb]
<tobiasvl>
cinch is apparently something that is written in ruby
<nchambers>
dminuoso, wat? its a pretty popular ruby library
<dminuoso>
Jokes aside, feel free to ask in here.
<nchambers>
haha thanks
adgtl has joined #ruby
<tobiasvl>
dminuoso: would be more like… going to General Motors to buy a Ford maybe? since cinch is built out of ruby parts… but let's let the analogy lie ;)
<nchambers>
however, seemingly randomly, if I do `$ban #channel nick!*@*` or `$ban #channel nick`, I get the following error:
claudiuinberlin has joined #ruby
<dminuoso>
nchambers: I too often use the password "redacted" - nobody ever figures this out if I ever accidentally commit a file with a password in git.
<tobiasvl>
dminuoso: doesn't GM make car parts? I dunno
<nchambers>
dminuoso, hehe
jblack has joined #ruby
<nchambers>
and I've verified mask (which is what looks to be causing the error to me) is never nil
dionysus69 has quit [Ping timeout: 260 seconds]
<dminuoso>
tobiasvl: Yeah, but so does Renault..
jblack has quit [Ping timeout: 252 seconds]
<dminuoso>
I mean, Im not saying that Renault is obviously the better pick here, but I don't see why you prefer GM.
<dminuoso>
Im curious
<tobiasvl>
I don't prefer GM :P
<tobiasvl>
I'm not American, I don't have a car, I just attempted to rectify the analogy… perhaps in error
<dminuoso>
Ohh.
ebx has joined #ruby
<dminuoso>
Both Ford and Renault are car manufacturers. ;-)
<dminuoso>
Amongst other things.
the_drow has joined #ruby
<tobiasvl>
yeah, that I knew
<dminuoso>
Then Im even more confused
<tobiasvl>
eh, forget it
<dminuoso>
Done.
<dminuoso>
Is there some better mechanism to load binary data for specs than to fill your specs with stuff like "data = File.binread(Rails.root.join("specs", "codes", "xyz", "correct", "abc.raw"))" ?
symm- has quit [Ping timeout: 256 seconds]
frozengeek__ has joined #ruby
<dminuoso>
(This is binary data for unit testing service components)
<manveru>
data = File.binread(Rails.root.join("specs/codes/xyz/correct/abc.raw"))
<manveru>
:)
edwinvdgraaf has joined #ruby
quazimodo has joined #ruby
dushyant has joined #ruby
saneax-_-|AFK is now known as saneax
nofxx_ has joined #ruby
nofxx_ has joined #ruby
nofxx_ has quit [Changing host]
SesMan has joined #ruby
neeraj has joined #ruby
xrlk has quit [Ping timeout: 260 seconds]
Nanuq has quit [Ping timeout: 260 seconds]
Nanuq has joined #ruby
nofxx has quit [Ping timeout: 265 seconds]
neeraj has left #ruby [#ruby]
breakaway has joined #ruby
<breakaway>
who needs pointers when you can have references
xall has joined #ruby
hakunin has joined #ruby
dnicole has joined #ruby
mark_66 has joined #ruby
breakaway has left #ruby [#ruby]
<dminuoso>
manveru: That is not an improvement by any margin.
<manveru>
it's shorter
<dminuoso>
The problem isn't exactly the length, but I'mm looking for something that integrates more nicely like rails fixtures or vcr cassettes.
<dminuoso>
I dont want to have to manually reference every binary file
jaguarmagenta has quit [Remote host closed the connection]
jaguarmagenta has joined #ruby
gusrub_ has quit [Remote host closed the connection]
saneax is now known as saneax-_-|AFK
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 240 seconds]
govg has quit [Ping timeout: 260 seconds]
jaguarmagenta has quit [Ping timeout: 248 seconds]
startupality has quit [Quit: startupality]
startupality has joined #ruby
conta has joined #ruby
aryaching has quit [Read error: Connection reset by peer]
etehtsea has quit [Ping timeout: 268 seconds]
_sfiguser has quit [Ping timeout: 244 seconds]
aryaching has joined #ruby
hakunin has quit []
riotgsmport[m] has joined #ruby
terens has joined #ruby
Humdai has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
xall_ has quit [Ping timeout: 268 seconds]
CloCkWeRX has joined #ruby
tomphp has joined #ruby
raeoks has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
JeanCarloMachado has quit [Ping timeout: 248 seconds]
nettoweb has joined #ruby
JeanCarloMachado has joined #ruby
ferr has joined #ruby
startupality has quit [Quit: startupality]
Fernando-Basso has joined #ruby
_sfiguser has joined #ruby
Beams has joined #ruby
saneax-_-|AFK is now known as saneax
TvL2386 has joined #ruby
pandaant has joined #ruby
jblack has joined #ruby
astrobunny has quit [Remote host closed the connection]
Darmani has quit [Ping timeout: 260 seconds]
<jnj>
Can someone help me out with Array#pack and String#unpack? I'm just curious as to why packed = ["foobar"].pack("H*") and then packed.unpack("H*") = ["f88bab"]. Would this have to do with endianness?
<jnj>
domgetter: Well, the thing is - is that I want these numbers to be two byte unsigned ints, so I have been trying a = [0, 0, 32], a.pack("n*")
dushyant has quit [Ping timeout: 246 seconds]
Macaveli has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<heftig>
That should work
<domgetter>
Yeah that looks good
<jnj>
heftig: Ah, sweet ok. But for encoding my string, should I be doing what domgetter has been suggesting? I'd like to turn the string into hex, "foobar".unpack("H*") returns the right hex for foobar
<jnj>
heftig: But since I'm just sending these as bytes, would String#bytes be sufficient?
Jameser has quit [Ping timeout: 268 seconds]
<heftig>
Whatever accepts your input should be using strings anyway
<heftig>
8bit strings ARE bytes
<heftig>
String#bytes doesn't produce bytes, it produces an Array of numbers representing bytes
<heftig>
Which is terribly inefficient
Macaveli has joined #ruby
<domgetter>
but great for learning!
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
<jnj>
haha
<jnj>
thanks guys
dushyant has joined #ruby
<jnj>
I'm just trying to create packets to send over, where the header is three numbers, two bytes each and i want to send a string along with the header
<domgetter>
It's fun to "view" the bits using rjust
<jnj>
I've been packing my header and then doing "foobar".unpack("H*") to encode my string, then the resulting packet is header + string, but I know that isn't quite right
gregf_ has joined #ruby
martynas_ has joined #ruby
<heftig>
Don't hexify the string, just append
<domgetter>
The "foobar" string is already a list of bytes. You can just send it on over. Unless there's some other constraint to this problem
Humdai has quit [Ping timeout: 250 seconds]
<heftig>
You can use force_encoding to transform an utf-8 string into a binary one, if needed
blackwind_123 has quit [Ping timeout: 256 seconds]
<jnj>
OHHH I get what you meant by saying that earlier
<jnj>
I get it now
<domgetter>
something clicked :)
<dminuoso>
CVE-2016-4484 -- hilarity ensues.
<dminuoso>
This is what happens when bash scripts define the security of your entire systems. :-)
<heftig>
Although, maybe encoding (String#encode) from UTF-8 to BINARY will just be a no-op anyway
martynas_ has quit [Ping timeout: 260 seconds]
blackwind_123 has joined #ruby
govg has quit [Ping timeout: 245 seconds]
<domgetter>
dminuoso: "If you use Debian or Ubuntu, and you have encrypted the system partition, then your systems is vulnerable."
<jnj>
You guys are gr8, thank you so much
<heftig>
While the other way around will at least do sanity checks, which you want
<heftig>
force_encoding definitely doesn't do any checks or character set transforms
jaruga___ has joined #ruby
ur5us has quit [Remote host closed the connection]
tvw has quit [Remote host closed the connection]
adgtl has joined #ruby
jenrzzz has joined #ruby
koooge has quit [Quit: Leaving...]
ldnunes has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jnj has quit [Ping timeout: 256 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
xall_ has joined #ruby
workmad3 has joined #ruby
Humdai has joined #ruby
pawnbox has quit [Ping timeout: 248 seconds]
ta_ has joined #ruby
JeanCarloMachado has quit [Ping timeout: 256 seconds]
xall_ has quit [Ping timeout: 248 seconds]
j2k has joined #ruby
jcao219 has quit [Ping timeout: 256 seconds]
joonty1 has joined #ruby
joonty has quit [Ping timeout: 240 seconds]
xall has joined #ruby
JeanCarloMachado has joined #ruby
Cohedrin has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Madplatypus has joined #ruby
joonty2 has joined #ruby
pawnbox has joined #ruby
xall has quit [Ping timeout: 240 seconds]
zapcode has joined #ruby
bayed has joined #ruby
ishe_ua has joined #ruby
blackwind_123 has quit [Ping timeout: 245 seconds]
johnmccabe has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jblack has joined #ruby
tvw has joined #ruby
Rickmasta has joined #ruby
hays_ is now known as hays
joonty2 has quit [Ping timeout: 245 seconds]
platzhirsch has quit [Ping timeout: 256 seconds]
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pawnbox has quit [Ping timeout: 260 seconds]
workmad3 has quit [Ping timeout: 256 seconds]
joonty has joined #ruby
jblack has quit [Ping timeout: 245 seconds]
joonty1 has quit [Ping timeout: 260 seconds]
Rickmasta has quit [Ping timeout: 258 seconds]
dionysus69 has quit [Ping timeout: 246 seconds]
ken_barber has joined #ruby
mim1k|wo1k has joined #ruby
sepp2k has joined #ruby
joonty1 has joined #ruby
vondruch has joined #ruby
cyphase has quit [Ping timeout: 250 seconds]
dionysus69 has joined #ruby
lenwood has quit [Ping timeout: 268 seconds]
joonty has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
boddhisattva has joined #ruby
cyphase has joined #ruby
synaps3 has left #ruby ["Leaving"]
dviola has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
kbdkode has quit [Quit: see ya ]
joonty2 has joined #ruby
jhack_ has joined #ruby
<boddhisattva>
Hi there, apparently in ruby 2.3 - 19.9 * 100 = 1989.9999999999998 . Anybody know why this may be the case or am I missing something here ?
<Zarthus>
look up floating point math on google, it's not precise.
xall has quit [Ping timeout: 260 seconds]
jhack_ has quit [Client Quit]
joonty1 has quit [Ping timeout: 268 seconds]
<Zarthus>
if you need it to be precise (like with currency), don't use floats. Use ints instead.
blackwind_123 has quit [Ping timeout: 256 seconds]
joonty1 has joined #ruby
blackwind_123 has joined #ruby
<boddhisattva>
Yep, this number is basically used for currency purpose and stored as int in the DB.. in my case, when a user needs to create a new refund for an order.. the input via the form could have decimals..
jhack_ has joined #ruby
pawnbox has joined #ruby
<boddhisattva>
which in the backend gets converted to int.. and that's when I experience this ..
joonty2 has quit [Ping timeout: 265 seconds]
<boddhisattva>
I could the ceil function as a workaround.. but was wondering if there is a better way..
<apeiros>
there's also BigDecimal and the money gem
<manveru>
forgot about BigDecimal
<manveru>
that's probably better than Rational for this
joonty1 has joined #ruby
nankyokusei has quit [Ping timeout: 256 seconds]
vondruch has quit [Quit: vondruch]
banisterfiend has joined #ruby
etehtsea has quit [Ping timeout: 248 seconds]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
pawnbox has joined #ruby
<apeiros>
I looked up the money type on pg to remember why I didn't use it - it uses a global setting for the precision :-/
<apeiros>
also it formats all values with the same currency
gr8g has quit [Ping timeout: 245 seconds]
rikai has quit [Read error: Connection reset by peer]
duper has quit [Ping timeout: 256 seconds]
TheWhip has quit [Remote host closed the connection]
tubbo has quit [Ping timeout: 260 seconds]
gr8g has joined #ruby
sczizzo has joined #ruby
<manveru>
well, it's useful sometimes
<manveru>
i don't think there's ever a one-size-fits-all approach to handling money :|
iamayam has joined #ruby
<manveru>
we control the whole stack, so it's not a big issue
<boddhisattva_>
It's good to know about other options, personally, the round function looks like the simplest option to me... ("19.90".to_f * 100).round seems to do the job for me to store it as int.. any specific reason why I may need ("19.90".to_f * 100).round(12), any edge cases that I may be missing ?
<manveru>
round(12) will only start rounding at the 11th decimal
rikai has joined #ruby
<toretore>
sure there is: use ints/cents and only present to the user as decimal
<ruby[bot]>
manveru: # => [1990.0, 1990.0, 1990.0, 1990.0, 1990.0, 1990.0, 1990.0, 1990.0, 1989.9999999999995, 1989.9999999999 ...check link for more (https://eval.in/678887)
<domgetter>
I agree with toretore, unless you have a *really* good reason not to, represent money as integers as much as possible (obviously things like interest calculations and taxes have to be rounded).
gr8g has quit [Ping timeout: 256 seconds]
tubbo has joined #ruby
<domgetter>
Also, check with your stakeholders what rounding should be used. There are several kinds
Xeago has quit [Ping timeout: 268 seconds]
dushyant has quit [Quit: Leaving]
Xeago has joined #ruby
gr8g has joined #ruby
gnufied has joined #ruby
<boddhisattva_>
domgetter and toretore, just to add more context, I'm saving them as integers in the backend.. when a user is creating a refund for an order, that's when they are entering the amt from the UI..
jphase has joined #ruby
millerti has joined #ruby
Littlemyu__ has quit [Ping timeout: 260 seconds]
gingray has joined #ruby
BTRE has quit [Ping timeout: 240 seconds]
<domgetter>
boddhisattva_ My advice applies to the front-end as well. In the surrounding code, treat money as integers, and when you display it, convert it into whatever representation the user most likely wants to see.
adgtl has joined #ruby
BTRE has joined #ruby
ramortegui has joined #ruby
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<toretore>
boddhisattva_: you have 1) amount = 5534; ($55.34) stored; 2) user enters "$43.12" 3) refund = "$43.12".gsub(/\D/, '').to_i; 4) sum = amount - refund 5) puts('%.2f' % sum/100.0)
xall has joined #ruby
duper has joined #ruby
<toretore>
only the *presentation* is decimal; never the values you work with
adgtl_ has joined #ruby
domgetter has quit [Ping timeout: 265 seconds]
Savage has joined #ruby
tvw has quit [Read error: Connection reset by peer]
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
adgtl__ has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
adgtl has quit [Ping timeout: 256 seconds]
xall has quit [Ping timeout: 250 seconds]
vondruch has joined #ruby
chwbacca has joined #ruby
PlasmaStar has quit [Ping timeout: 256 seconds]
adgtl_ has quit [Ping timeout: 245 seconds]
rfoust has joined #ruby
PlasmaStar has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
kcn has joined #ruby
mikecmpb_ is now known as mikecmpbll
gizmore has joined #ruby
dionysus69 has quit [Ping timeout: 260 seconds]
adgtl__ has quit [Ping timeout: 240 seconds]
TheWhip has joined #ruby
gizmore has quit [Client Quit]
adgtl has joined #ruby
brendan- has joined #ruby
GodFather has quit [Ping timeout: 258 seconds]
aupadhye has quit [Ping timeout: 244 seconds]
dionysus69 has joined #ruby
definity has joined #ruby
<apeiros>
values don't have bases anyway
<apeiros>
if you think values have bases, tell me what base "ten" has, or "fifty".
<apeiros>
base -> representational (or in programming, when you have strings)
jphase has joined #ruby
gr8g is now known as grug
pragmaticus has joined #ruby
adgtl has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<boddhisattva_>
manveru_ looks like in my case I could use the default precision(0 digits) because, if for instance you check https://ruby-doc.org/core-2.1.2/Float.html#method-i-round, 34567.89.round(0) #=> 34568 & in my case ("19.90".to_f * 100).round which i.e., 1989.9999999999998.round =># 1990
etehtsea has joined #ruby
<toretore>
y r u doing "19.90".to_f
<boddhisattva_>
Thanks domgetter, I'm doing the same thing in the frontend before displaying.
<boddhisattva_>
toretore_ when one submits the form, from the UI, the input comes in as a string.. so I need to convert that to a float before I multiply by 100 to convert it to an integer..
Sindriava has joined #ruby
adgtl has joined #ruby
sundhell has quit [Read error: Connection reset by peer]
<Sindriava>
Hello! Could someone help me set up RVM on macOS? I'm having some issues with installing ruby (possibly a bug in RVM?)
banisterfiend has joined #ruby
sundhell has joined #ruby
ocbtec has quit [Quit: leaving]
DLSteve has joined #ruby
<toretore>
boddhisattva_: did you read what i wrote before? why are you converting it to a float and not an int?
p1ngarn has quit [Quit: p1ngarn]
Ishido has joined #ruby
baweaver_away is now known as baweaver
<toretore>
Sindriava: i can help u forget rvm exists
saslam has joined #ruby
<toretore>
Sindriava: which is a snarky way of saying "Hello to you my new friend! Perhaps you would be interested in learning about alternative ways to achieve your goals?"
<Sindriava>
toretore: IRC users being useful as ever! Please, do enlighten me.
GodFather has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
<toretore>
Sindriava: chruby or rbenv
<Sindriava>
toretore: Followed by a snarky way of saying "RVM sucks, tell me more" :D
jphase has quit [Remote host closed the connection]
<Sindriava>
toretore: I've tried rbenv, but I get ssl errors on `gem install`, maybe the issues are linked. I'll reinstall rbenv and paste the error
<toretore>
boddhisattva_: have you not seen the many people telling you not to use floats *anywhere*?
blackmesa has joined #ruby
adgtl has joined #ruby
vondruch has quit [Quit: vondruch]
<Sindriava>
toretore: Oh, I see, I'm still using the system ruby *facepalm*
mtkd has joined #ruby
<toretore>
Sindriava: it's probably best to remove that, unless it's required by something else
<Sindriava>
toretore: it's integrated in macOS afaik, so I'll have to deal with it. How do I the global version with rbenv<
<Sindriava>
*?
<Sindriava>
Floats are the devil's playthings
<toretore>
not sure
<toretore>
something like --system afaicr
<Sindriava>
oh, `rbenv global` it seems
ishe_ua has joined #ruby
<boddhisattva_>
toretore_ I did see some rounding issues with float, that why I thought of using ("19.90".to_f * 100).round as manveru suggested as one of the options..
<manveru>
boddhisattva_: just don't forget the argument :)
tpendragon has quit [Ping timeout: 258 seconds]
<Sindriava>
boddhisattva_: Are the numbers being input from an html form? If you make sure they always come in in this format, that helps a lot
tyang has joined #ruby
blackjid has quit [Ping timeout: 240 seconds]
<boddhisattva_>
manveru_ I tried showing with an e.g., above that this worked without the argument.. :) Did you get a chance to see that ?
<Sindriava>
toretore: Fixed, I wasn't putting rbenv shims into path properly :) Thanks!
lenwood has joined #ruby
jphase has joined #ruby
joonty2 has joined #ruby
vondruch has joined #ruby
igniting has quit [Ping timeout: 265 seconds]
etehtsea has quit [Ping timeout: 246 seconds]
JesseH has joined #ruby
jhass has quit [Ping timeout: 246 seconds]
joonty1 has quit [Ping timeout: 250 seconds]
nettoweb has joined #ruby
hightower3 has joined #ruby
jhass has joined #ruby
phwelo has joined #ruby
<manveru>
boddhisattva_: sorry, you keep talking with manveru_ which doesn't highlight :P
hightower2 has quit [Ping timeout: 240 seconds]
SuperLag has joined #ruby
<manveru>
but yeah, if all you want is to get an int, then round(0) is fine i guess
raeoks has joined #ruby
jhack_ has quit [Quit: jhack_]
quazimodo has quit [Ping timeout: 260 seconds]
Sindriava has quit [Quit: _]
saslam has quit [Ping timeout: 240 seconds]
conta has quit [Ping timeout: 246 seconds]
<boddhisattva_>
sorry manveru, I may be doing this wrong.. I was under the impression that manveru_ would probably be a mention to you.. but I now realize it does not work that way.. may be just mentioning manveru would give you the ping that I'm mentioning you ?
<manveru>
yes
<manveru>
my client only matches exact matches, plus or minus :
<boddhisattva_>
cool. Thanks for your time manveru, toretore, domgetter and zarthus ..
hightower2 has joined #ruby
allcentury has quit [Ping timeout: 252 seconds]
chwbacca has quit [Remote host closed the connection]
jhack_ has joined #ruby
binaryplease has quit [Quit: binaryplease]
hightower3 has quit [Ping timeout: 250 seconds]
tpendragon has joined #ruby
jeanlinux has joined #ruby
tuxaddicted has quit [Quit: Leaving]
jeanlinux has quit [Remote host closed the connection]
jeanlinux has joined #ruby
boddhisattva_ has left #ruby [#ruby]
nettoweb has quit [Ping timeout: 252 seconds]
claudiuinberlin has joined #ruby
hightower2 has quit [Ping timeout: 240 seconds]
Puffball has quit [Quit: No Ping reply in 180 seconds.]
hightower2 has joined #ruby
colegatron has joined #ruby
loincloth has quit [Ping timeout: 256 seconds]
blackjid has joined #ruby
Puffball has joined #ruby
Immune has quit [Ping timeout: 260 seconds]
frozengeek___ has quit [Remote host closed the connection]
<Daneel>
humm the library is not installed with libvirt :(
chris3492 has joined #ruby
<dminuoso>
Daneel: Do you know how many software stacks revolve around provisioning, configuration management and monitoring of things, especially virtualization?
xaxisx has joined #ruby
rippa has joined #ruby
<Daneel>
and ?
joonty2 has joined #ruby
<dminuoso>
Daneel: That was just regarding my comment that you would be reinventing the wheel.
joonty1 has quit [Ping timeout: 260 seconds]
<dminuoso>
Daneel: Anyway. If you use the ruby bindings, you get to try out the "ruby way"
<Daneel>
i don't think i am reinventing the wheel so mutch
<Daneel>
it does not already exist a puppet module that forge a fact with pool listing
<zacts>
What kinds of questions should I be asking when designing objects? I feel I know the syntax of Ruby, and now I want to learn OOD, but the very very basics of OOD
raul782 has joined #ruby
<zacts>
I feel I'm at one step before poodr
<zacts>
I'm not quite ready for poodr, but if I learn the basic basics, I'll be ready for it
<zacts>
I know how to define a class, so now how do I _design_ one?
<dminuoso>
toretore: Exactly. The testcase provided rejects all falsey values, not just nil
<havenwood>
zacts: One threshold question is whether there's any internal state for an instance to instantiate and keep track of. If not, use a module, which is simpler than a class.
yupvr has quit [Ping timeout: 265 seconds]
lenwood has quit [Ping timeout: 260 seconds]
<bovis>
zacts: I forget who here pointed me to classes being like nouns and methods being the verbs (actions) those nouns can take. That may help with thinking about the issue.
jhack_ has quit [Quit: jhack_]
<toretore>
dminuoso: you mean this? `ary.collect { |e| e["x"] }.compact`
<havenwood>
zacts: I vote to give POODR a read, ready or not, and see what you glean from it!
<zacts>
oh neat! thanks, I will check out these links.
<zacts>
bovis: I see, cool
terens has joined #ruby
gusrub_ has quit [Remote host closed the connection]
<toretore>
also non-oop re hdd
elastix has joined #ruby
blaxter has joined #ruby
<toretore>
quite abstract
vondruch has quit [Ping timeout: 240 seconds]
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood>
True, true.
ciancio has quit [Quit: Page closed]
blaxter has quit [Remote host closed the connection]
<baweaver>
HDD being? (in a nutshell)
<havenwood>
baweaver: Think about your code (Hammock optional).
aufi has quit [Quit: Leaving]
<baweaver>
It's called planning though
<toretore>
yeah, he's basically just saying "think about your design", but in more better words
<baweaver>
no real need to introduce another acronym
blaxter has joined #ruby
<baweaver>
other than to coin terminology to try and look clever
<toretore>
baweaver: for the memeing masses it has to be put into a package with cool acronyms for them to accept it
gusrub_ has joined #ruby
<havenwood>
baweaver: If you start saying HDD though you put yourself in a better position to argue for a hammock at work.
<toretore>
to a lot of people it's obvious in a hard learned intuitive way, but not easily explained
tpendragon has joined #ruby
Silthias has joined #ruby
Rickmasta has quit [Ping timeout: 256 seconds]
<bovis>
No need for acronym hell. Thinking about your code is implied in all the other acronyms.
Silthias1 has quit [Ping timeout: 265 seconds]
<toretore>
no, it's not. it is mostly the opposite of tdd, for example
<baweaver>
You remember a time when you screwed up because you acted on impulse? Yeah, same with code. Don't do that. Think first, code later.
<toretore>
not the opposite, but very different
<havenwood>
bovis: Many of the DD acronyms seem to be an excuse to carve out time to think about the code.
XV8 has joined #ruby
raul782 has quit [Remote host closed the connection]
<baweaver>
You can make all the acronyms you want, but unless the code is done and working it's pointless.
marr has quit [Ping timeout: 260 seconds]
<bovis>
havenwood: I'm ok with thinking. I just work in a sea of acronyms and I'm probably bitter that you have to tell people to think before they act.
jhack_ has quit [Quit: jhack_]
<havenwood>
bovis: Yeah, thinking before writing is undervalued.
<baweaver>
Another novel idea: avoid hiring said people as anything other than juniors.
<toretore>
bovis: welcome to the real world
blaxter has quit [Remote host closed the connection]
<bovis>
toretore: I'm not much a fan.
jaguarmagenta has quit [Remote host closed the connection]
pawnbox has quit [Remote host closed the connection]
<havenwood>
zacts: Sandi Metz has some great talks on design and composition as well.
<toretore>
to be fair, afaik, nobody is throwing hdd around as an acronym of some magic process, it was just something we came up with right now to not type it out
VeryBewitching has joined #ruby
blackjid has joined #ruby
Beams has quit [Quit: .]
blackwind_123 has quit [Ping timeout: 250 seconds]
<baweaver>
just remember at the end of the day what matters is that the work is done.
maokomioko has joined #ruby
<baweaver>
The end user doesn't care one iota about which framework you use, what patterns, what anything
dnicole has joined #ruby
pawnbox has joined #ruby
<baweaver>
They only care if it works, and it works fast enough to not be annoying.
<toretore>
they will when it starts being unmaintainable and full of bugs
<baweaver>
They only notice the bugs
jmignault has quit [Ping timeout: 244 seconds]
<baweaver>
what I'm saying is take a step back from the ivory tower of design practices and remember what the end goal is
<careta>
I need to simulate the behaviour of a C cast from into to float in Ruby
<zacts>
havenwood: thanks
<careta>
so turning an integer into a single precision floating point number
<careta>
baweaver, that converts to double precision right?
whathappens has joined #ruby
* havenwood
looks forward to Integer in 2.4
<careta>
not single
SteenJobs has quit [Quit: SteenJobs]
<toretore>
baweaver: frankly, if your app doesn't contain at least 50% of the gof patterns i assume it's shit
<baweaver>
that's naive.
saslam has joined #ruby
<dminuoso>
havenwood: Honestly, what difference is Integer going to make realistically?
<baweaver>
and also we're veering fairly far offtopic.
aries_liuxueyang has quit [Quit: No Ping reply in 180 seconds.]
<baweaver>
#ruby-offtopic
SCHAAP137 has joined #ruby
<toretore>
i think it's on topic for a programming channel
<careta>
baweaver, if you do in C: int a = 57657717; printf("%f", (float)a); the result will be 57657716
blackwind_123 has joined #ruby
<careta>
it has to do with the ieee 754 floating point conversion rules
<havenwood>
dminuoso: New folk to Ruby have to deal with Fixnum/Bignum > Integer > Numeric and it's nice to obscure the implementation detail complexity of promotion
nofxx_ has joined #ruby
<careta>
using 57657717.to_f = 57657717
<careta>
I need to emulate that truncation, which is actually is the correct way to truncate floating point according to ieee 754
aries_liuxueyang has joined #ruby
SteenJobs has joined #ruby
<careta>
any bright ideas on how to do it, short of implementing a soft fp library in ruby, or embedding C code into the script?
railssmith has quit [Ping timeout: 240 seconds]
jmignault has joined #ruby
Snickers has joined #ruby
lenwood has joined #ruby
maokomioko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
yardenbar has joined #ruby
SteenJobs has quit [Client Quit]
splud has quit [Quit: splud]
blackwind_123 has quit [Ping timeout: 250 seconds]
<blackbombay>
havenwood: is that ever an issue in ruby though, i think it just works and never gets in your way..?
blackwind_123 has joined #ruby
jmignault has quit [Ping timeout: 240 seconds]
<havenwood>
blackbombay: just one less thing to explain, granted it's not a big deal but it's a nicety
<havenwood>
Integers and Rationals, pretend Floats don't exist. ;-)
<apeiros>
careta: given that ruby uses double, not float, you probably either need a native extension, or will have to implement the truncation algorithm
peteykun has joined #ruby
banisterfiend has joined #ruby
SteenJobs has joined #ruby
<careta>
apeiros, I suspected that - I was just hoping someone had implemented it and I could just copy paste from there
<havenwood>
n.modulo(1).zero? ? n : n.to_f
<havenwood>
err
* havenwood
goes in search of coffee
<apeiros>
careta: the native extension will probably be relatively easy to do, if it's an option.
jenrzzz has quit [Ping timeout: 268 seconds]
jblack has quit [Ping timeout: 260 seconds]
nankyokusei has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
loincloth has quit [Remote host closed the connection]
virgil has quit [Remote host closed the connection]
jackjackdripper has joined #ruby
nekcode has joined #ruby
loincloth has joined #ruby
blackwind_123 has quit [Ping timeout: 250 seconds]
blackwind_123 has joined #ruby
Puffball has quit [Quit: No Ping reply in 180 seconds.]
SteenJobs has quit [Quit: SteenJobs]
Puffball has joined #ruby
nankyokusei has quit [Ping timeout: 250 seconds]
loincloth has quit [Ping timeout: 250 seconds]
finisherr has joined #ruby
atmosx has joined #ruby
xall has quit [Ping timeout: 268 seconds]
jblack has joined #ruby
<careta>
apeiros, found it :) [number].pack("f").unpack("f*")
<careta>
works beautifully
codfection has quit [Remote host closed the connection]
<apeiros>
careta: oh, interesting idea
blackwind_123 has quit [Ping timeout: 250 seconds]
elaptics has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jphase has quit [Remote host closed the connection]
bayed has quit [Quit: Connection closed for inactivity]
jphase has joined #ruby
GodFather has quit [Quit: Ex-Chat]
GodFather has joined #ruby
tomphp_ has joined #ruby
tomphp has quit [Ping timeout: 240 seconds]
GodFather has quit [Read error: Connection reset by peer]
GodFather has joined #ruby
ddffg has joined #ruby
jeanlinux has quit [Remote host closed the connection]
e1z0_ has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
matheusmoreira has quit [Ping timeout: 265 seconds]
matheusmoreira has joined #ruby
jphase has quit [Ping timeout: 258 seconds]
SteenJobs has quit [Quit: SteenJobs]
jmignault has joined #ruby
jaruga___ has quit [Quit: jaruga___]
jhack_ has joined #ruby
jaruga____ has joined #ruby
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
jaruga____ is now known as jaruga___
SeepingN has joined #ruby
kriskropd has quit [Quit: WeeChat 0.4.2]
gusrub_ has quit [Remote host closed the connection]
rakm has joined #ruby
kriskropd has joined #ruby
loincloth has joined #ruby
jphase has joined #ruby
vuoto has quit [Remote host closed the connection]
Exuma has joined #ruby
SteenJobs has joined #ruby
Exuma_ has joined #ruby
charginghawk has joined #ruby
<balazs>
How do I pretty print some JSON ? Short of something like JSON.pretty_generate(JSON.parse(ugly_json))
dkphenom has joined #ruby
<charginghawk>
at my work, we've made a pretty simply command line utility in Ruby, based on the idea that Ruby comes installed by default so all our users can use it
ramfjord has joined #ruby
<balazs>
like jq ?
<charginghawk>
we're running into problems with the psych library, for parsing yaml
tomphp_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<balazs>
I see. I'm trying to do this inside of ruby
<dminuoso>
balazs: use pretty_print
<charginghawk>
some kind of version mismatch
govg has joined #ruby
<dminuoso>
balazs: i.e. "pp" - it comes with Ruby.
Exuma_ has quit [Client Quit]
<charginghawk>
is there a simpler way to parse yaml, so we don't get into library and version issues?
whathapp_ has joined #ruby
Exuma has quit [Client Quit]
<dminuoso>
charginghawk: Sounds more like a configuration management issue than a Ruby issue.
<charginghawk>
maybe I should use json instead of yml? is json support native to ruby?
mtkd has joined #ruby
blackwind_123 has quit [Ping timeout: 250 seconds]
<blackbombay>
yeah, but it's implemented in C as well. why don't you just fix your install? is it broken this way for everyone?
<toretore>
if you want something that works without relying on a correctly installed runtime, maybe you should use something that can compile static binaries like go or rust
jackjackdripper has quit [Quit: Leaving.]
xaxisx has joined #ruby
vuoto has quit [Remote host closed the connection]
jaruga___ has quit [Quit: jaruga___]
blackwind_123 has joined #ruby
<charginghawk>
blackbombay: it's broken this way for a few users, not all, and dminuoso linked to a conceptual fix to the problem, but it's been hard to translate conceptual fixes to step by step fixes
jaruga___ has joined #ruby
Devalo has quit [Ping timeout: 265 seconds]
<blackbombay>
a reinstall should work.
<charginghawk>
reinstalls are pretty messy
conta has quit [Ping timeout: 256 seconds]
<blackbombay>
how come? i did it only a few days ago after readline was upgraded.
<charginghawk>
I mean, y'all are ruby professionals - we are not
Devalo has joined #ruby
<blackbombay>
you are using rvm though, so it's just like rvm install X.Y.Z
<charginghawk>
using rvm = used rvm on a project 6 months ago, haven't used it sense, completely forgotten how to use it
<charginghawk>
it's installed, and maybe the system has been borked, but I don't want that to get in the way of people using our shiny new docker workflow
blackwind_123 has quit [Ping timeout: 250 seconds]
<blackbombay>
are those people using rvm too? you could remove rvm and just use the ruby OSX ships with.
blackwind_123 has joined #ruby
urbanmonk has joined #ruby
maddmaxx has joined #ruby
<toretore>
charginghawk: so you have a ruby script to help with your *docker* workflow. your ruby installations are broken. how could you easily provide everyone with exactly the same ruby env that doesn't rely on the state of their system?
raul782 has quit [Remote host closed the connection]
charginghawk has quit [Quit: Lost terminal]
charginghawk has joined #ruby
LoneHerm_ has joined #ruby
workmad3 has quit [Ping timeout: 256 seconds]
phantompain has joined #ruby
LoneHerm_ has quit [Remote host closed the connection]
symm- has joined #ruby
phantompain has quit [Client Quit]
raul782 has joined #ruby
saslam has quit [Ping timeout: 260 seconds]
Pisuke has joined #ruby
bikram has quit [Ping timeout: 246 seconds]
MyMind has quit [Ping timeout: 245 seconds]
tercenya has quit [Remote host closed the connection]
tercenya has joined #ruby
pawnbox has quit [Ping timeout: 246 seconds]
muelleme has quit [Ping timeout: 244 seconds]
bocaneri has quit [Remote host closed the connection]
blackwind_123 has quit [Ping timeout: 250 seconds]
csk has quit [Read error: Connection reset by peer]
Bounga has quit [Ping timeout: 260 seconds]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Trynemjoel has quit [Quit: Quitting]
Rickmasta has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
blackwind_123 has joined #ruby
j2k_ has joined #ruby
cyphase has quit [Ping timeout: 245 seconds]
lxsameer has quit [Quit: WeeChat 1.6]
symm- has quit [Ping timeout: 260 seconds]
Trynemjoel has joined #ruby
nicoulaj has joined #ruby
csk has joined #ruby
JeanCarloMachado has joined #ruby
Rickmasta has quit [Ping timeout: 246 seconds]
j2k has quit [Ping timeout: 244 seconds]
raul782 has quit [Remote host closed the connection]
claudiuinberlin has quit [Remote host closed the connection]
AndrewIsHere has joined #ruby
j2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marxarelli has joined #ruby
claudiuinberlin has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
blackwind_123 has quit [Ping timeout: 250 seconds]
cyphase has joined #ruby
jenrzzz has quit [Ping timeout: 244 seconds]
blackwind_123 has joined #ruby
symm- has joined #ruby
zoo-zed has quit [Ping timeout: 256 seconds]
jmignault has quit [Remote host closed the connection]
zoo-zed has joined #ruby
pawnbox has joined #ruby
conta has joined #ruby
TheWhip has joined #ruby
sparch has quit [Ping timeout: 260 seconds]
nadir has joined #ruby
rwb has joined #ruby
blackwind_123 has quit [Ping timeout: 250 seconds]
kirun has joined #ruby
xrlk has joined #ruby
jhack_ has quit [Quit: jhack_]
brendan- has joined #ruby
ur5us has joined #ruby
minimalism has quit [Quit: minimalism]
firstdayonthejob has quit [Quit: WeeChat 1.6]
rwb has quit [Ping timeout: 260 seconds]
whathapp_ has quit [Remote host closed the connection]
SteenJobs has quit [Quit: SteenJobs]
nankyokusei has joined #ruby
aegis3121 has joined #ruby
lenwood has joined #ruby
firstdayonthejob has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
ur5us has quit [Ping timeout: 260 seconds]
urbanmonk has quit [Quit: urbanmonk]
AndrewIsHere has quit []
johnmilton has quit [Remote host closed the connection]
<charginghawk>
so, homebrew uses a lot of ruby
<charginghawk>
if I misinstall ruby on my system, would that break homebrew, or do they have a way of circumventing that?
<charginghawk>
maybe by invoking the default ruby installed on mac
blackwind_123 has joined #ruby
ur5us has joined #ruby
hightower3 has joined #ruby
nankyokusei has quit [Ping timeout: 252 seconds]
nahra has joined #ruby
hightower2 has quit [Ping timeout: 260 seconds]
UserOO7 has quit []
allcentury has joined #ruby
marr has joined #ruby
blackwind_123 has quit [Ping timeout: 250 seconds]
<DLSteve>
charginghawk, Should never touch the system version of ruby on macOS. It is not a standard version and can break a lot of things if modified.
<charginghawk>
don't wanna change or modify, just use instead whatever a user might've installed using rvm or something
<DLSteve>
charginghawk, in that case it depends on the versions that are in your $PATH and what order they are loaded.
blackwind_123 has joined #ruby
<charginghawk>
I guess there's no way at the application level to specify a given $PATH/version
blackwind_123 has quit [Client Quit]
blackwind_123 has joined #ruby
allcentury has quit [Ping timeout: 250 seconds]
jaruga___ has quit [Quit: jaruga___]
lenwood has quit [Ping timeout: 258 seconds]
hightower2 has joined #ruby
millerti has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
moneylotion has left #ruby ["Leaving..."]
brendan- has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
Savage has quit [Quit: Connection closed for inactivity]
blackwind_123 has quit [Ping timeout: 245 seconds]
UserOO7 has joined #ruby
hightower3 has quit [Ping timeout: 260 seconds]
blackwind_123 has joined #ruby
Devalo has quit [Remote host closed the connection]
elastix has quit [Quit: Leaving]
SteenJobs has joined #ruby
UserOO7 has quit [Ping timeout: 260 seconds]
chopin has quit [Ping timeout: 260 seconds]
Bounga has joined #ruby
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
roychri has joined #ruby
conta has quit [Ping timeout: 256 seconds]
jackjackdripper has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
joallard has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper1 has joined #ruby
blackwind_123 has quit [Ping timeout: 250 seconds]
kirun_ has joined #ruby
pragmaticus has quit [Ping timeout: 250 seconds]
claudiuinberlin has quit []
kirun has quit [Ping timeout: 258 seconds]
railssmith has joined #ruby
Madplatypus has joined #ruby
SteenJobs has quit [Ping timeout: 245 seconds]
phwelo_ has joined #ruby
p0wn3d has joined #ruby
lenwood has joined #ruby
Dimik has joined #ruby
chrisja has joined #ruby
phwelo has quit [Ping timeout: 260 seconds]
_djbkd has quit [Remote host closed the connection]
Derperperd has joined #ruby
_djbkd has joined #ruby
mikecmpbll has joined #ruby
ta_ has joined #ruby
millerti has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
phwelo_ has quit [Ping timeout: 248 seconds]
millerti has quit [Max SendQ exceeded]
conta has joined #ruby
_djbkd has quit [Ping timeout: 256 seconds]
<havenwood>
charginghawk: You can indeed just prepend the dir of the desired Ruby to your PATH and correctly set GEM_HOME, GEM_PATH and other env vars or that's exactly what chruby does: https://github.com/postmodern/chruby#readme
<havenwood>
charginghawk: RVM and rbenv are alternative Ruby version switchers to chruby.
<havenwood>
charginghawk: MacOS ships with a system Ruby. Additional Rubies installed through brew, ruby-install, ruby-build, RVM or built from source don't mess with your system Ruby.
jhack_ has joined #ruby
<havenwood>
charginghawk: If you're using RVM you can set a default Ruby or switch back to your system Ruby easily. Check the RVM docs.
<havenwood>
charginghawk: Homebrew won't break based on Rubies you install.
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
quazimodo has joined #ruby
<charginghawk>
havenwood: so I prepend #!/System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby to my script, it'
<charginghawk>
ll invoke system ruby?
tvw has joined #ruby
<havenwood>
well, that's a shebang
<havenwood>
charginghawk: if you run: /System/Library/Frameworks/Ruby.framework/Versions/Current/usr/bin/ruby
<havenwood>
that's ^ system Ruby
<blackbom1>
charginghawk: if you keep avoiding the obvious and root cause of all your issues i think in the long run it'll only hurt even more.
<domgetter>
charginghawk: is this for a professional dev/production environment?
<domgetter>
If it's for learning or for school, then I'd say it doesn't matter
<bovis>
Does anyone here use flog to get a measure of how complex their apps are? If I get an average score of 7 and high score of 30, should I be happy with that? Or is this an infinitely-"It Depends" kind of question?
definity has joined #ruby
joallard has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rwb has joined #ruby
jackjackdripper1 has quit [Quit: Leaving.]
jackjackdripper has joined #ruby
<charginghawk>
I mean, if using system ruby is good enough for homebrew, I'm sure it's good enough for my dinky cli
enterprisey has quit [Remote host closed the connection]
kirun_ has quit [Quit: Konversation terminated!]
benlieb has quit [Quit: benlieb]
<pilne>
besides having to brush up and get a little better with "R" (which really isn't a disadvantage IMHO), are there any major downsides of using R for the data wrangling and Ruby for everything else (mining/scrubbing/serving to end user)?
chopin has quit [Remote host closed the connection]
chopin has joined #ruby
<pilne>
I'm reading "Exploring Everyday Things With R and Ruby" and it seems like a rather elegant solution
<baweaver>
Honestly I would use Python in conjunction with R
<baweaver>
I've read the same book.
<baweaver>
Most of the Ruby to R adapters are a bit stale, and Python excels in data science areas.
<pilne>
I constantly run into this issue when i try and step outside of webdev with ruby, and it kinda saddens me, I have no hate for python, i just like ruby a whole lot more
<baweaver>
Same with me.
<baweaver>
I just know that most of the tooling is in Python for that.
<baweaver>
Ruby gets some love, don't get me wrong
<bovis>
why does Python have an advantage in data science? what does ruby lack?
<baweaver>
SciRuby and some other tools are definitely viable.
<pilne>
bovis=> libraries
<baweaver>
pretty much
<baweaver>
A huge swath of orgs are using Python for it, so all the libraries they make are written in it as well
<pilne>
plus the whole 2/3 pythong schism annoys the crap outta me
<pilne>
it's been what.... 5 revisions, almost 6?
<baweaver>
Yeah, that thing....
<baweaver>
It's a mess.
<pilne>
and there is still legacy crufty-ass junk
[Butch] has quit [Ping timeout: 246 seconds]
<baweaver>
Honestly though if you want to use Ruby, do it.
<baweaver>
You might even be able to help pull some of the tooling back up as well.
maokomioko has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<baweaver>
Also, Ruby tends to major in Web Dev and System Administration.
<pilne>
if i make breakthroughs/improvements i will
<baweaver>
Chef and friends use it quite a bit.
<baweaver>
and we use Ruby for almost all automation
<pilne>
python is just so rigid and "frigid" i can see how some might like that, but i was always that kid who came up with a different way to come to the same conclusion
<baweaver>
If you find yourself really stuck, Scala is also an option with full access to the JVM
<pilne>
pissed off my c++ and java instructors to no end when i tried to do things that weren't the "accepted way"
<baweaver>
Scala and Ruby both tend to be fairly off those rails.
<pilne>
i've toyed with scala some, but most of my projects don't need the jvm, and even then i'm kinda inclined towards jruby
<baweaver>
Fair.
<pilne>
ruby just feels natural, i "get" python/java/scala, but it is more like me learning it, rather than just using and understanding it
<pilne>
but then again, i love lisps/schemes and haskell as well lol.
<pilne>
maybe why's poignant being my first intro to ruby years ago has colored my coding glasses in a certain way :)
Fuzai_ has joined #ruby
hightower2 has joined #ruby
Fuzai has quit [Ping timeout: 258 seconds]
rakm has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
quazimodo has quit [Ping timeout: 250 seconds]
Bounga has joined #ruby
kafloopascope has joined #ruby
allcentury has quit [Ping timeout: 245 seconds]
<centrx>
pilne: I use RSRuby with R, using the custora repo (fixes some bugs)
<kafloopascope>
does anyone know offhand how to get mysql2 to install with mariadb, on debian (jessie)?
skweek has joined #ruby
Tristan-Speccy has joined #ruby
<pilne>
centrx=> tyvm :) bookmarked
gusrub_ has quit []
<centrx>
pilne: RinRuby is much much slower than RSRuby. RSRuby uses the R C API directly (or executable, or something like that), but it can encounter some issues because of that fact
Tristan-Speccy is now known as Guest68124
bgray has joined #ruby
chopin has quit [Remote host closed the connection]
<pilne>
so basically, try it with RSRuby first, and if it assplodes for no good reason, resort to RinRuby or dig deep?
chopin has joined #ruby
gusrub_ has joined #ruby
<centrx>
pilne: I've just stuck with RSRuby. It actually only seems to break when there is something wrong with the data, but it doesn't really help you find out what's wrong with the data
<pilne>
gotcha, so scrub good, scrub well, and know your data :)
Bounga has quit [Ping timeout: 260 seconds]
chwbacca has joined #ruby
<pilne>
how is SciRuby seems a bit dormant, I know this isn't bad, as there isn't much "evolution" to a library like that once it gets stable and good
<pilne>
there should be a comma after SciRuby >.<
nunchuck has quit [Read error: Connection reset by peer]
<centrx>
I've never used SciRuby
ramfjord has joined #ruby
<centrx>
pilne: It looks like it has had some commits in 2016, so it's not totally dormant, someone has been on top of it
charginghawk has quit [Quit: Lost terminal]
chwbacca has quit [Read error: Connection reset by peer]
Rickmasta has joined #ruby
j2k has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
j2k has joined #ruby
j2k has quit [Client Quit]
ddffg has quit [Ping timeout: 265 seconds]
benlieb has joined #ruby
aegis3121 has quit [Ping timeout: 240 seconds]
davidt has joined #ruby
ramfjord_ has quit [Ping timeout: 256 seconds]
maddmaxx has quit [Quit: Going offline, see ya! (www.adiirc.com)]
<pilne>
nice, i tend to do dev ops/webdev professionally, but i have a love for data science, the things you can find with it are just fun to me
rfoust has joined #ruby
<pilne>
that and i've always wanted to write a game with a really "smart" ai that does a lot of "thinking" in odd mathematical ways to make it's decisions
fatbob has quit [Ping timeout: 265 seconds]
<pilne>
like a texas holdem "bot" player that sometimes does "irrational" things, but not in a predictable way
rakm has joined #ruby
Fernando-Basso has joined #ruby
machinewar has quit []
wpostma has quit [Quit: WeeChat 1.3]
FernandoBasso has quit [Quit: WeeChat 1.6]
hightower3 has joined #ruby
d3d1rty has joined #ruby
rwb has quit [Ping timeout: 250 seconds]
Ishido has quit [Remote host closed the connection]
gingray has quit [Ping timeout: 260 seconds]
marxarelli has quit [Read error: Connection reset by peer]
hightower2 has quit [Ping timeout: 240 seconds]
nettoweb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
raul782 has joined #ruby
bovis has quit [Quit: leaving]
Jackneill_ has quit [Ping timeout: 256 seconds]
benlieb has quit [Quit: benlieb]
peteykun has quit [Ping timeout: 244 seconds]
whathappens has joined #ruby
centrx has quit [Remote host closed the connection]
quazimodo has joined #ruby
Terra has joined #ruby
modin has quit [Ping timeout: 246 seconds]
<Terra>
Hi
<Terra>
I seem to be missing quite a few gems... Does rake natively come with the latest build of ruby?
<Terra>
I'm trying to enter commands in shell and rvm, rake, ri, etc don't seem to be installed / functioning
dmtd has quit [Quit: Connection closed for inactivity]
fatbob has joined #ruby
modin has joined #ruby
<Terra>
it seems counter productive to have to install each new command I try to use :/
blackbom1 has quit [Read error: Connection reset by peer]
blackbombay has joined #ruby
banisterfiend has quit [Excess Flood]
<pilne>
rvm doesn't include anything
<pilne>
ruby doesn't include rake either
guacamole has quit [Quit: leaving]
centrx has joined #ruby
<pilne>
ruby is just a scripting language/interpreter, rake (and friends) are tools used by it, not part of it per-say.
guacamole has joined #ruby
minimalism has joined #ruby
mBailey_j has joined #ruby
<Terra>
anyone have an issue with gem install command through shell?