<dionysus69>
rubocop tells me not to use inline rescue nil
<dionysus69>
just curious why, I am avoiding just one potential failure here
vondruch has quit [Client Quit]
vondruch has joined #ruby
jottr has joined #ruby
workmad3 has joined #ruby
CrazyEddy has quit [Remote host closed the connection]
CrazyEddy has joined #ruby
workmad3 has quit [Ping timeout: 240 seconds]
atmosx has joined #ruby
<matthewd>
dionysus69: There are a lot of things that could go wrong in that expression, and you're rescuing all of them
marr has joined #ruby
<dionysus69>
ok I got it thanks :)
<matthewd>
dionysus69: That's not necessarily a bad thing to do -- but I think rubocop's opinion is that if you're going to do that, it's worth a begin/rescue/end block, and not just an afterthought on the end of the line
postmodern has joined #ruby
tomphp has joined #ruby
<dminuoso>
Also keep in mind, that by using `rescue nil` you are effectively forced to check whether what you have gotten is nil anyway.
<dminuoso>
And suddenly error handling has turned into nil handling, hiding whats going on.
<dminuoso>
I'd rather have `begin; rescue; end` than a sudden myriad of &.
<waveprop>
i wrote a method called .str_or_regexp? which returs true if called on a string and false if called on a regexp. if self is niether string or regexp, i want to raise an error. Would it be better to just test twice, with .is_a? string and .is_a? regexp ?
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
nahra has joined #ruby
apeiros has quit [Ping timeout: 264 seconds]
mn3m has joined #ruby
Technodrome has joined #ruby
ldnunes has joined #ruby
apeiros has joined #ruby
banisterfiend has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
hogetaro has quit [Quit: Leaving...]
shinnya has quit [Ping timeout: 255 seconds]
rahul_bajaj has quit [Quit: Leaving]
blackmesa has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mia has quit [Read error: Connection reset by peer]
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
blackmesa has quit [Ping timeout: 255 seconds]
csk157 has joined #ruby
blackmesa has joined #ruby
jottr has joined #ruby
moei has quit [Ping timeout: 255 seconds]
csk157 has quit [Ping timeout: 255 seconds]
tvw has joined #ruby
cdg has quit [Remote host closed the connection]
banisterfiend has joined #ruby
apeiros has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
jottr has quit [Ping timeout: 260 seconds]
coderphive has quit [Ping timeout: 248 seconds]
coderphive has joined #ruby
alex`` has quit [Ping timeout: 246 seconds]
catphish has joined #ruby
<catphish>
is there a use case for rescue/else? i just found it and it seems absurd
halt has quit [Ping timeout: 240 seconds]
halt has joined #ruby
apeiros has joined #ruby
<canton7>
catphish, sure. When you want to do "try operation A. If it succeeds, do operation B. If it fails, do this recovery. If operation B fails, don't try and recover"
<canton7>
you could just put operations A and B in the same block with the same 'rescue' statements, but then A's error handling also applies to B
<catphish>
ah i see, makes sense if you're rescuing everything and don't want another wrapper
blackmesa has quit [Ping timeout: 255 seconds]
moei has joined #ruby
tcopeland has joined #ruby
cgfbee has joined #ruby
sionronin has joined #ruby
apeiros has quit [Ping timeout: 248 seconds]
jphase has joined #ruby
Burgestrand has quit [Quit: Closing time!]
jphase_ has joined #ruby
synthroid has joined #ruby
jphase has quit [Ping timeout: 240 seconds]
infernix has quit [Ping timeout: 258 seconds]
apeiros has joined #ruby
apparition has joined #ruby
skawa has joined #ruby
<skawa>
i want to install ruby 2.2.6, but rbenv doesn't show that it can install that version. it shows that i can install 2.2.2 and 2.3.0-dev
jphase_ has quit [Remote host closed the connection]
<skawa>
it actually shows 2.3.0-dev as being the latest. it should be showing at least 2.4.0, yea ?
apeiros has quit [Ping timeout: 240 seconds]
<skawa>
brew upgrade ruby-build doesn't change the list of available versions at all
jphase has joined #ruby
<matthewd>
skawa: My guess would be you have ruby-build installed locally in ~/.rbenv, and that's being used in preference to the brew installed version
<matthewd>
Oh, you have ruby-build HEAD installed, not a released version
csk157 has joined #ruby
jphase has quit [Ping timeout: 255 seconds]
cabotto has quit []
<matthewd>
brew upgrade won't automatically get a newer revision of HEAD, IIRC.. you have to force it
coderphive has quit [Ping timeout: 240 seconds]
brendan- has joined #ruby
apeiros has joined #ruby
coderphive has joined #ruby
jphase_ has quit [Ping timeout: 255 seconds]
<matthewd>
(or just uninstall it and go back to numbered releases, assuming whatever you went to head for is now published)
conta has quit [Quit: conta]
alnewkirk has joined #ruby
charliesome has joined #ruby
jphase has joined #ruby
csk157 has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<skawa>
matthewd: that's better. thanks
apeiros has quit [Ping timeout: 240 seconds]
rabajaj has joined #ruby
jphase has quit [Ping timeout: 255 seconds]
jenrzzz has quit [Ping timeout: 255 seconds]
conta has joined #ruby
gnufied has joined #ruby
apeiros has joined #ruby
cschneid_ has joined #ruby
rabajaj has quit [Remote host closed the connection]
mson has joined #ruby
apeiros has quit [Ping timeout: 248 seconds]
banisterfiend has quit [Changing host]
banisterfiend has joined #ruby
cschneid_ has quit [Ping timeout: 252 seconds]
nertzy2 has joined #ruby
cadillac_ has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
tlaxkit has joined #ruby
apeiros has joined #ruby
nertzy has quit [Ping timeout: 260 seconds]
tsglove has quit [Ping timeout: 246 seconds]
apeiros has quit [Ping timeout: 240 seconds]
milardovich has quit []
tastytf has quit [Ping timeout: 260 seconds]
shinnya has joined #ruby
tvw has quit [Ping timeout: 255 seconds]
charliesome has quit [Ping timeout: 260 seconds]
milardovich has joined #ruby
jottr has joined #ruby
Psybur has joined #ruby
jphase has joined #ruby
TvL2386_ has joined #ruby
jphase has quit [Remote host closed the connection]
jphase has joined #ruby
TvL2386 has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
apeiros has joined #ruby
cgfbee has quit [Read error: No route to host]
s2013 has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
s2013 has quit [Client Quit]
s2013 has joined #ruby
Hexafox[I] has joined #ruby
<Hexafox[I]>
HI
nertzy3 has joined #ruby
nertzy2 has quit [Ping timeout: 240 seconds]
<Hexafox[I]>
Ruby has basic multithreading support right? I was just wondering if it would be possible to create a new thread, put it in an infinite loop and have it sleep for a few minutes after each loop run.
apeiros has quit [Ping timeout: 240 seconds]
<dminuoso>
Hexafox[I]: Ruby has not just basic multithreading support, it has full native threads.
jameser has joined #ruby
<dminuoso>
With just a little twist called the GVL.
<dminuoso>
Which essentially gives you concurrency, but not necessarily parallelism.
<matthewd>
Hexafox[I]: Yes, you can do that.
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<Hexafox[I]>
dminuoso, What does that mean?
ledestin has joined #ruby
<dminuoso>
Hexafox[I]: It's generally not possible for two threads to be executing ruby code at the same time. If you just need the behavior of two threads overlapping, you're good. If you mean to process data in parallel, you have to either use processes or JRuby.
cdg has joined #ruby
jordanm has joined #ruby
ledestin has quit [Ping timeout: 240 seconds]
rabajaj has joined #ruby
knightblader has joined #ruby
<Hexafox[I]>
The threads will hardly be doing anything, I just want one watching a chat room for messages and anther one grabbing a RSS feed every few minutes.
<Hexafox[I]>
So if I sleep one the other one can continue uninterrupted?
<dminuoso>
Absolutely yes.
dionysus69 has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
knight33 has joined #ruby
Burgestrand has joined #ruby
alfiemax_ has joined #ruby
eblip has quit [Read error: Connection reset by peer]
<matthewd>
They'll run concurrently even without any explicit sleeping
eb0t has quit [Ping timeout: 246 seconds]
alfiemax has quit [Ping timeout: 260 seconds]
hexchat_ has joined #ruby
hexchat_ has quit [Client Quit]
sightes has joined #ruby
impermanence13 has joined #ruby
<impermanence13>
What is the ruby way to iterate over a string char-by-char and mutate specific chars on match? Are there particular String functions I should use?
tlaxkit has quit [Ping timeout: 248 seconds]
<havenwood>
impermanence13: It depends on what you're doing. What's the mutation? Look at #gsub, #tr and #each_char/#map/#join.
<matthewd>
impermanence13: What do you want to do?
thomasv314 has joined #ruby
<mtkd>
.map { |x| new_char if x == match_char }
<mtkd>
something like that?
sepp2k has joined #ruby
<impermanence13>
yes. multiple different chars.
<mtkd>
maybe map with a case else?
<impermanence13>
I am asking because I guess I would just iterate over the string against a case statement. But then I wondered if there were some nice wrapper methods Ruby offered to do so.
<matthewd>
As havenwood said, there are a lot of related-but-distinct options. You'll need to be more specific about what your string / replacements look like for more idiomatic advice.
<mtkd>
looks like .gsub takes multiple
<impermanence13>
matthewd: one sec.
aupadhye has quit [Ping timeout: 240 seconds]
<impermanence13>
"GGCTTAA" => "CCGAAU" so G => C, C => G, T => A, A => U. That's it. I know how I would do it, but was just curious if there was a sexy Ruby way, honestly. Maybe gsub...
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<impermanence13>
But see, that's why I want to ask...because in this case...it's almost like just using plain iteration and a case is all that would happening under the hood anyway
<matthewd>
impermanence13: Right -- and thus the need for a specific question: it's a perfect method.. for a fairly narrow use case
<elomatreb>
The main benefit of the built-in methods like #tr over manual iteration is that the former are implemented in native C, and thus usually much faster than the manual iterator code would be, even if it does the same in concept
jrafanie has joined #ruby
Rapture has joined #ruby
<impermanence13>
elomatreb: ha, see that's why I thought to come here and ask. bc that was mainly what was on my mind.
<impermanence13>
tr is literally exactly what I was looking for, dang.
<impermanence13>
small tangent: is there a way to require two classes from one module in one "require" line?
<elomatreb>
If you really want you can do something like `%w[module/class1 module/class2].each {|c| require c }`
danielg__ has joined #ruby
<elomatreb>
But usually people just have the two lines, or require the entire module
<impermanence13>
k
<Hexafox[I]>
what does it mean when a class has both the methods `run()` and `self.run()`? Which one gets used?
<elomatreb>
The first one is an instance method, the latter a class/module method
<elomatreb>
I.e. `Class.new.run` is the first, `Class.run` is the second
<Hexafox[I]>
Never heard of an instance method before. Will have to look that up. But yeah that matches exactly how it's used in this code.
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
alfiemax_ has quit [Remote host closed the connection]
alfiemax has joined #ruby
John___ has joined #ruby
<impermanence13>
What is the best way to check if a string is made up of only a specific set of characters? in other words, I need to check if a string only contains As, Ts, Cs and Gs. If not then "false
<impermanence13>
"false"
eb0t has joined #ruby
<impermanence13>
I think maybe there is a slick way I can use tr?
milardovich has quit [Ping timeout: 240 seconds]
<ccooke>
You're probably best off using a regex
<havenwood>
impermanence13: What version of Ruby?
<havenwood>
(Not #tr.)
<impermanence13>
2.4.1p111
alfiemax has quit [Ping timeout: 240 seconds]
<ccooke>
impermanence13: when you say "best way", what are you trying to optimise for? Speed? Readability? Maintainability?
<dminuoso>
cagomez: Two things. Please use the . on the next line, if you want to use multiple lines for chaining
impermanence has quit [Remote host closed the connection]
<dminuoso>
Secondly, you can use []= to set an identifier ending in ?
impermanence has joined #ruby
<dminuoso>
Also note that this does not *define a method*
eblip has joined #ruby
<cagomez>
dminuoso: 1) sorry, that's the way my rubocop is setup. i thought that was convention. 2) what is the syntax or docs for this? Ive never seen that before 3) what is this doing? I just want to return a simple value
jrafanie_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<matthewd>
I think I mostly just dislike the ambiguity, being unable to tell whether the expression ends on the line I'm looking at
<matthewd>
i.e., the same reason I'm pro-semicolons in JS
tsglove3 has quit [Ping timeout: 252 seconds]
<dminuoso>
matthewd: Well to me the indention on the next line gives an immediate visual clue. Looking at discussions on the ruby style guides there seem to be a bunch of arguments for both sides.
<dminuoso>
But I can see the benefit of being able to comment in between.
<dminuoso>
Though I do think if you have the need to comment in between that, there might be something questionable about your code.
orbyt_ has joined #ruby
<dminuoso>
But I do mean this as a smell that could entirely be justified.
cdg_ has joined #ruby
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
eckhardt has joined #ruby
<matthewd>
Personally I'd generally avoid chaining enough for it to matter... but the new-hotness wisdom seems to be that if your method is more than a single chain of calls, you're basically drowning kittens -- at that point, comments do seem potentially relevant
<dminuoso>
This style has become quite predominant in my code ever since I started Haskell..
blackmesa has joined #ruby
<Papierkorb>
dminuoso: I didn't need haskell to do it basically like that *hides*
<Papierkorb>
No really, how else would one do that?
<matthewd>
The rest I can live with, but the camelcase is killing me :P
<Papierkorb>
^
<dminuoso>
matthewd: Heh, I've seen you making these remarks about my code a few times now. ;-)
<dminuoso>
Call it JS/Haskellism
<dminuoso>
Just cant help it :(
alnewkirk has quit [Ping timeout: 240 seconds]
<matthewd>
I'd complain just as much about JS with underscores, if that's any consolation ;)
alnewkirk has joined #ruby
<matthewd>
It's the fact that core/stdlib methods are spelled one way and app methods are the other, that gets me
<dminuoso>
matthewd: For a while this was a serious problem when I started writing a React frontend with a transparent middleware that baked the JSON:API data from the rails into redux.
<dminuoso>
matthewd: It basically infested JS with Rails world underscores from attributes.
apeiros has quit [Ping timeout: 240 seconds]
<dminuoso>
You had this user(1).email_address shenanigans everywhere. :(
nahra has quit [Remote host closed the connection]
<dminuoso>
Or I did rather.
<matthewd>
Yeah. In my head-canon, JSON is JS and should therefore be camelcase, just as HTML/XML should be kebab-case. But all that translation can be problematic too.
guacamole has joined #ruby
<dminuoso>
matthewd: I think to a degree the reason to avoid underscores in Haskell stems from the fact that there's so many operators, so apart from "'" which is mathematically well understood to just read "a prime" for "a'", characters have meaning.
<dminuoso>
But then again just like in Ruby identifiers can have UTF8 characters...
<matthewd>
Isn't the Haskell stdlib camelcase?
<dminuoso>
matthewd: yup.
dviola has joined #ruby
<dminuoso>
Though they make liberal usage of things like foo = ..., foo' = ..., foo'' = ...
<matthewd>
Right, so that's what you should use too™
ldnunes has quit [Ping timeout: 264 seconds]
hahuang65 has joined #ruby
Immune has joined #ruby
apeiros has joined #ruby
sysvalve has quit [Quit: Leaving]
guille-moe has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
tsglove3 has joined #ruby
cdg_ has quit [Remote host closed the connection]
LocaMocha has joined #ruby
Technodrome has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
milardovich has quit [Remote host closed the connection]
tsglove2 has quit [Ping timeout: 240 seconds]
conta has joined #ruby
SeepingN has joined #ruby
ldnunes has joined #ruby
Technodrome has joined #ruby
tsglove2 has joined #ruby
TomyWork has quit [Remote host closed the connection]
conta has quit [Ping timeout: 252 seconds]
tomphp has joined #ruby
tsglove3 has quit [Ping timeout: 240 seconds]
csk157 has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Serpent7776 has quit [Quit: Leaving]
APag96 has joined #ruby
ledestin has joined #ruby
anisha has quit [Read error: Connection reset by peer]
csk157 has quit [Ping timeout: 248 seconds]
alex`` has joined #ruby
tsglove3 has joined #ruby
mostlybadfly has quit [Quit: Connection closed for inactivity]
guacamol_ has joined #ruby
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
<APag96>
Hello all! I'm having some issues with making HTTP requests. I'm trying to change the 'host' header for the request. This would be useful in making requests to vhosts that don't have DNS set up. In this code, I'm requesting the 'test.com' vhost on 192.241.XX.XX Here's my code: https://pastebin.com/Fn76R3Yi I'm running 'nc -l 80' on the IP and see that the 'Host' header is '192.241.XX.XX' and not 'test.com', like it should be. Thanks f
troulouliou_dev has quit [Ping timeout: 255 seconds]
tsglove2 has quit [Ping timeout: 252 seconds]
doublemalt_ has quit [Ping timeout: 248 seconds]
alfiemax has joined #ruby
cagomez has joined #ruby
ams__ has joined #ruby
milardovich has joined #ruby
mn3m has quit [Ping timeout: 240 seconds]
orbyt_ has joined #ruby
troulouliou_dev has joined #ruby
cdg has quit [Remote host closed the connection]
jxv has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<banisterfiend>
anyone here familiar with autotools?
cdg has joined #ruby
cdg has quit [Remote host closed the connection]
nofxx has quit [Ping timeout: 255 seconds]
cdg has joined #ruby
mikecmpbll has joined #ruby
troys_ is now known as troys
nofxx has joined #ruby
ShekharReddy has quit [Quit: Connection closed for inactivity]
s2013 has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
nofxx has quit [Read error: Connection reset by peer]
<dminuoso>
banisterfiend: Might I also suggest #osdev ?
<dminuoso>
Some of them are autotools users.
<dostoyevsky>
Too many interesting channels...
jxv has joined #ruby
conta1 has joined #ruby
imode has joined #ruby
alnewkirk has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
dionysus69 has joined #ruby
unreal has quit [Quit: Very funny Scotty. Now beam down my clothes!]
jenrzzz has quit [Ping timeout: 246 seconds]
br0d1n has quit [Quit: Leaving]
goyox86_ has joined #ruby
alfiemax has quit [Remote host closed the connection]
alnewkirk has joined #ruby
tsglove2 has joined #ruby
mjolnird has quit [Quit: Leaving]
mostlybadfly has joined #ruby
tsglove3 has quit [Ping timeout: 248 seconds]
tomphp has joined #ruby
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has quit [Client Quit]
alfiemax has joined #ruby
cschnei__ has quit [Remote host closed the connection]
mn3m has joined #ruby
guacamole has joined #ruby
tomphp has joined #ruby
tsglove3 has joined #ruby
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
blackmesa1 has joined #ruby
blackmesa1 has quit [Client Quit]
tsglove2 has quit [Ping timeout: 248 seconds]
alfiemax has quit [Ping timeout: 264 seconds]
blackmesa has quit [Ping timeout: 255 seconds]
s2013 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
FrostCandy has joined #ruby
csk157 has joined #ruby
milardovich has quit [Ping timeout: 260 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
knightblader has quit [Ping timeout: 252 seconds]
guacamole has joined #ruby
waveprop has quit [Ping timeout: 248 seconds]
waveprop has joined #ruby
waveprop is now known as Guest72603
alnewkirk has quit [Ping timeout: 264 seconds]
troulouliou_dev has quit [Quit: Leaving]
alnewkirk has joined #ruby
APag96 has quit [Ping timeout: 260 seconds]
knightblader has joined #ruby
NikolausK has joined #ruby
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
workmad3 has quit [Ping timeout: 240 seconds]
conta1 has quit [Ping timeout: 240 seconds]
alnewkirk has quit [Ping timeout: 248 seconds]
d5sx43 has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ElDoggo has joined #ruby
ldnunes has quit [Quit: Leaving]
nahra has joined #ruby
dionysus69 has quit [Ping timeout: 248 seconds]
Ltem has joined #ruby
jrafanie has joined #ruby
gheegh has joined #ruby
dionysus69 has joined #ruby
tomphp has joined #ruby
jaequery has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tomphp has quit [Client Quit]
knight33 has joined #ruby
hahuang65 has quit [Quit: WeeChat 1.9.1]
jaequery has joined #ruby
jaequery has quit [Client Quit]
Quentinius has joined #ruby
jaequery has joined #ruby
jaequery has quit [Client Quit]
jaequery has joined #ruby
jaequery has quit [Client Quit]
jaequery has joined #ruby
whippythellama has quit [Ping timeout: 246 seconds]
jaequery has quit [Client Quit]
Quentinius has quit [Client Quit]
jaequery has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
cagomez has quit [Remote host closed the connection]
troys is now known as troys_
jaequery has quit [Ping timeout: 246 seconds]
tsglove3 has quit [Read error: Connection reset by peer]
tsglove3 has joined #ruby
jenrzzz has joined #ruby
infernix has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
shinnya has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
knight33 has joined #ruby
milardovich has joined #ruby
knight33 has quit [Read error: Connection reset by peer]
Dimik has joined #ruby
whippythellama has joined #ruby
tomphp has joined #ruby
dinfuehr has quit [Ping timeout: 252 seconds]
milardovich has quit [Remote host closed the connection]
jenrzzz_ has joined #ruby
s2013 has joined #ruby
ta has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
jrafanie has joined #ruby
dinfuehr has joined #ruby
jenrzzz has quit [Ping timeout: 264 seconds]
duckpuppy has quit [Ping timeout: 240 seconds]
alnewkirk has joined #ruby
cdg has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
vipaca has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
goyox86_ has quit [Quit: goyox86_]
cdg has quit [Ping timeout: 248 seconds]
ur5us has quit [Ping timeout: 240 seconds]
s2013 has quit [Ping timeout: 260 seconds]
goyox86_ has joined #ruby
guacamol_ has joined #ruby
troys_ is now known as troys
alnewkir1 has joined #ruby
synthroi_ has joined #ruby
alnewkirk has quit [Ping timeout: 258 seconds]
vipaca has joined #ruby
bitcycle has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
synthroid has quit [Ping timeout: 240 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
tsglove2 has joined #ruby
tsglove3 has quit [Ping timeout: 248 seconds]
nowhere_man has joined #ruby
aphelion has quit [Ping timeout: 252 seconds]
dionysus69 has quit [Ping timeout: 255 seconds]
troulouliou_dev has joined #ruby
jottr has quit [Ping timeout: 240 seconds]
guacamol_ has quit [Quit: My face has gone to sleep. ZZZzzz…]
guacamole has joined #ruby
banisterfiend has quit [Read error: Connection reset by peer]
zanoni has quit [Ping timeout: 240 seconds]
mn3m has quit [Ping timeout: 248 seconds]
MrBusiness has joined #ruby
houhouli_ has joined #ruby
php_newbie has joined #ruby
<php_newbie>
Hello there, I'm a php developer starting to learn ruby, I have stumble upon RVM and rubyenv
hahuang65 has joined #ruby
<matthewd>
php_newbie: This channel generally recommends rbenv or chruby, over RVM, if that's your question
<php_newbie>
Just tuo understand what's the most idiomatic way to manage the installation of a ruby interpeter? It seems like RVM should not be a tool i would have on production server, and I use to create my environment trougth containerization
houhoulis has quit [Ping timeout: 248 seconds]
cagomez has joined #ruby
<php_newbie>
what does effectively rubyenv gives the user?
<matthewd>
Production choices vary.. some use system ruby, if their OS is sufficiently up to date; others use ruby-build or ruby-install (the part of rbenv/chruby, respectively, that actually gets it onto your machine); still others do use a full version manager in production, even inside a container
<matthewd>
A version manager ensures you're using the same ruby version in your development environment and in production, and gives you the ability to easily change that, either for upgrades, or to work with an older version if that's what your production app is using.
<php_newbie>
ok please understand I don't come from an ecosystem with a native env definition tool, how is the ruby community reacting to containers? Why prefer a ruby env instead of of a container with the ruby interpeter?
<apeiros>
version managers existed before containers. some people just stuck with them. some move on to containers. some mix.
<php_newbie>
If i would have start I would have been set up a container with a ruby interpeter
<php_newbie>
ok
selim has quit [Ping timeout: 248 seconds]
mn3m has joined #ruby
<php_newbie>
So just to understand If I moove to Ruby and start to work on Ruby project would I be like found developers using containers or the sentiment is to stuck with ruby env?
<matthewd>
Personally, I think containers are a valuable option for production, but for local development, I prefer the flexibility of working on bare metal -- the isolation a container provides can occasionally get in the way, and IME it provides few advantages to make up for that (again, in development)
Mia has quit [Read error: Connection reset by peer]
<Papierkorb>
^
RickHull has joined #ruby
<php_newbie>
Containers are almost bare metal
<matthewd>
I'd say container-based development environments are also somewhat popular, though. Just not my cup of tea.
<php_newbie>
Understood
<Papierkorb>
php_newbie: You also have to consider that for many, using bare ruby (with or without a version manager) have served many well for over a decade
<RickHull>
havenwood (etc) - I'm looking for some guidance with Matrix and Vector from stdlib
selim has joined #ruby
<php_newbie>
for my point of view I do not care about what to use, I care about what community use, because software is more about people than code
<apeiros>
I think at this point, version managers are more widely used. but I think that's mostly due to masses moving slowly.
<php_newbie>
so I tend to adhere to comunity sentiment
<RickHull>
also, where @a is an array of Vectors, is this more naturally represented as a Matrix?
<Papierkorb>
php_newbie: It's just infinitely easier to interact with the actual software without having to mess with docker (or w/e) while dev'ing. Being able to write "bundle exec pry" will just work and have the environment you know: That of your host. On production, use whatever suits you best: If that's containers, use them!
<apeiros>
RickHull: probably matrix.rb considers vectors to be immutable.
<RickHull>
and are Vectors actually doing something useful in this lib?
<RickHull>
apeiros: so why might this lib be wanting to mutate?
<matthewd>
If you want to go with the currently-more-popular choice, I'd say go with a local version manager and run ruby locally. If you have container-based experience and would prefer to go that way, you won't be super unusual.
<RickHull>
is there a more canonical procedure?
<apeiros>
RickHull: because the dev was lazy?
<RickHull>
i wonder why choose Vector at all
d5sx43 has quit [Quit: Leaving...]
<php_newbie>
Acutally I'm playing around with RVM and simple bare metal env
<php_newbie>
where I will be able how to configure everything on its full potential
<apeiros>
RickHull: the standard way is to create a new vector with the modified values
<php_newbie>
I will moove to containerization
<apeiros>
and it probably uses a vector because it needs vector calculations
Immune has quit [Read error: Connection reset by peer]
<apeiros>
certainly is the kind of problems numpy is strong in. not sure how well narray is developed in ruby.
<havenwood>
haha, epitron upvoted it
<havenwood>
this is not the solution you are looking for...
<havenwood>
>.>
<RickHull>
havenwood: what is the point of this?
<havenwood>
RickHull: Just silliness. I was annoyed they stomped on a stdlib namespace so I unstomped it and used it.
ozcanesen has joined #ruby
<RickHull>
oh I see
<havenwood>
I like Matrix.
<RickHull>
i still haven't unpacked Fibonacci.matrix
<apeiros>
havenwood: :D
<RickHull>
it's just magic(tm) for now
<havenwood>
RickHull: :-)
ur5us has quit [Read error: No route to host]
enterprisey has quit [Remote host closed the connection]
ur5us_ has joined #ruby
raynold has quit [Quit: Connection closed for inactivity]
ur5us_ has quit [Read error: Connection reset by peer]
ur5us has joined #ruby
alex`` has quit [Ping timeout: 264 seconds]
tsglove2 has joined #ruby
ur5us_ has joined #ruby
cadillac_ has quit [Ping timeout: 240 seconds]
cadillac_ has joined #ruby
<zer0python>
anyone in here have experience with axlsx?
tsglove2 has quit [Read error: Connection reset by peer]
rirc_BE17 has joined #ruby
tsglove3 has quit [Ping timeout: 246 seconds]
ur5us has quit [Ping timeout: 252 seconds]
rirc_BE17 has quit [Client Quit]
<zer0python>
I'm following an example for creating a pivot table where they do pivot_table.data = [{:ref => "Member ID", :subtotal => "count"}]. I basically am doing the same thing but using more applicable values to what I'm working on, but I'm getting this validation error that says {:ref => "...", :subtotal => "count"} must be [String]
tcopeland has quit [Quit: tcopeland]
Immune has joined #ruby
cdg has joined #ruby
workmad3 has joined #ruby
cdg has quit [Remote host closed the connection]
cdg has joined #ruby
synthroi_ has quit []
Guest95018 has quit [Read error: Connection reset by peer]
enterprisey has joined #ruby
chmurifree has quit [Ping timeout: 240 seconds]
workmad3 has quit [Ping timeout: 248 seconds]
cadillac_ has quit [Ping timeout: 248 seconds]
troulouliou_dev has quit [Quit: Leaving]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cadillac_ has joined #ruby
allcentury has quit [Remote host closed the connection]
allcentury has joined #ruby
troulouliou_dev has joined #ruby
chmurifree has joined #ruby
guacamole has joined #ruby
ap4y has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz_ has quit [Ping timeout: 258 seconds]
<dminuoso>
zer0python: What part about that error escapes you?
<dminuoso>
zer0python: Oh, perhaps the phrasing might be weird. [String] reads to be: Array of strings. ;-)
<zer0python>
the part where I'm doing the same thing as the example and the example works
<zer0python>
that's what escapes me
<dminuoso>
zer0python: gist your code and the example
<zer0python>
can't gist my code
<dminuoso>
zer0python: make a testcase.
<dminuoso>
!nda
<dminuoso>
?nda
<ruby[bot]>
If you cannot share your code, we cannot help you. Create a complete, executable example that you can share and that reproduces your issue, or hire a consultant.
allcentury has quit [Ping timeout: 240 seconds]
cdg_ has joined #ruby
<RickHull>
it's always a good exercise to distill your buggy behavior to minimal example
<zer0python>
dminuoso: yeah I get it. Was hoping for an expert though.
<RickHull>
half the time you find the bug is on your side :)
<zer0python>
dminuoso: don't concern yourself with it, I'll figure it out.
<dminuoso>
zer0python: We dont have crystal balls. No expert can predict what you did wrong without seeing your code.
<dminuoso>
But suit yourself.
* RickHull
has ruby balls
<zenspider>
zer0python: was hoping for a psychic expert?
<zer0python>
dminuoso: I am literally doing the same thing as the example, only different fields.
cdg has quit [Ping timeout: 240 seconds]
<zer0python>
and the example is just the pivottable example you can find on google.
<RickHull>
zer0python: if you can distill it to a working example, paste that example
tomphp has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<RickHull>
or file an issue with the project
<dminuoso>
If you cant produce code that exhibits the problem, I doubt very much they will bother.
<zenspider>
how is it you can't paste us an example if this is "just the example" and "you can find on google"???
<zenspider>
this smells bad
troulouliou_dev has quit [Quit: Leaving]
ozcanesen has quit [Quit: ozcanesen]
<dminuoso>
zer0python: Based on the code, it appears that the array around [String] rather means "any of". So it would follow that you are not always passing in strings.
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
zenspider: in particular this validation is applied to the values of the hash. so some values in your hash are not strings.
<dminuoso>
But what do I know. Perhaps an expert will pop up.
* baweaver
wanders in
* baweaver
wanders back out
<zenspider>
not me...
<setient>
does anyone here do unit testing on rails without relying on a database or whatnot?
<setient>
you know, actual unit testing of the ruby code
allcentury has joined #ruby
<baweaver>
Fixtures
<baweaver>
though you probably want #RubyOnRails
<dminuoso>
baweaver: so much effort.
<zenspider>
"actual"? as in... if there's a db involved it isn't real testing?
<dminuoso>
?rails
<ruby[bot]>
Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
<dminuoso>
Look!
<dminuoso>
dminuoso. making fun of baweaver since 2016.
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ta has quit [Remote host closed the connection]
<zenspider>
some do... check out corey haines and... um... the destroy all software guy. both have given talks on it
guacamole has joined #ruby
<setient>
thank you baweaver
<zenspider>
gary bernhart
<setient>
thanks dminuoso
<zenspider>
but if my tests are fast enough w/ a db, I'm not going to put effort into removing it
<baweaver>
most of it is just using factory_girl poorly honestly
<baweaver>
or factory_bot now I guess
GodFather has quit [Ping timeout: 248 seconds]
<dminuoso>
baweaver: That refactoring was so painful, I was so close to just rm -rf spec/
<zenspider>
hah! was it renamed finally?
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
<dminuoso>
Yeah.
jenrzzz has joined #ruby
guacamole has quit [Client Quit]
<baweaver>
Looks like it
allcentury has quit [Ping timeout: 240 seconds]
<dminuoso>
I can barely write a spec without at least getting an uninitialized const error.
<dminuoso>
FactoryGirl. That muscle memory is burned in.
guacamole has joined #ruby
<zenspider>
I never saw the point in those libs
ta has joined #ruby
<dminuoso>
zenspider: It's somewhat useful if you use traits to quickly construct a hierarchy of objects.
csk157 has quit [Ping timeout: 240 seconds]
<zenspider>
def is my factory framework
<dminuoso>
def?
<zenspider>
def
Psybur has quit [Ping timeout: 240 seconds]
<dminuoso>
as in keyword_def?
milardovich has joined #ruby
GodFather has joined #ruby
Rapture has quit [Ping timeout: 240 seconds]
guacamole has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
milardovich has quit [Ping timeout: 252 seconds]
enterprisey has quit [Ping timeout: 248 seconds]
weaksauce has joined #ruby
Puffball has quit [Remote host closed the connection]
raynold has joined #ruby
troys is now known as troys_
FrostCandy has quit []
Puffball has joined #ruby
guacamole has joined #ruby
biberu has quit []
nadir has joined #ruby
alnewkir1 has quit [Ping timeout: 255 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
beerich has joined #ruby
claudiuinberlin has joined #ruby
tcopeland has joined #ruby
ahrs has quit [Remote host closed the connection]
ahrs has joined #ruby
<beerich>
Anybody available for a novice chat on modules?
<dminuoso>
Shoot.
my-nick has quit [Ping timeout: 240 seconds]
jrafanie has joined #ruby
impermanence has quit [Ping timeout: 240 seconds]
jenrzzz has quit [Ping timeout: 240 seconds]
<beerich>
Trying to get my head around how to do this. I have two files, where one uses require_relative to a file that has a module in it, and a plain methods for tests
<beerich>
I set a variable (instance, as I'm in Sinatra) to the outside method, and it works
<beerich>
the Module variable set, gives me an ISE
<beerich>
I need to use `include Modulename` correct?
jphase has quit [Remote host closed the connection]
<beerich>
even though I've required it?
jphase has joined #ruby
<dminuoso>
beerich: `require` is basically just `execute that file` (with the constraint that it will only execute any file once)