<adam12>
Pretty sure that's what rbenv / ruby-build is doing?
<mynameisdebian>
adam12: I just wouldn't know. I know Ruby and have been using 2.0 and below for a while. Trying to learn Rails and it seems to be a problem. Even if it is doing something like that, that does not mean I know how to do that with a different piece of software manually.
<adam12>
mynameisdebian: can you use ppa repos? maybe the ruby-ng repo from Brightbox would work for you. I don't know if it works on Debian.
<matthewd>
The chruby evangelism really gets old when someone's already legitimately frustrated and just trying to get something that works :/
<wald0>
baweaver: well, maybe I was wrong in the first "=" part, basically my question was about multiple dimensions, like if i can have multiple orders in an array variable (which, each one contains multiple values)
<postmodern>
can you use the ruby-ng PPA on Debian, or is there a repo of Debian packages for various ruby versions?
<matthewd>
adam12: In this instance, yes.. though I'm mumbling about a wider, non-you-specific, pattern
<havenwood>
matthewd: What's better than `sudo ruby-install --system` on AmazonLinux in his case? I think that's amongst the best options.
nowhere_man has quit [Read error: Connection reset by peer]
<mynameisdebian>
I've already wiped out AmazonLinux
<mynameisdebian>
I'm on Debian now
<havenwood>
mynameisdebian: Brightbox maintains great packages.
<mynameisdebian>
okay, I will try the brightbox ppa
pilne has joined #ruby
<matthewd>
havenwood: Given "I tried rbenv [but got an old version]", the solution is going to be to install a version manager from its official source. The least "ruby is a tire fire" response at that point is "use a newer version of the thing you chose", not "use the one I prefer".
cdg has joined #ruby
<havenwood>
matthewd: I think I was behind on scrollback.
<mynameisdebian>
is the Brightbox PPA for Ubuntu? Will it work for Debian?
<havenwood>
I just relocated and it looks like a lot has transpired. Never mind me.
imode has quit [Ping timeout: 240 seconds]
jinie has quit [Ping timeout: 260 seconds]
<postmodern>
appears brightbox ruby-ng is Ubuntu specific. `sudo ruby-install --system ruby` will still work, and no need for chruby since it installs into /usr/local/bin, etc
elsevero has quit [Quit: elsevero]
John___ has quit [Read error: Connection reset by peer]
jinie has joined #ruby
goyox86 has quit [Quit: goyox86]
cdg_ has quit [Ping timeout: 260 seconds]
nowhere_man has joined #ruby
goyox86 has joined #ruby
cdg has quit [Ping timeout: 255 seconds]
bronson has joined #ruby
<mynameisdebian>
I tried "ruby-full" on the advice of a website claiming this would give me 2.3.2 on Debian, and I'm still getting 2.1.5. What is wrong with this Debian install that it cannot under any circumstances locate a pacakge newer than 2.1.5? I am sure that is not the latest in Debian. What is wrong with my install?
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
<matthewd>
Debian 8 is 2.5 years old
marr has quit [Ping timeout: 240 seconds]
<matthewd>
The website you're looking at is presumably talking about Debian 9
gheegh has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
chouhoulis has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
quobo has quit [Quit: Connection closed for inactivity]
<postmodern>
debian testing is actually pretty stable and up-to-date
postmodern has quit [Quit: Leaving]
cagomez has quit [Ping timeout: 248 seconds]
Orwell has joined #ruby
<Orwell>
hello
Orwell has left #ruby [#ruby]
jenrzzz has joined #ruby
marcux has quit [Ping timeout: 248 seconds]
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
<mynameisdebian>
sorry for all the stupid questions, I'm on Debian 9 now. I have Ruby 2.3.3 installed. I try "gem install rails" and it fails. I think I'm just done with Rails. Ruby was nice and easy to use, but installing Rails is just totally beyond me. Thanks for all the help.
<havenwood>
mynameisdebian: There's a #RubyOnRails channel specific to Rails if you need any assistance getting rolling.
<havenwood>
matthewd: I was just searching for that.
<havenwood>
matthewd: It might be worth unifying installer-independent instructions since they're currently maintained in parallel. I've had multiple people request a canonical source of deps.
<havenwood>
RVM, rbenv and chruby all track the deps.
<havenwood>
But they change by version and are generally a pain.
<matthewd>
Yes, feel free to wander over to #RubyOnRails for more specific help from this point. If your general problem-solving style is to scattershot a series of half-attempts, never share an actual error, and then declare that you're "just done" all within an hour, though, that is... not a repeatable strategy for getting help.
<havenwood>
The deps and the versions/checksums are both tempting to unify.
<havenwood>
Presenting them on a united front seems best.
<havenwood>
matthewd: Even if it was just the version checksums and deps for CRuby.
orbyt_ has joined #ruby
<havenwood>
Ideally I think there'd be a central source that covered all the stable released engines - JRuby, CRuby, etc.
minimalism has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
<havenwood>
www.ruby-lang.org hasn't traditionally handled that cross-engine responsibility but it sure seems worth doing and it'd be a nice place to do it
<matthewd>
A single place blessing engines seems potentially.. politically difficult
<matthewd>
JRuby's easy enough to bless, but things get murkier after that
<havenwood>
Aye, maybe a standard way to present the two that engines could opt into providing?
cdg has quit [Ping timeout: 248 seconds]
Cohedrin_ has quit [Read error: Connection reset by peer]
<matthewd>
Yeah, if www.ruby-lang.org offered a sane presentation of the data for MRI, then they only have to maintain their own data, and if other engines copy, and installers need only maintain an internal list of *engines* they know about.. that sounds pretty workable
Paraxial has quit [Remote host closed the connection]
<matthewd>
I haven't dug in, but I imagine there's no getting around the installer needing some form of specific recipe for each engine anyway
troys is now known as troys_
Cohedrin_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Azure|dc has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
imode has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wutschkef has quit [Ping timeout: 255 seconds]
<matthewd>
OTOH, if ruby-install allowed installing trunk, and had a magically DWIMy rbenv subcommand, I could just use that and ignore ruby-build entirely :P
<matthewd>
Even the trunk thing is more nice-to-have, if I'm honest.. I've used it a few times, but it's not exactly an every-day use case
goyox86 has quit [Quit: goyox86]
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
goyox86 has joined #ruby
Cohedrin_ has quit [Read error: Connection reset by peer]
DTZUZO has quit [Ping timeout: 248 seconds]
goyox86 has quit [Client Quit]
jenrzzz has quit [Ping timeout: 248 seconds]
goyox86 has joined #ruby
shinnya has quit [Ping timeout: 255 seconds]
marcux has joined #ruby
Cohedrin_ has joined #ruby
wutschkef has joined #ruby
marxarelli is now known as marxarelli|afk
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
lupine has quit [Remote host closed the connection]
weaksauce has joined #ruby
lupine has joined #ruby
eroux has quit [Quit: ZZZzzz… ZZZzzz…]
nadir has joined #ruby
troys_ is now known as troys
chouhoulis has quit [Remote host closed the connection]
goyox86 has quit [Quit: goyox86]
goyox86 has joined #ruby
uZiel has joined #ruby
<nuck>
Anyone know if Rubocop has a setting to detect cases when you're a moron and do like `verb = verb.to_s`
<nuck>
Where the second one is _supposed_ to be a method call
<nuck>
I just failed to catch that and went "shiiiiiiiiit I forgot about syntactical ambiguity"
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
knight33 has joined #ruby
d^sh has quit [Ping timeout: 240 seconds]
QualityAddict has quit [Remote host closed the connection]
d10n-work has quit [Quit: Connection closed for inactivity]
govg has quit [Ping timeout: 255 seconds]
Silthias1 has quit [Ping timeout: 258 seconds]
gizmore|2 has joined #ruby
orbyt_ has joined #ruby
gizmore has quit [Ping timeout: 240 seconds]
Silthias has joined #ruby
ramfjord has quit [Ping timeout: 258 seconds]
imode has quit [Ping timeout: 258 seconds]
wutschkef has joined #ruby
ramfjord has joined #ruby
mynameisdebian has quit [Quit: Leaving]
gnufied has quit [Quit: Leaving]
gnufied has joined #ruby
cschneid_ has joined #ruby
imode has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
steve_ has joined #ruby
steve_ has quit [Client Quit]
ramfjord has joined #ruby
cschneid_ has quit [Ping timeout: 246 seconds]
kies has quit [Ping timeout: 248 seconds]
amirite has joined #ruby
ramfjord has quit [Ping timeout: 255 seconds]
__Yiota has joined #ruby
nicesignal has quit [Remote host closed the connection]
bronson has joined #ruby
nicesignal has joined #ruby
DTZUZO has joined #ruby
mjolnird has quit [Quit: Leaving]
bronson has quit [Ping timeout: 240 seconds]
helpa-bot has joined #ruby
helpa-bot has quit [Changing host]
helpa-bot has joined #ruby
helpa has quit [Remote host closed the connection]
AnoHito has joined #ruby
my123_ has quit [Ping timeout: 240 seconds]
helpa-bot has quit [Remote host closed the connection]
AnoHito_ has quit [Read error: Connection reset by peer]
petems has quit [Ping timeout: 240 seconds]
helpa has joined #ruby
postmodern has quit [Remote host closed the connection]
amirite has quit [Remote host closed the connection]
amirite has joined #ruby
postmodern has joined #ruby
petems has joined #ruby
TinkerTyper has quit [Quit: ZNC 1.7.x-nightly-20170908-e86efb08 - https://znc.in]
<Radar>
nuck: I don't understand.
TinkerTyper has joined #ruby
<nuck>
Okay, so, if I have a method `def verb` and in another method I do `verb = verb.to_s`, Ruby seems to interpret both `verb` as variable references (not method calls)
<nuck>
Which is totally understandable, it has to make that call at parse time
ncthom91 has joined #ruby
<havenwood>
musl_: You can define a #verb= method.
<havenwood>
nuck: ^
<nuck>
havenwood: It wouldn't be called, but it's also not what I'm seeking
<nuck>
I'm wondering if Rubocop has a cop to detect ambiguity such as that
<nuck>
Where you seem to be referencing a variable which didn't exist previously
<havenwood>
nuck: Yes, they have unused variable assignment cops.
ncthom91 has quit [Client Quit]
<nuck>
No no, the variable is used
<matthewd>
AIUI the line "should" be `verb = self.verb.to_s` / `verb = verb().to_s`
<havenwood>
nuck: Don't shadow methods with variables of the same name.
chouhoulis has joined #ruby
<nuck>
havenwood: Indeed, and I'd like a cop to enforce that :D
<nuck>
matthewd: Yeah
<nuck>
Either of those solves the ambiguity, though self.verb has the downside of not working with private methods either
jrafanie has joined #ruby
<havenwood>
nuck: Set instance variables directly. (If that even works here. Hard to say in the abstract.)
<nuck>
Well, it's not an instance variable, it's just a local variable
<havenwood>
nuck: err, so you actually want to be setting the local variable and it is doing that?
<havenwood>
I don't get it.
<nuck>
havenwood: I want to set local variable `verb` to `verb().to_s`
<nuck>
Or rather, I want to *detect* when I make that stupid mistake
<nuck>
Shadowing the instance method with a local variable (which is bad)
<havenwood>
nuck: that seems like a reasonable cop if there isn't one. (if there is i don't recall it.)
<matthewd>
nuck: I think the answer to your question is no, no-one knows of a rubocop rule that would detect this for you :)
amirite has quit [Ping timeout: 248 seconds]
<matthewd>
It's essentially the opposite of an unused assignment: variable accessed prior to assignment
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has quit [Ping timeout: 246 seconds]
aphelion has quit [Ping timeout: 246 seconds]
epochwolf has quit [Ping timeout: 246 seconds]
Cohedrin_ has joined #ruby
DarkBushido has quit [Ping timeout: 252 seconds]
rideh has quit [Ping timeout: 240 seconds]
cout has quit [Ping timeout: 258 seconds]
AustinMatherne has quit [Ping timeout: 248 seconds]
oncall-pokemon has joined #ruby
n35xdxb0 has quit [Quit: WeeChat 1.9.1]
n35xdxb0 has joined #ruby
troys is now known as troys_
irated has quit [Ping timeout: 248 seconds]
cout has joined #ruby
AustinMatherne has joined #ruby
rideh has joined #ruby
n35xdxb0 has quit [Client Quit]
aphelion has joined #ruby
DarkBushido has joined #ruby
DarkBushido has quit [Changing host]
DarkBushido has joined #ruby
n35xdxb0 has joined #ruby
cschneid has joined #ruby
epochwolf has joined #ruby
<nuck>
matthewd: Yeah, it could be covered by a "variable referenced prior to assignment" cop or a "variable shadows instance method" cop
<matthewd>
The latter would be true for the entire method... and relies on detecting that the instance method exists
amirite has joined #ruby
wald0 has quit [Read error: Connection reset by peer]
irated has joined #ruby
wald0 has joined #ruby
kies has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nuck>
Indeed, the latter would probably be far more complicated
amirite has quit [Ping timeout: 255 seconds]
wald0 has quit [Quit: Lost terminal]
cadillac_ has quit [Quit: I quit]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cadillac_ has joined #ruby
govg has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
kies has quit [Ping timeout: 255 seconds]
chouhoulis has quit [Remote host closed the connection]
gix has quit [Ping timeout: 240 seconds]
enterprisey has quit [Quit: Leaving]
gix has joined #ruby
cadillac_ has quit [Read error: Connection reset by peer]
cadillac_ has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
pilne has left #ruby ["Leaving!"]
Birdseye has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sniffer has quit [Quit: No Ping reply in 180 seconds.]
Birdseye has quit []
sniffer has joined #ruby
someuser has joined #ruby
jenrzzz has joined #ruby
r_rios has joined #ruby
<r_rios>
Hello, all. Does filepath autocompletion on Readline work on Windows?
<r_rios>
It doesn't seem to work from here
FastJack has quit [Read error: Connection reset by peer]
FastJack has joined #ruby
someuser has quit [Ping timeout: 248 seconds]
cam27 has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
howdoi has quit [Quit: Connection closed for inactivity]
gusrub has quit [Read error: Connection reset by peer]
gusrub has joined #ruby
wutschkef has quit [Ping timeout: 240 seconds]
Derperperd has quit [Quit: Peace out]
Derperperd has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Inside has quit [Disconnected by services]
Derperperd has quit [Quit: Peace out]
Derperperd has joined #ruby
jphase has quit [Ping timeout: 255 seconds]
moei has joined #ruby
uZiel has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
nadir has joined #ruby
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
someuser_ has joined #ruby
bronson has joined #ruby
bkxd has joined #ruby
jameser has joined #ruby
minimalism has quit [Quit: minimalism]
someuser_ has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 240 seconds]
Coming_ has quit [Ping timeout: 246 seconds]
wpostma has joined #ruby
troys_ is now known as troys
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 248 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 258 seconds]
troys has quit [Quit: Bye]
dionysus69 has joined #ruby
ramfjord has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Remote host closed the connection]
jameser has joined #ruby
harfangk has joined #ruby
enterprisey has joined #ruby
r_rios has quit [Read error: Connection reset by peer]
hahuang65 has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
SeepingN has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
lizard2010 has joined #ruby
milardovich has joined #ruby
conta has quit [Ping timeout: 248 seconds]
anisha has joined #ruby
Cohedrin_ has joined #ruby
alex`` has joined #ruby
astrobunny has quit [Remote host closed the connection]
bkxd has quit [Ping timeout: 240 seconds]
SeepingN has joined #ruby
astrobunny has joined #ruby
Derperperd has quit [Quit: Peace out]
Derperperd has joined #ruby
aufi has joined #ruby
ur5us has quit [Read error: No route to host]
ur5us has joined #ruby
biberu has joined #ruby
aupadhye has joined #ruby
Emmanuel_Chanel has quit [Ping timeout: 240 seconds]
mostlybadfly has quit [Quit: Connection closed for inactivity]
ta has quit [Remote host closed the connection]
csaunders has quit [Quit: later tater]
wpostma has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
Mon_Ouie has quit [Ping timeout: 248 seconds]
dminuoso_ has joined #ruby
oncall-pokemon has quit [Quit: Connection closed for inactivity]
csaunders has joined #ruby
wutschkef has joined #ruby
<waveprop>
!since Bock
<waveprop>
!seen waveprop
<dminuoso_>
More importantly
<dminuoso_>
Where is apeiros :(
<dminuoso_>
Need someone to throw paper at.
<waveprop>
:o
wutschkef has quit [Ping timeout: 258 seconds]
def_jam has quit [Quit: WeeChat 1.9.1]
AndBobsYourUncle has joined #ruby
<baweaver>
dminuoso_: hm hm?
eckhardt has joined #ruby
someuser_ has joined #ruby
<baweaver>
ohai eckhardt
<eckhardt>
ohai
<eckhardt>
what's the word
<baweaver>
oh hi -> ohi -> ohai
<eckhardt>
haha
<eckhardt>
i meant wie geht's
<baweaver>
riiiiight
dionysus69 has joined #ruby
<dminuoso_>
baweaver: Fun stuff, do you ever wake up at 6 in the morning, realizing that an isomorphism is both a monomorphism and an epimorphism, but that the inverse does not hold true?
* baweaver
slowly puts down whisky
<eckhardt>
so i spent way too much time today trying to uplift a rails app from 4 to 5
<dminuoso_>
Man I should study maths. :(
<baweaver>
rectangles and squares man
<eckhardt>
because Reasons
<dminuoso_>
Yes. Rectangles.
<baweaver>
do reasons relate to internal libs that the main contributor just left from?
<eckhardt>
Yes.
<eckhardt>
Times...36.
<dminuoso_>
main contributor?
<dminuoso_>
eckhardt: Here we decided to rewrite our rails app from 4 to 5 to fix all our mistakes and headaches.
<dminuoso_>
From scratch.
<eckhardt>
one of, there are others. I just assumed the stuff for 5 was further along
<eckhardt>
man was that a mistake
<eckhardt>
hahaha
<baweaver>
eckhardt works on another team where I'm at
<dminuoso_>
Oh.
<baweaver>
So does eam
<dminuoso_>
And you work at that place with eam?
<dminuoso_>
Ahh, I remembered correctly.
<eckhardt>
yeah i was tempted to just rerwrite it but the app a) isn't my team's, and b) I have deadlines
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jordanm has joined #ruby
<baweaver>
yep
<baweaver>
eam and xshay were the reasons for me going there
<dminuoso_>
I need to get a new place to work at I think.
<eckhardt>
nice. Lots of offices in Alameda that would be perfect...
<dminuoso_>
US is not something I want to consider for numerous reasons.
<eckhardt>
but rent is kinda ridiculous there too
Emmanuel_Chanel has joined #ruby
<baweaver>
eam was complaining about BART, I asked if he was from around the bay, found out we lived ~5-10m away, got coffee, and he said come over if I ever wanted a new gig
<baweaver>
So I did and here I am
<dminuoso_>
No shit
<dminuoso_>
Was considering about something new earlier this year, but there were too many things I had to take care of first.
<eckhardt>
haha
<eckhardt>
awesome
<eckhardt>
bart just seems to get worse and worse
<dminuoso_>
Who or what is BART?
<dminuoso_>
Oh. Should google more frequently.
<dminuoso_>
Time to study more cateogry theory.
<eckhardt>
category theory > BART
<eam>
good evening
<eckhardt>
awww sh1t it's a party now
<dminuoso_>
Clearly eam has been woken up by the amount of 0x07 chars he has gotten.
<eam>
I'm getting solar installed tomorrow, I'm so excited
<eckhardt>
nice
<eckhardt>
clearly your future is looking bright
<eam>
light up my week
<eckhardt>
i think all the smokey air screwed up my delicate lungs
<eckhardt>
my throat is unhappy
<eam>
I ditched around 1pm, felt awful -- and I think there was concentrated smoke on the 3rd bart level of civic center
tsglove has quit [Read error: Connection reset by peer]
dminuoso_ has joined #ruby
nowhere_man has quit [Remote host closed the connection]
Xiti` has joined #ruby
tsglove has joined #ruby
nowhere_man has joined #ruby
MrBismuth has joined #ruby
Mon_Ouie has joined #ruby
someuser_ has quit [Ping timeout: 248 seconds]
MrBusiness has quit [Ping timeout: 255 seconds]
Xiti has quit [Ping timeout: 255 seconds]
morfin has joined #ruby
guardianx has joined #ruby
<morfin>
i thought jruby won't work well with OpenJDK =)
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
rabajaj has joined #ruby
dminuoso_ has quit [Remote host closed the connection]
ramfjord has joined #ruby
AndBobsYourUncle has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
ramfjord has quit [Ping timeout: 240 seconds]
consti has joined #ruby
hs366 has joined #ruby
ta has joined #ruby
gusrub has quit [Remote host closed the connection]
paranoicsan has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
lizard2010 has quit [Quit: Leaving]
imode has quit [Ping timeout: 246 seconds]
cdg has joined #ruby
dminuoso_ has joined #ruby
Bish has quit [Read error: Connection reset by peer]
mjolnird has joined #ruby
kliq has joined #ruby
cdg has quit [Ping timeout: 258 seconds]
claudiuinberlin has joined #ruby
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dimik has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
eckhardt has joined #ruby
Paraxial has joined #ruby
neon_icon has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
cdg has joined #ruby
jenrzzz has joined #ruby
cdg has quit [Ping timeout: 246 seconds]
Paraxial has quit [Remote host closed the connection]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Paraxial has joined #ruby
Burgestrand has joined #ruby
vee__ has quit [Ping timeout: 240 seconds]
Silthias1 has joined #ruby
howdoi has joined #ruby
Cohedrin_ has joined #ruby
Silthias has quit [Read error: Connection reset by peer]
Silthias has joined #ruby
Cohedrin_ has quit [Client Quit]
enterprisey has quit [Quit: Leaving]
sysvalve has joined #ruby
Silthias1 has quit [Ping timeout: 240 seconds]
Guest97372 has quit [Ping timeout: 248 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mark_66 has joined #ruby
claudiuinberlin has joined #ruby
ski7777 has quit [Ping timeout: 240 seconds]
ski7777 has joined #ruby
Coming_ has joined #ruby
sleetdrop has quit [Read error: Connection reset by peer]
vee__ has joined #ruby
ski7777 has quit [Ping timeout: 240 seconds]
nemesit|znc has joined #ruby
ski7777 has joined #ruby
dinfuehr has quit [Ping timeout: 240 seconds]
bronson has joined #ruby
tripoli has joined #ruby
guardianx has quit [Remote host closed the connection]
mim1k has joined #ruby
dinfuehr has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vee__ has quit [Ping timeout: 248 seconds]
ski7777 has quit [Ping timeout: 240 seconds]
kliq has quit [Ping timeout: 240 seconds]
bronson has quit [Ping timeout: 260 seconds]
kliq has joined #ruby
mgtuiw1131 has joined #ruby
sniffer has quit [Quit: No Ping reply in 180 seconds.]
marr has joined #ruby
paranoicsan is now known as paranoicsan[Away
vee__ has joined #ruby
Beams has joined #ruby
kies has joined #ruby
guille-moe has joined #ruby
sniffer has joined #ruby
paranoicsan[Away is now known as paranoicsan
rabajaj has quit [Remote host closed the connection]
rabajaj has joined #ruby
rabajaj has quit [Remote host closed the connection]
rabajaj has joined #ruby
claudiuinberlin has joined #ruby
mgtuiw1131 has quit [Read error: Connection reset by peer]
InfinityFye has joined #ruby
CrazyEddy has quit [Ping timeout: 240 seconds]
devgiant has joined #ruby
harfangk has quit [Ping timeout: 240 seconds]
ramfjord has joined #ruby
hs366 has quit [Read error: Connection reset by peer]
kliq has quit [Ping timeout: 264 seconds]
ramfjord has quit [Ping timeout: 246 seconds]
astrobunny has quit [Remote host closed the connection]
devgiant has quit [Quit: Leaving]
lxsameer has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso_>
super: no superclass method `username'
<dminuoso_>
Apparently this toxic class uses method_missing? in *some* class in the ancestory.
<dminuoso_>
Why doesn't super respect method_missing? ....
<matthewd>
It does?
ski7777 has joined #ruby
<matthewd>
More likely it's *not* using method_missing: it's defining the method dynamically, and you're overwriting said method in the same class it would otherwise be defined
<dminuoso_>
Oh. Indeed.
<matthewd>
AR supports this by specifically doing the dynamic definitions in a purpose-created module instead
<matthewd>
But otherwise, you can prepend instead ¯\_(ツ)_/¯
<dminuoso_>
matthewd: What API would I be looking for?
<dminuoso_>
matthewd: Yeah, already on that.
<matthewd>
In AR? generated_attribute_methods IIRC
ur5us has joined #ruby
ur5us has quit [Read error: Connection reset by peer]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
aufi has quit [Quit: Leaving]
selim has joined #ruby
synthroid has joined #ruby
synthroid has quit [Remote host closed the connection]
synthroid has joined #ruby
uZiel has joined #ruby
ski7777 has joined #ruby
Pierreb|home has quit [Read error: Connection reset by peer]
dviola has joined #ruby
blackmesa has joined #ruby
alfiemax has quit [Ping timeout: 258 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ski7777 has quit [Ping timeout: 255 seconds]
kent\n has quit [Quit: database migration time, brb]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marxarelli|afk is now known as marxarelli
zautomata has quit [Quit: WeeChat 1.4]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
chouhoulis has quit [Remote host closed the connection]
blackmesa has quit [Ping timeout: 255 seconds]
Mon_Ouie has quit [Ping timeout: 248 seconds]
milardovich has joined #ruby
enterprisey has joined #ruby
Mia has quit [Read error: Connection reset by peer]
jrafanie has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
milardovich has quit [Read error: Connection reset by peer]
milardovich has joined #ruby
orbyt_ has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
TomyWork has quit [Ping timeout: 240 seconds]
troys has joined #ruby
ShalokShalom_ has joined #ruby
blackmesa has joined #ruby
milardovich has quit [Remote host closed the connection]
gusrub has joined #ruby
milardovich has joined #ruby
lagweezle_away is now known as lagweezle
milardovich has quit [Remote host closed the connection]
bruno- has quit [Ping timeout: 240 seconds]
belmoussaoui_ has joined #ruby
ShalokShalom has quit [Ping timeout: 240 seconds]
milardovich has joined #ruby
naprimer2 has quit [Quit: Leaving]
lxsameer has quit [Ping timeout: 246 seconds]
Beams has quit [Quit: .]
milardovich has quit [Remote host closed the connection]
milardovich has joined #ruby
bronson has joined #ruby
pppktz_ has joined #ruby
[Butch] has joined #ruby
milardovich has quit [Ping timeout: 255 seconds]
kent\n has joined #ruby
paranoicsan has quit [Quit: paranoicsan]
bronson has quit [Ping timeout: 255 seconds]
<pppktz_>
Hi guys! I have started learning ruby and as a homework I am trying to write a simple code to list files in a directory with an extension, file path and extension provided by input, however I am stuck... Can someone have a look at my code?
naprimer has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
John___ has quit [Remote host closed the connection]
thinkpad has quit [Ping timeout: 248 seconds]
<Papierkorb>
pppktz_: Please use https://gist.github.com to share the relevant parts of your code. Also, describe here what you're trying to do (And *How*), and what happens instead. If you're stuck in that you don't know how to do something, please say exactly what, and what you tried already.
amirite has joined #ruby
<Papierkorb>
pppktz_: We don't bite, we want to help you, so please share what you have with us to make things easier :)
<pppktz_>
Papierkorb, thanks for the update, here is the code : https://gist.github.com/anonymous/38e248e0bc71026d5a4ecde1cd747706 , as I mentioned I am trying to create a script which is searching in a user specified path for file with user specified extension, however I only can print what I provide for the variable c in my code
<Papierkorb>
pppktz_: Do you mean searching as in, in recursively in sub-folders?
yeticry_ has joined #ruby
<pppktz_>
yes
kent\n has quit [Ping timeout: 255 seconds]
yeticry has quit [Ping timeout: 260 seconds]
<Papierkorb>
pppktz_: There's `Dir[x]`, where x is a wildcard glob string like you (may?) know from a shell. You can use `**` (so, star star) to match recursively. That command returns an array, so you'll have to #each over it. Can you try with that?
<Papierkorb>
pppktz_: If you don't already, at least use `irb` to start an interactive ruby session where you can quickly try things like this. Makes learning ruby quite enjoyable once you get the hang of it, and really useful after that :)
biberu has quit []
kent\n has joined #ruby
<pppktz_>
let me try it, thanks!
<workmad3>
pppktz_: also note `if file = "*.#{c}"` will assign '*.#{c}' to the file variable, and that string is truthy so will always hit the 'true' path too
<pppktz_>
thanks havenwood, almost done, workmad3 now I updated = to == and it works, Papierkorb (thanks for irb, I read about it but not tried before)the filtering works with regexp, however subfolders are still ahead :)
jenrzzz has quit [Ping timeout: 258 seconds]
jrafanie has joined #ruby
<Papierkorb>
?pry pppktz_
<Papierkorb>
?pry
<ruby[bot]>
Pry, the better IRB, provides easy object inspection `ls`, `history`, viewing docs `?`, viewing source `$`, syntax highlighting and other features (see `help` for more). Put `binding.pry` in your source code for easy debugging. Install Pry (https://pryrepl.org/): gem install pry pry-doc
<Papierkorb>
pppktz_: ^
<Papierkorb>
pppktz_: That's like irb on crack.
<Papierkorb>
If not today, maybe next week. Many use it about daily for various things, from trying things, to debugging or as partial replacement for a "shell"
ddffg has quit [Quit: Leaving]
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
chouhoulis has joined #ruby
chouhoulis has quit [Remote host closed the connection]
<pppktz_>
Papierkorb, thanks, I will check it out soon, first I'll try to get familiar with irb :)
chouhoulis has joined #ruby
nahra has quit [Remote host closed the connection]
nahra has joined #ruby
nahra has quit [Remote host closed the connection]
elsevero has joined #ruby
elsevero has quit [Remote host closed the connection]
t0th_- has quit [Quit: Leaving]
jenrzzz has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
MyMind has joined #ruby
jrafanie has joined #ruby
TomyLobo has joined #ruby
Sembei has quit [Ping timeout: 240 seconds]
alfiemax has quit [Ping timeout: 246 seconds]
<pppktz_>
done and working! Thank you guys! I learned by the days practice is much more important than just reading about how to code...
ldepandis has joined #ruby
Guest97372 has joined #ruby
TomyLobo2 has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
nogic has joined #ruby
mim1k has joined #ruby
TomyLobo has quit [Ping timeout: 255 seconds]
<teatime>
pppktz_: protip: that's true for pretty much everything ;)
cabotto has quit []
<teatime>
it may be an easier trap to fall into for coding, tho
<teatime>
analysis paralysis etc.
weaksauce has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 248 seconds]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
milardovich has joined #ruby
blackmesa has joined #ruby
roamingdog has joined #ruby
RickHull has joined #ruby
[Butch] has quit [Quit: I'm out . . .]
roamingdog has quit [Remote host closed the connection]
<RickHull>
is there any way to get ruby-rprof to respect a LOAD_PATH, e.g. `ruby-prof -I lib/` ?
roamingdog has joined #ruby
<RickHull>
s/ruby-rprof/ruby-prof/
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
roamingdog has quit [Remote host closed the connection]
InfinityFye has quit [Quit: Leaving]
roamingdog has joined #ruby
<RickHull>
it appears `ruby-prof` expects a "script" as the first argument, and it won't accept `ruby -Ilib` as that script
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
<RickHull>
this is annoying because profiling is a development thing, but ruby-prof will only execute against installed gems, not the state of dev on the filesystem
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Mon_Ouie has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
roamingdog has quit [Ping timeout: 248 seconds]
ski7777 has joined #ruby
simmaniac has joined #ruby
<teatime>
RickHull: some interpreted languages have the concept of "install-linking" (I dunno the word) an editable development tree such that the rest of the system sees and uses it as an installed module... does ruby?
troys is now known as troys_
<RickHull>
in general, if you have a project on the filesystem that is structured like a gem, you can just do: `ruby -Ilib path/to/script` in order to execute your script against the state of the filesystem
<RickHull>
or more consistently: `ruby -I path/to/lib path/to/script`
<RickHull>
however, when using ruby-prof, there doesn't appear to be a way to prepend the local lib dir to the LOAD_PATH
<teatime>
is it ignoring the env var(s) Ruby would normally pay attention to ?
sysvalve has quit [Ping timeout: 240 seconds]
<RickHull>
hm, LOAD_PATH is not an env var but a built in "
<RickHull>
"constant"
<RickHull>
but I think there is a RUBYLIB env var
ski7777 has quit [Ping timeout: 260 seconds]
blackmesa has quit [Ping timeout: 255 seconds]
<RickHull>
yep, RUBYLIB appears to be a workable mechanism here, thx
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
amirite has quit [Remote host closed the connection]
orbyt_ has joined #ruby
cajone has quit [Remote host closed the connection]
amirite has joined #ruby
amirite has quit [Remote host closed the connection]
jenrzzz has quit [Ping timeout: 255 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cajone has joined #ruby
TomyLobo2 is now known as TomyLobo
Cohedrin_ has joined #ruby
ldepandis has quit [Ping timeout: 240 seconds]
Eiam has joined #ruby
cdg has quit [Remote host closed the connection]
quobo has joined #ruby
AxelAlex has joined #ruby
bronson has joined #ruby
bmurt has joined #ruby
blackmesa has joined #ruby
eckhardt_ has joined #ruby
shwouchk has joined #ruby
<baweaver>
The thing about preference and style is it's just that: recommendations
<baweaver>
you're not strictly _required_ to do them cagomez
eckhardt has quit [Ping timeout: 240 seconds]
<baweaver>
That said, I tend to follow after that convention but mostly because I almost always write functional style and I hate typing out do end all the time
bmurt has quit [Client Quit]
<cagomez>
baweaver: ok, so if were to follow the convention, is returning a new value derived from Foo a side effect? or is a function?
bronson has quit [Ping timeout: 260 seconds]
<baweaver>
Got a gist?
<baweaver>
In general functional style is to not mutate anything.
Bock has quit [Ping timeout: 240 seconds]
<baweaver>
or, more correctly in Ruby, minimize and isolate them to the edges
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
bmurt has joined #ruby
exchgr has quit [Ping timeout: 255 seconds]
weaksauce has joined #ruby
exchgr has joined #ruby
<headius>
morfin: JRuby should work fine with any JDK, and we recommend OpenJDK
ski7777 has joined #ruby
weaksauce has quit [Read error: Connection reset by peer]
wpostma has joined #ruby
uZiel has quit [Remote host closed the connection]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
wpostma has quit [Ping timeout: 258 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ski7777 has quit [Ping timeout: 264 seconds]
troys_ is now known as troys
pppktz_ has quit [Quit: Leaving]
GodFather has joined #ruby
synthroid has quit [Remote host closed the connection]
tax has quit [Quit: Leaving]
uZiel has joined #ruby
jamesaxl has quit [Read error: Connection reset by peer]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has joined #ruby
mson has quit [Quit: Connection closed for inactivity]
bmurt has joined #ruby
<pizzaops>
So I've read the docs here — https://bundler.io/v1.11/man/bundle-install.1.html — and maybe I'm missing something, but is there no way to run `bundle install` from outside a project's directory?
<pizzaops>
E.g. with git I can do things like `git --git-dir=/path/to/project/.git --work-dir=/path/to/project checkout master`
<pizzaops>
from any random directory
<havenwood>
pizzaops: --gemfile=
<RickHull>
i'd guess if you specify path/to/Gemfile and also output_dir
<pizzaops>
havenwood RickHull thank you! <3 <3
ski7777 has quit [Ping timeout: 240 seconds]
<pizzaops>
Don't know how I overlooked that.
<pizzaops>
RickHull: I don't see that flag in the docs, output_dir
<pizzaops>
(or anything like it
<RickHull>
just a stab -- bundle install will probably want to create a Gemfile.lock and maybe some other stuff
<RickHull>
it may not be needed -- e.g. inferred from the Gemfile location; poke around
<pizzaops>
RickHull: agreed, but hopefully it does it in the proper directory. I'll just make a Gemfile and test it real quick.
<pizzaops>
Thanks for your help sir!
bmurt has quit [Client Quit]
<RickHull>
cheers :)
bronson has joined #ruby
bruno- has joined #ruby
kapil___ has joined #ruby
Immune has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
wutschkef has joined #ruby
bmurt has joined #ruby
Guest97372 has quit [Ping timeout: 255 seconds]
cdg_ has joined #ruby
rfoust has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cdg has quit [Ping timeout: 248 seconds]
<pizzaops>
RickHull: thanks again, can confirm that it creates the `Gemfile.lock` in the appropriate place automatically.
bmurt has quit [Client Quit]
<RickHull>
havenwood is da real MVP <3
Coming_ has quit [Quit: Leaving]
blackmesa has quit [Ping timeout: 255 seconds]
lagweezle is now known as lagweezle_away
Ioannis74 has quit [Quit: Going offline, see ya! (www.adiirc.com)]
sagax has quit [Quit: Konversation terminated!]
Ltem has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
ski7777 has joined #ruby
eckhardt has joined #ruby
ski7777 has quit [Ping timeout: 240 seconds]
Rapture has joined #ruby
Rapture has quit [Client Quit]
jinie has quit [Ping timeout: 264 seconds]
jinie has joined #ruby
synthroid has quit []
roamingdog has joined #ruby
serhart has quit [Ping timeout: 258 seconds]
serhart has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
troys is now known as troys_
serhart has quit [Client Quit]
serhart has joined #ruby
AxelAlex has quit [Ping timeout: 260 seconds]
roamingdog has quit [Ping timeout: 248 seconds]
kliq has quit [Ping timeout: 258 seconds]
Dimik has joined #ruby
lagweezle_away is now known as lagweezle
lagweezle is now known as lagweezle_away
alnewkirk has quit [Ping timeout: 258 seconds]
guille-moe has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
blackmesa has joined #ruby
__Yiota has joined #ruby
__Yiota has quit [Client Quit]
cagomez has quit [Remote host closed the connection]
cagomez has joined #ruby
milardovich has joined #ruby
cagomez has quit [Ping timeout: 248 seconds]
milardovich has quit [Remote host closed the connection]
jrafanie has joined #ruby
goyox86_ has joined #ruby
alex`` has quit [Ping timeout: 246 seconds]
goyox86_ has quit [Client Quit]
chouhoul_ has joined #ruby
troys_ is now known as troys
jenrzzz has joined #ruby
goyox86_ has joined #ruby
goyox86_ is now known as goyox86
chouhoulis has quit [Ping timeout: 240 seconds]
chouhoul_ has quit [Ping timeout: 240 seconds]
imode has joined #ruby
goyox86 has quit [Client Quit]
goyox86 has joined #ruby
morfin has quit []
ldnunes has quit [Ping timeout: 240 seconds]
<RickHull>
anyone familiar with rubinius on travs-ci.org? with rubinius-3.86, I get an error about sudo inside a container
goyox86 has quit [Ping timeout: 255 seconds]
<RickHull>
hm, I guess I need to tell travis I need sudo for this
<matthewd>
RickHull: (from 2 hours ago) see also ruby -S
<RickHull>
ah, for path/to/ruby-prof -- thanks :)
rgr has quit [Ping timeout: 258 seconds]
mtkd has quit [Ping timeout: 240 seconds]
bmurt has joined #ruby
mtkd has joined #ruby
sysvalve has quit [Quit: Leaving]
dviola has quit [Read error: Connection reset by peer]
cagomez has joined #ruby
tcopeland has quit [Quit: tcopeland]
ldnunes has joined #ruby
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mim1k has joined #ruby
Ltem has quit [Quit: Leaving]
<cagomez>
what is inside the parens? some_hash.merge(k => v * 2) . is it a lambda?
<RickHull>
it's a hash
mim1k has quit [Ping timeout: 260 seconds]
<RickHull>
the brackets are implicit in this context, though can say some_hash.merge({ k => v * 2})
<cagomez>
RickHull: ah, so it's merging {k: v*2), overwriting the old value of some_hash[k]?
<RickHull>
yep
<cagomez>
is it possible to convert k from string to a symbol during merge() or is that a another transformation?
<elomatreb>
Lambda would be with a dash arrow, -> { something }
jenrzzz has quit [Ping timeout: 240 seconds]
<elomatreb>
You could call .to_sym on it, if it's really that simple
<cagomez>
would that overwrite the old key that is of type string?
blackmesa has quit [Quit: WeeChat 1.9.1]
<elomatreb>
No. That would have to be a different step then
<elomatreb>
(Except if your Hash is one of the weird Rails HashWithIndifferentAccess thingies)
sepp2k has quit [Quit: Leaving.]
ski7777 has joined #ruby
ShalokShalom_ has quit [Ping timeout: 240 seconds]
nahra has joined #ruby
<cagomez>
see, I have an array of hashes that I want to transform. I looked at Elixir and it can do myHash |> do_this |> then_that . is there a way to do something like, array_of_hashes { |some_hash| thenThat(doThis(hash)) }
<cagomez>
but in a cleaner way?
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<elomatreb>
I don't know Elixir, sorry. transform_values/keys may be what you want, but if there are multiple steps you'll probably need to chain them
<elomatreb>
Oh, transform_keys is an activesupport method sadly
jenrzzz has joined #ruby
<elomatreb>
matthewd: Couldn't those two calls be in a single map, thenThat(doThis(h))? If it's this I think I misunderstood the question
<matthewd>
AIUI, the true ruby equivalent of elixir's "|>" is "."
jordanm has quit [Remote host closed the connection]
cdg_ has quit [Remote host closed the connection]
ski7777 has quit [Ping timeout: 248 seconds]
<pizzaops>
Is there something in Ruby comparable to Python's ctypes? Just curious.
<matthewd>
elomatreb: Yes; the goal is "a cleaner way", so my best offering was something that put "doThis" physically ahead of "thenThat", which seems to be the generally-claimed revelation of |>
<elomatreb>
Ah, that's what it does
<havenwood>
In Ruby 2.5 there's #yield_self but it'll not read as nice as the pipe operator
<havenwood>
And doesn't have the implicit first argument passing
<matthewd>
havenwood: Right.. but how is that not what "." does?
ski7777 has joined #ruby
<havenwood>
matthewd: `hash |> do_this |> then_this` is equiv to `then_this(do_this(hash))`
<matthewd>
Calls the named method, with an implicit first argument plus any others supplied, with minimal syntax
<matthewd>
And so is hash.do_this.then_this
lagweezle_away is now known as lagweezle
<RickHull>
except that the middleman methods need to return self (more or less), not some other value
<havenwood>
Yeah, if Ruby had OO and functional calls available interchangeably like Perl 6
<havenwood>
But since Ruby doesn't equivocate between those two styles, the functional pipeline seems enviable.
<matthewd>
I guess my argument is that Elixir doesn't have them interchangeable either, so it seems like "|>" is a direct equivalent of ".", reflective of their different function vs method distinction
jenrzzz has quit [Ping timeout: 255 seconds]
<havenwood>
matthewd: I agree it's basically the same principle, just that Ruby's doesn't actually work both ways uniformly so it's tricky.
<matthewd>
I think it's only enviable because no-one hesitates to define their own function designed to take TypeX as the first argument in Elixir, but are very reluctant to do the equivalent in Ruby
<havenwood>
Like in Perl 6 the "." really does suffice to replace the |>
<havenwood>
But since Ruby doesn't mirror the OO and functional way for everything you can't just use it like that.
<havenwood>
Perl 6 or Elixir let you choose which way you'll be calling it, always
<havenwood>
Or F#, etc - whatever langs allow composing in both orders
<havenwood>
'hi'.upcase.puts
lagweezle is now known as lagweezle_away
lagweezle_away is now known as lagweezle
ski7777 has quit [Ping timeout: 248 seconds]
consti has joined #ruby
<matthewd>
I'll grant that the Kernel methods are unusual warts
cdg has joined #ruby
<baweaver>
x => x * 2 is Javascript arrow syntax
<baweaver>
well, some other languages do it too
consti has quit [Client Quit]
mostlybadfly has quit [Quit: Connection closed for inactivity]
bronson has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<RickHull>
matthewd: it's not just kernel methods. let's say I want to "pipe" 2 to Math.sqrt there is no way to chain with '.' such that "sqrt" is at the end
bronson has quit [Ping timeout: 240 seconds]
<RickHull>
ruby makes a big distinction between methods that belong to an object versus methods that take an object as the first arg
<baweaver>
2.yield_self(&Math.method(:sqrt)) :D
<matthewd>
So does Elixir
<matthewd>
In the form of "one of those does not exist"
<matthewd>
(to my understanding?)
<RickHull>
yes, which is why pipe works reliably
<matthewd>
But Ruby also doesn't have two sorts of method
jenrzzz has quit [Ping timeout: 240 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<matthewd>
It occasionally looks like it does, because you choose to ignore the object it's being called on
<matthewd>
Does Elixir have a |>-like operator for "specify the first argument, but 'pipe' the second"? If it does, I'll shut up.
<baweaver>
Currying, it might
polishdub has quit [Quit: leaving]
nymous has joined #ruby
<havenwood>
matthewd: Yeah, it does that with |> so you can do exactly that.
<matthewd>
havenwood: Huh? |> pipes the first argument, not the second
<nymous>
hey folks
<baweaver>
nymous alo
<RickHull>
matthewd: in Elixiry X |> Y(Z) is effectively Y(X, Z)
<nymous>
i need an advice on concurrency
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
jenrzzz has joined #ruby
<havenwood>
matthewd: maybe i misunderstood what you meant - they take the first argument from the left but you can provide subsequent arguments
<havenwood>
what RickHull said
<nymous>
never did much in that direction
<havenwood>
nymous: as away@
<havenwood>
ask away~*
<matthewd>
RickHull: Yes. My question is whether there is an operator Q that will X Q Y(Z) --> Y(Z, X)
<nymous>
away@?
<baweaver>
Ask ze question
<matthewd>
Because I claim that's what's being asked of Ruby
<baweaver>
get ze answer
<havenwood>
nymous: Typo correction, I just meant please go ahead and ask. :-)
<nymous>
ah, sure)
<elomatreb>
Maybe away does know a lot about concurrency though, we'll never know, as they are away
<RickHull>
matthewd: not that I'm aware of, but |> is what Ruby cannot provide
<nymous>
so, i'm writing a small library for collecting metrics
<RickHull>
because ruby distinguishes between 5.to_s and to_s(int)
<nymous>
so an app using my lib should describe which metrics it wants and how to get
<nymous>
i mean like "get json from there, parse, save as metric named whatever"
<matthewd>
RickHull: Does Elixir not distinguish to_s(5) and to_s(some_object, 5) ?
<nymous>
the problem is with concurrency part
<nymous>
i mean, external service might just stuck and don't reply forever
<RickHull>
matthewd: Elixir does so in a way that allows |> to be used consistently
<RickHull>
pattern matching on function definitions using typed arguments
GodFather has quit [Ping timeout: 258 seconds]
<nymous>
i wish to run my collector check concurrently with a timeout
<havenwood>
nymous: What kind of Ruby app is this? Rails?
<nymous>
pure ruby with almost non dependencies
<elomatreb>
Random question: Is it safe to have user-supplied format strings for strftime? (In Ruby) If not, what sort of sanitation would be required, if it?
<baweaver>
ETL
<havenwood>
nymous: Rack app?
<baweaver>
Extract Transform Load pipeline
<elomatreb>
*if it isn't
<nymous>
havenwood: rather cli or daemon
<havenwood>
nymous: aha
GodFather has joined #ruby
<nymous>
i plan to support both scenarios
<baweaver>
coffee time
consti has joined #ruby
<matthewd>
RickHull: I think it comes down to inconsistency of definitions in the stdlib (and further), then, rather than a syntax-level constraint
shinnya has joined #ruby
<nymous>
i've tried to implement something like queue executor, and it works, but without any timeout
<RickHull>
matthewd: I wish it did. it has to do with the fact that every ruby method has its receiver as the implicit first argument. and methods are called on receivers
<nymous>
yeah, i'm looking at concurrent-ruby right now
<RickHull>
matthewd: there is no method 2.sqrt
<nymous>
but the only thing which looks good for my attempt is CountDownLatch
<RickHull>
in ruby, Math.sqrt(2) is really sqrt(Math, 2)
<matthewd>
RickHull: Well now I think we're agreeing
jenrzzz has quit [Ping timeout: 240 seconds]
<RickHull>
versus 'foo'.reverse is really reverse(String.new, 'foo')
<matthewd>
|> would be of no use if Elixir had defined a sqrt method that took two arguments and ignored the first
<nymous>
so i need an advices, not sure how to implement my thing
<nymous>
currently, i have metrics groups - blocks of code for collecting metrics
jenrzzz has joined #ruby
mattp_ has quit [Remote host closed the connection]
kapil___ has quit [Quit: Connection closed for inactivity]
mattp_ has joined #ruby
<nymous>
also i think i'll add "renderer" callback to get result and send to whatever
<nymous>
graphite or something like that
<RickHull>
matthewd: when Math.sqrt(2) returns a float, all I can do is call methods defined on a float object
<matthewd>
nymous: We're probably going to need some code to talk about here. Concurrency is hard enough without trying to speak in generalities.
mattp_ has quit [Remote host closed the connection]
<nymous>
i'm thinking of 2 approaches for dealing with it
<RickHull>
whereas I'd like to pass that result to any method that takes a float
<RickHull>
i gotta run
<matthewd>
RickHull: And |> can only pass that result to functions that take a float as the first parameter
travisdouce has joined #ruby
<RickHull>
yes, so Elixir is designed where the first arg takes primacy, and primacy is not split between the receiver and the first arg
<RickHull>
it goes way deeper than stdlid
<RickHull>
stdlib
<matthewd>
My contention is that any Elixir function that takes X as a first argument should equivalently be defined in Ruby as a method on X
<RickHull>
matthewd: ruby's method receivers are a big part of what makes duck typing easy to use
<matthewd>
I don't dispute that Ruby has some very bad examples of methods that don't meet that contract -- but I think they're the problem, not a missing operator
<RickHull>
the impedance mismatch is between typed args and pattern matching, vs duck typing
<nymous>
1. Main thread starts multiple collector threads in a CountDownLatch with timeout, after that, it starts multiple renderer threads with same CountDownLatch also with timeout
<nymous>
2. Main thread starts multiple collector+renderer threads in a CountDownLatch with timeout
<nymous>
i've just been tired of bunches of collector scripts for popular monitoring systems
__Yiota has joined #ruby
<nymous>
they might be anything, python, ruby, bash, nodejs, whatever
kn-928 has joined #ruby
<nymous>
and if you wish to monitor something, you have to deal with all this zoo
jenrzzz has quit [Ping timeout: 248 seconds]
troys is now known as troys_
wpostma has joined #ruby
<nymous>
i plan to use cases - 1. run a collector script by external collector like zabbix or collectd
<nymous>
2. run as a daemon, which sends data somewhere else
<matthewd>
nymous: Okay, so as you've identified, CountDownLatch can be used to identify when all of the things you're waiting for are done
<nymous>
yup
uZiel has quit [Ping timeout: 248 seconds]
<nymous>
it's just a little bit awkward to use a massive lib for a small piece of code
<matthewd>
Are you just asking which of the above two strategies you should use?
<nymous>
well, i'm asking if i'm right with CountDownLatch approach at all, maybe you know a better one
<nymous>
and about strategies too though
goyox86 has joined #ruby
<matthewd>
c-r really isn't that big. You could implement it yourself if you really wanted to, but that doesn't seem like a good idea.
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nymous>
i got several good design points from c-r, like "let it fail" approach
conta1 has joined #ruby
<nymous>
but seems like CountDownLatch doesn't involve actors or something like that at all, it's just very low level algorithm
<matthewd>
Right. concurrent-ruby provides a number of useful low-level concurrency primitives.
wpostma has quit [Ping timeout: 255 seconds]
thinkpad has joined #ruby
QualityAddict has joined #ruby
<nymous>
it's like, idk, i need, for example, a TimerTask primitive, it doesn't seems to combines well with CountDownLatch
conta1 has quit [Ping timeout: 255 seconds]
<nymous>
also, it doesn't look like i can use it with c-r thread pool
ski7777 has joined #ruby
ldnunes has quit [Read error: Connection reset by peer]
<matthewd>
They're primitives, not lego blocks; you can use it anywhere you need a latch that will get counted down... but it's only useful if that's what you need.
ldnunes has joined #ruby
bvcosta has joined #ruby
guille-moe has quit [Remote host closed the connection]
consti has joined #ruby
guille-moe has joined #ruby
cschneid_ has quit [Remote host closed the connection]
cschneid_ has joined #ruby
chmuri has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
ski7777 has quit [Ping timeout: 240 seconds]
ur5us_ has joined #ruby
cschneid_ has quit [Ping timeout: 248 seconds]
ur5us has quit [Read error: Connection reset by peer]
tcopeland has joined #ruby
cdg_ has joined #ruby
guille-moe has quit [Ping timeout: 248 seconds]
cdg has quit [Ping timeout: 260 seconds]
John__ has quit [Read error: Connection reset by peer]
cdg_ has quit [Ping timeout: 240 seconds]
consti has quit [Quit: consti]
chmurifree has joined #ruby
marr has quit [Ping timeout: 264 seconds]
kn-928 has quit [Quit: WeeChat 1.9.1]
kn-928 has joined #ruby
jenrzzz has quit [Ping timeout: 248 seconds]
<nymous>
well, looks like i should go with first approach - collect, sync, render, sync
<nymous>
countdownlatch looks promising to me, but still unsure how to use it with a thread pool
roamingdog has joined #ruby
<matthewd>
Well, what do you want each pool task to do?
<matthewd>
And what do you want the main thread to do?
<nymous>
main thread would be collect, sync, render, sync, repeat
<matthewd>
Doesn't sound like there's much left for the pool to do if the main thread's doing all that
<nymous>
but i don't know how many threads would i have for collect and render - because they are user defined
<nymous>
a thread pool is for collector and renderer threads
<nymous>
to not spawn say 100 threads if user will told so
<matthewd>
So the main thread isn't collecting after all
<nymous>
no, i guess
<nymous>
it might do saving / loading
<nymous>
but i don't plan to make it concurrent
consti has joined #ruby
<nymous>
load cache, collect, sync, render, sync, save cache
humanBird has joined #ruby
<nymous>
something like that
<humanBird>
/usr/local/Homebrew/Library/Homebrew/brew.rb:12:in `<main>': Homebrew must be run under Ruby 2.3! (RuntimeError)
<humanBird>
anti social error messages are anti social :(
<matthewd>
nymous: So it sounds like the main thread might be doing something more like: "allocate collection tasks to the pool, wait for those tasks to complete, .."
<humanBird>
brew install maven caused this error
<nymous>
matthewd: yes, it is intended to do that, countdownlatch is just an approach to run multiple threads with shared timeout
<elomatreb>
humanBird: Are you sure homebrew is actually using that Ruby? If there is an older version somewhere it might still be using that
<humanBird>
how can I check this?
<elomatreb>
Are you using something like a ruby switcher/version manager?
<matthewd>
nymous: No, CountDownLatch is an approach to have a latch that counts down before it releases. I'm trying to get you to a solution, but if you're already there, I'm not sure what more I can offer.
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<nymous>
matthewd: i mean i want to run say 20 threads with shared timeout of 30 seconds. if some of them didn't pass, they should just die. i've checked several solutions for that problem and the only one i think can do the thing is a countdownlatch
<matthewd>
nymous: Can you describe, in your own words, what you understand CountDownLatch will do?
orbyt_ has joined #ruby
consti has quit [Quit: consti]
<nymous>
i'll start it with say 20 and timeout 30, every thread would decrease the latch. also, it has timeout, so, those threads will execute or die within 30 seconds. so i'll return to main thread in 30 seconds or earlier with whatever result
<elomatreb>
So you're using RVM, probably. I don't use OSX, what's the shebang in the homebrew script?
ahrs has joined #ruby
<humanBird>
where is this homebrew script?
<elomatreb>
`which brew` (brew is the executable, right?)
mim1k has joined #ruby
<elomatreb>
Looking at it on Github, nevermind. The gist of my theory: RVM only modifies your current shell environment to make ruby point to the install managed by it, homebrew might not be getting that
<matthewd>
nymous: Oh okay, you're planning on using the wait timeout. Yeah.. that won't actually stop any ongoing work.
<humanBird>
it's ok.
alnewkirk has joined #ruby
<humanBird>
i installed maven from binary
RickHull has quit [Ping timeout: 260 seconds]
mim1k has quit [Ping timeout: 240 seconds]
ldnunes has quit [Quit: Leaving]
sylario has quit [Quit: Connection closed for inactivity]
TomyLobo has quit [Ping timeout: 255 seconds]
roamingdog has quit [Remote host closed the connection]
<nymous>
matthewd: yeah, sound ok, with only one problem, i wish to restrict collector threads to say cpu cores, to not to overheat the cpu with my "background" task