havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.7.0, 2.6.5, 2.5.7: https://www.ruby-lang.org | Paste 4+ lines of text to https://dpaste.de/ and select Ruby as the language | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby | Can't talk? Register/identify with Nickserv first!
Lyubo1 has quit [Ping timeout: 260 seconds]
lucasb has quit [Quit: Connection closed for inactivity]
phage has quit [Ping timeout: 272 seconds]
Guest91988 has quit [Ping timeout: 260 seconds]
Lyubo1 has joined #ruby
fphilipe has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe has quit [Ping timeout: 268 seconds]
sean__ has joined #ruby
sean__ has quit [Client Quit]
my_dude has joined #ruby
Mia has quit [Ping timeout: 272 seconds]
stryek has quit [Quit: Connection closed for inactivity]
fphilipe has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
Mia has joined #ruby
fphilipe has quit [Ping timeout: 260 seconds]
fercell has quit [Quit: WeeChat 2.7]
LtHummus_ has joined #ruby
LtHummus has quit [Ping timeout: 268 seconds]
phage has joined #ruby
citizentwo has joined #ruby
ratah has joined #ruby
zacts has joined #ruby
hays has joined #ruby
fphilipe has joined #ruby
Swyper has joined #ruby
fphilipe has quit [Ping timeout: 268 seconds]
davidw has quit [Ping timeout: 265 seconds]
hays has quit [Quit: http://quassel-irc.org - Chat comfortably. Anywhere.]
sergioro has quit [Quit: leaving]
lxsameer has quit [Quit: WeeChat 2.6]
zacts has quit [Quit: zacts]
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Swyper has quit []
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
citizentwo has quit [Remote host closed the connection]
fphilipe has joined #ruby
davidw has joined #ruby
postmodern has joined #ruby
fphilipe has quit [Ping timeout: 260 seconds]
s3nd1v0g1us has quit [Ping timeout: 272 seconds]
nowhere_man has quit [Ping timeout: 272 seconds]
nowhere_man has joined #ruby
fphilipe has joined #ruby
cd has quit [Quit: cd]
duderonomy has joined #ruby
ratah has quit [Quit: leaving]
fphilipe has quit [Ping timeout: 272 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sagax has quit [Quit: Konversation terminated!]
sagax has joined #ruby
sagax has quit [Client Quit]
mokha has quit [Quit: mokha]
jenrzzz has quit [Ping timeout: 272 seconds]
duderonomy has joined #ruby
fphilipe has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
TvL2386_ has quit [Ping timeout: 240 seconds]
duderonomy has quit [Read error: Connection reset by peer]
fphilipe has quit [Ping timeout: 272 seconds]
duderonomy has joined #ruby
fphilipe has joined #ruby
TvL2386 has joined #ruby
davidw has quit [Ping timeout: 272 seconds]
fphilipe has quit [Ping timeout: 260 seconds]
fphilipe has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
fphilipe has quit [Ping timeout: 272 seconds]
nowhere_man has quit [Ping timeout: 272 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 240 seconds]
pama has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
TvL2386 has quit [Ping timeout: 268 seconds]
norge has joined #ruby
houhoulis has quit [Remote host closed the connection]
TvL2386 has joined #ruby
alfiemax has joined #ruby
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 268 seconds]
bsdbandit-01 has joined #ruby
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 240 seconds]
cesario has joined #ruby
cthulchu_ has joined #ruby
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
LtHummus_ has quit [Quit: ZNC 1.7.5 - https://znc.in]
jenrzzz has joined #ruby
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 265 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
gix has quit [Ping timeout: 240 seconds]
cthulchu_ has quit [Ping timeout: 265 seconds]
norge has quit [Ping timeout: 240 seconds]
duderonomy has joined #ruby
fphilipe has joined #ruby
duderonomy has quit [Client Quit]
fphilipe has quit [Ping timeout: 240 seconds]
darkstardev13 has joined #ruby
raven__ has quit [Read error: Connection reset by peer]
ur5us has quit [Ping timeout: 240 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 265 seconds]
jenrzzz has joined #ruby
nowhere_man has joined #ruby
duderonomy has joined #ruby
sergioro has joined #ruby
sagax has joined #ruby
alfiemax has quit [Remote host closed the connection]
nowhere_man has quit [Ping timeout: 272 seconds]
alfiemax has joined #ruby
fphilipe has joined #ruby
donofrio has quit [Remote host closed the connection]
fphilipe has quit [Ping timeout: 272 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 272 seconds]
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 272 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 272 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TzilTzal has joined #ruby
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 260 seconds]
TzilTzal has quit [Remote host closed the connection]
ur5us has joined #ruby
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 272 seconds]
sergioro has quit [Quit: leaving]
fphilipe has joined #ruby
LtHummus has joined #ruby
TzilTzal has joined #ruby
jmcgnh has quit [Read error: Connection reset by peer]
TzilTzal has quit [Ping timeout: 268 seconds]
alfiemax has quit [Remote host closed the connection]
TzilTzal has joined #ruby
jmcgnh has joined #ruby
alfiemax has joined #ruby
fig-le-deunch has joined #ruby
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
duderonomy has joined #ruby
cnsvc has quit [Quit: WeeChat 2.7]
schne1der has joined #ruby
orbyt_ has joined #ruby
mike32 has joined #ruby
jenrzzz has joined #ruby
TzilTzal has quit [Remote host closed the connection]
TzilTzal has joined #ruby
sauvin has joined #ruby
alfiemax has quit [Remote host closed the connection]
my_dude has quit [Ping timeout: 265 seconds]
alfiemax has joined #ruby
plutes has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
plutes has joined #ruby
mike32 has left #ruby ["WeeChat 2.7"]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
akemrir has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
my_dude has joined #ruby
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
jenrzzz has quit [Ping timeout: 272 seconds]
duderonomy has joined #ruby
TzilTzal has quit [Remote host closed the connection]
duderonomy has quit [Client Quit]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
my_dude has quit [Ping timeout: 246 seconds]
duderonomy has joined #ruby
duderonomy has quit [Client Quit]
alfiemax has quit [Remote host closed the connection]
fphilipe has quit [Ping timeout: 272 seconds]
schne1der has quit [Ping timeout: 260 seconds]
jenrzzz has joined #ruby
TzilTzal has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
alfiemax has joined #ruby
DaRock has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Read error: Connection reset by peer]
jenrzzz has joined #ruby
clemens3 has quit [Quit: typo..]
fercell has joined #ruby
xco has joined #ruby
alfiemax has quit [Remote host closed the connection]
xco has quit [Client Quit]
plutes has quit [Remote host closed the connection]
alfiemax has joined #ruby
dionysus69 has joined #ruby
nowhere_man has joined #ruby
schne1der has joined #ruby
fphilipe has joined #ruby
TzilTzal has quit []
jhass has quit [Quit: Bye]
Tempesta has quit [Quit: AdiIRC is updating to v3.8 Beta Build (2020/02/17 UTC) 64 Bit]
fphilipe has quit [Ping timeout: 260 seconds]
clemens3 has joined #ruby
jhass has joined #ruby
akemhp has quit [Ping timeout: 240 seconds]
Tempesta has joined #ruby
fphilipe has joined #ruby
conta has joined #ruby
conta has quit [Remote host closed the connection]
conta has joined #ruby
evdubs has quit [Remote host closed the connection]
evdubs has joined #ruby
nowhere_man has quit [Ping timeout: 272 seconds]
nowhere_man has joined #ruby
clemens3 has quit [Read error: No route to host]
nowhere_man has quit [Ping timeout: 272 seconds]
clemens3 has joined #ruby
buckworst has joined #ruby
buckworst has quit [Client Quit]
clemens3 has quit [Quit: WeeChat 2.1]
clemens3 has joined #ruby
fig-le-deunch has quit [Quit: Konversation terminated!]
cisco has joined #ruby
cisco is now known as Guest83117
davidscheck_ has joined #ruby
mikecmpbll has joined #ruby
conta has quit [Quit: conta]
ur5us has joined #ruby
riceandbeans has quit [Quit: rebooting]
conta has joined #ruby
royal_screwup21 has joined #ruby
davidscheck_ has quit [Quit: Leaving]
pythdasch has joined #ruby
Frobozz has joined #ruby
Arahael has quit [Ping timeout: 260 seconds]
conta has quit [Quit: conta]
donofrio has joined #ruby
cesario has quit [Quit: My MacBook Air has gone to sleep. ZZZzzz…]
pama has joined #ruby
ur5us has quit [Ping timeout: 240 seconds]
royal_screwup21 has quit [Remote host closed the connection]
kinduff has joined #ruby
kinduff has joined #ruby
kinduff has quit [Changing host]
Fernando-Basso has joined #ruby
Guest83117 has quit [Quit: leaving]
cisco has joined #ruby
Furai has quit [Quit: WeeChat 2.7]
Furai has joined #ruby
phaul has quit [Ping timeout: 265 seconds]
phaul has joined #ruby
Arahael has joined #ruby
phage has joined #ruby
phage has quit [Client Quit]
TomyWork has joined #ruby
alexherbo2 has joined #ruby
phage has joined #ruby
fphilipe has quit [Ping timeout: 265 seconds]
Arahael has quit [Ping timeout: 240 seconds]
wald0 has joined #ruby
wald0 has quit [Client Quit]
robotmay has quit [Ping timeout: 268 seconds]
TomyWork has quit [Ping timeout: 256 seconds]
robotmay has joined #ruby
cisco has quit [Ping timeout: 265 seconds]
robotmay has quit [Ping timeout: 265 seconds]
robotmay has joined #ruby
phage has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
markopasha has joined #ruby
conta has joined #ruby
robotmay has quit [Ping timeout: 240 seconds]
robotmay has joined #ruby
alexherbo2 has quit [Ping timeout: 268 seconds]
conta has quit [Quit: conta]
conta has joined #ruby
fphilipe has joined #ruby
tonystarkco has joined #ruby
kinduff has quit [Remote host closed the connection]
burningserenity has joined #ruby
phage has joined #ruby
phage has quit [Read error: Connection reset by peer]
TomyWork has joined #ruby
tosaraja has joined #ruby
LinuxKnight has joined #ruby
<tosaraja> Anyone familiar with net-ldap? I'm having an environment where LDAP works with 0.12.1, 0.14.0, 0.15.0, but not 0.13.0 nor 0.16.x
<tosaraja> and naturally OpenNebula installs 0.16.x breaking my LDAP ;)
alexherbo2 has joined #ruby
alexherbo2 has quit [Ping timeout: 260 seconds]
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
endorama has joined #ruby
alexherbo2 has joined #ruby
_phaul has joined #ruby
cisco has joined #ruby
cisco is now known as Guest80809
phaul has quit [Ping timeout: 240 seconds]
schne1der has quit [Ping timeout: 272 seconds]
john2496 has joined #ruby
postmodern has quit [Quit: Leaving]
alfiemax has quit [Remote host closed the connection]
lucasb has joined #ruby
john2496 has quit [Ping timeout: 260 seconds]
rdk has joined #ruby
<rdk> Could anyone help here to solve this problem that we are trying to solve - https://stackoverflow.com/questions/57136335/comparing-array-of-hashes-with-regex-in-ruby So far answer given is not working for us.
<rdk> Thanks in advance!
alfiemax has joined #ruby
alfiemax has quit [Ping timeout: 240 seconds]
<afisher> is rubygems 3.0.7 borked?
<afisher> it appears rvm can't install it anyway
Guest80809 has quit [Quit: leaving]
drincruz_ has joined #ruby
simonfromspace has joined #ruby
pythdasch has quit [Quit: Leaving]
LtHummus_ has joined #ruby
LtHummus has quit [Ping timeout: 240 seconds]
<afisher> https://github.com/rubygems/rubygems/issues/3139 is the issue I opened and it looks like a 3.0.8 may be released soon to fix the regression. :)
schne1der has joined #ruby
minall has joined #ruby
<minall> Hello Ruby community!
<minall> Why would I use print instead of puts?
<al2o3-cr> minall: if you don't want a newline added.
<havenwood> minall: Options include #print, #p, and #warn.
<minall> Thanks!, I made some examples by it
<minall> I'll continue studying and come If I need help
<havenwood> minall: #print doesn't add a newline, like al2o3-cr said. #p adds a newline, but also an #inspect for debugging. #warn also adds a newline, but prints to stderror instead of stdout.
hoijui has joined #ruby
<havenwood> minall: #abort prints to stderr with a newline, like #warn, but also exits with an error status like: exit 1
<al2o3-cr> havenwood: i didn't say print adds a newline?
<havenwood> al2o3-cr: I haven't had coffee. Omits I meant.
<minall> lol
<al2o3-cr> havenwood: oh, nvm ;)
<minall> Thanks!
zacts has joined #ruby
<havenwood> The #pp is particularly handy too, now that it's required by default.
<havenwood> a prettier print for debugging :)
<minall> oh, NodeVersionManager?
<minall> I'll have that in mind when I'm debuggin
<havenwood> &>> pp({aim: true})
<rubydoc> # => {:aim=>true}... check link for more (https://carc.in/#/r/8kyy)
chalkmonster has joined #ruby
millerti has joined #ruby
<simonfromspace> can someone please ELI5 the difference between exlcude and include?
<simonfromspace> regarding Modules and Classes, of course.
<havenwood> simonfromspace: exclude isn't a thing
<havenwood> simonfromspace: ah, I think you mean #extend
<havenwood> simonfromspace: include and prepend are most often used within a class to make the instance methods of the included module also instance methods of the class.
<havenwood> simonfromspace: prepend just differs from include in that it puts the methods *in front* of a method by the same name in the including class.
<havenwood> simonfromspace: if you use #module_function in the module you're including via #include or #prepend, then the included instance methods will be private, not publicly exposed on instances of the class.
<havenwood> simonfromspace: #extend is used less often than #include, since it extends instance methods to be class methods on the extending class.
<havenwood> simonfromspace: So you have Klass and ExtendMe. Inside Klass, you `extend ExtendMe` and you can then do `Klass.method_from_extend_me` as a class method on Klass.
<havenwood> simonfromspace: Which is used less often than Klass with IncludeMe. With #include, inside Klass you `include IncludeMe` and you can then do `Klass.new.included_method` as an instance method on Klass.
ttoocs has quit [Ping timeout: 246 seconds]
<havenwood> simonfromspace: Does that make any sense?
towo_ has quit [Quit: I am the vanguard of your destruction. This exchange is over.]
duderonomy has joined #ruby
towo has joined #ruby
dStromboli has quit [Ping timeout: 272 seconds]
ThibG has left #ruby ["Leaving"]
dStromboli has joined #ruby
leitz has joined #ruby
<TomyWork> hnnnng, why can # encoding: utf-8 not be in line 3
<simonfromspace> havenwood, sorry yeah I meant extend. Thank you so much for that! It makes sense and I'll come back a couple times to refer back to your ELI5. Arigato!!!
<havenwood> TomyWork: Magic comments are finicky.
<TomyWork> yeah, and that to figure out that i have an ancient ruby version that doesnt default to utf-8 in the first place... cost me an hour
<TomyWork> i was about to ask something stupid like "does ruby 1.9.3 support +="?
<TomyWork> i was about to ask something stupid like "does ruby 1.9.3 support += on strings?"
<TomyWork> old ruby versons are also finicky
Kuukunen- has quit [Ping timeout: 248 seconds]
cthulchu_ has joined #ruby
<havenwood> I do use solargraph, but so look forward to integrated autocomplete that's even smarter.
<adam12> havenwood: neat! what editor are you using?
<havenwood> adam12: i've been trying VSCode
chalkmonster has quit [Quit: WeeChat 2.7]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
<zacts> will ruby 2.* still live alongside ruby 3.*, or will ruby3 make ruby2 obsolete for new applications?
<zacts> (I'm hoping it's not going to be like python2 and python3)
<adam12> zacts: Pretty sure matz has no interest in a python2/python3 scenario (akin to the Ruby 1.8 and 1.9 scenario of past)
chalkmonster has joined #ruby
<zacts> cool
chalkmonster has quit [Client Quit]
<adam12> zacts: The Ruby 3 breaking changes look much smaller right now (keyword args mostly?)
<zacts> how will Ruby 3 handle concurrency?
<adam12> zacts: There's talks about the new guilds making it in; but who knows if they will be ready. There's ongoing work around fibers which might make for them to be more common / popular vs threads or processes.
<zacts> ah ok, cool
<adam12> zacts: Fibers are already in some use, but they need to wrap IO primitives and that's ongoing.
davidw has joined #ruby
<adam12> zacts: And of course, optional gradual types.
<zacts> (note: I'm just curious. I don't know how to program for concurrency quite yet, but I'm curious as to what is out there)
<zacts> I have heard of fibers, but I wanted to see if something new was in the brew
<zacts> but sounds like improvements to fibers for sure, but potentially guilds (but no promise for them)
<adam12> zacts: Multiple options, all with pros/cons. A lot of it depends on the workload expected.
<zacts> cool
tonystarkco has quit [Quit: leaving]
<havenwood> zacts: These concurrency reports are a great way to catch up on the plan: https://www.codeotaku.com/journal/2019-12/ruby-concurrency-progress-report/index
<havenwood> zacts: If Matz feels we're ready for 3.0 this year, 2.8 will be renamed 3.0 and be released on Christmas.
fercell has quit [Quit: WeeChat 2.7]
<havenwood> zacts: I agree with adam12 that it's definitely not a Python 2/3 situation and that keyword behavior appears to be the largest change.
<havenwood> zacts: You can use Async and Falcon now. Isolates (Guilds) aren't ready yet.
splud_wurk has joined #ruby
zacts has quit [Quit: zacts]
rdk has quit [Remote host closed the connection]
dionysus69 has quit [Quit: dionysus69]
howdoi has joined #ruby
<havenwood> Isolates just require building Ruby to take a peek: https://gist.github.com/havenwood/9540f1b1b03902360666e62785715483
TomyWork has quit [Ping timeout: 256 seconds]
mikecmpbll has quit [Remote host closed the connection]
ChmEarl has joined #ruby
zacts has joined #ruby
bsdbandit-01 has quit [Ping timeout: 240 seconds]
citizentwo has joined #ruby
ewanchic has quit [Quit: Leaving.]
ewanchic has joined #ruby
royal_screwup21 has joined #ruby
orbyt_ has joined #ruby
ewanchic has quit [Ping timeout: 260 seconds]
orbyt_ has quit [Client Quit]
bsdband50 has joined #ruby
ewanchic has joined #ruby
cd has joined #ruby
ewanchic has quit [Client Quit]
ewanchic has joined #ruby
LinuxKnight has quit [Ping timeout: 240 seconds]
citizentwo has quit [Remote host closed the connection]
citizentwo has joined #ruby
siery has joined #ruby
bsdband50 has quit [Ping timeout: 272 seconds]
fphilipe has quit [Ping timeout: 265 seconds]
bsdbandit-01 has joined #ruby
dStromboli has quit [Ping timeout: 272 seconds]
dStromboli has joined #ruby
rippa has joined #ruby
royal_screwup21 has quit [Remote host closed the connection]
clemens3 has quit [Quit: WeeChat 2.1]
duckpupp- has quit [Remote host closed the connection]
xco has joined #ruby
duckpuppy has joined #ruby
chalkmonster has joined #ruby
conta has quit [Quit: conta]
chalkmonster has quit [Client Quit]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
<simonfromspace> yo, when I make a file, it outputs it in the repo folder. How do I make it output, either inside a folder inside the repo or on the desktop?
zacts has quit [Quit: zacts]
chalkmonster has joined #ruby
<adam12> simonfromspace: Provide a full path to the file you want to write. File.write("/home/simonfromspace/Desktop/thefile", "contents").
<simonfromspace> It's gonna be reviewed by someone and I don't know how their system is organized
<simonfromspace> I thought I'd use this http://github.com/piotrmurach/tty-platform
<simonfromspace> Oh fyi, it's a CLI app
duckpuppy has quit [Remote host closed the connection]
<simonfromspace> Wouldn't the easiest be to output in the same repo?
<simonfromspace> Will this work? File.write("../savedfiles/thefile.json", "contents")
<adam12> simonfromspace: That would be relative to the current working directory. If they ran it from / then it would fai.
chalkmonster has quit [Client Quit]
<adam12> simonfromspace: Maybe you want to write it into a folder your CLI owns that's in the XDG directory?
chalkmonster has joined #ruby
duckpuppy has joined #ruby
<simonfromspace> maybe just one dot then
<simonfromspace> I don't know what XDG is, sorry. Let me read on it
chalkmonster has quit [Client Quit]
<jhass> the best answer to will this work is to try it out :)
<jhass> adam12: sounds like a school assignment, probably doesn't have to be the most proper way ;)
<simonfromspace> Yeah, I am on lunch break. Will do it when I get back to my table.
<simonfromspace> But my code reviewers check code like the worlds balance depends on it.
<simonfromspace> I gotta do my best. It's my capstone project for Ruby
chalkmonster has joined #ruby
<simonfromspace> I can do crazy things in Ruby and I still am not sure on basic stuff.
chalkmonster has quit [Client Quit]
<jhass> if it's a cli app, how about requring an argument to specify where to write the file to?
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
chalkmonster has joined #ruby
minall has quit [Remote host closed the connection]
millerti has quit [Quit: Textual IRC Client: www.textualapp.com]
snuz has joined #ruby
chalkmonster has quit [Client Quit]
chalkmonster has joined #ruby
chalkmonster has quit [Client Quit]
dStromboli has quit [Ping timeout: 260 seconds]
ChmEarl has quit [Read error: Connection reset by peer]
LtHummus_ has quit [Ping timeout: 272 seconds]
chalkmonster has joined #ruby
dStromboli has joined #ruby
yan13to has joined #ruby
ChmEarl has joined #ruby
<simonfromspace> adam12, jhass the single dot worked for now
<simonfromspace> i think this is best for this project
teclator has quit [Ping timeout: 260 seconds]
LtHummus has joined #ruby
teclator has joined #ruby
tdy has quit [Quit: WeeChat 1.9.1]
jenrzzz has quit [Ping timeout: 272 seconds]
zacts has joined #ruby
yan13to has quit [Quit: leaving]
leitz has quit [Quit: Leaving]
code_zombie has joined #ruby
markopasha has quit [Remote host closed the connection]
hiroaki has joined #ruby
zacts has quit [Quit: zacts]
gix has joined #ruby
chalkmonster has quit [Quit: WeeChat 2.7]
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
xco has joined #ruby
tdy has joined #ruby
smurfke has joined #ruby
sauvin has quit [Read error: Connection reset by peer]
code_zombie_ has joined #ruby
code_zombie has quit [Ping timeout: 240 seconds]
xpitr has quit [Changing host]
xpitr has joined #ruby
bvdw has quit [Read error: Connection reset by peer]
bvdw has joined #ruby
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<simonfromspace> If you were asked to write unit tests for a scraper, what would you even test for exactly? I can't think of anything.
<apotheon> simonfromspace: test for accurace of what it scrapes by having a local "webpage" in your test fixtures that you scrape and compare results against your test condition
<apotheon> s/accurace/accuracy/
<simonfromspace> oh nice
<apotheon> You don't need to hurry so much that it becomes an accuRACE.
<apotheon> Yeah, I test-drive the shit out of my code, so I think I'm pretty okay at coming up with test designs.
ur5us has joined #ruby
<apotheon> I test-drive C.
<simonfromspace> apotheon, nice to meet you, test master
<apotheon> har
<apotheon> If you want to hire me for a job with that title, I'm game.
<apotheon> I really like test-driving, and I really like refactoring. I find them fun.
<havenwood> simonfromspace: I agree with a local file to test the content parsing of what would really be remote. You can replay web requests, but seems no need to test the HTTP client here: https://github.com/vcr/vcr
<apotheon> Also, a job with "master" in the title typically pays well.
<simonfromspace> This is a Ruby question, so on some of these pages, the magnet or some other item may not be available. How do I skip to the next one elegantly?
<simonfromspace> Thanks for VCR. I'll try to figure out how to use it.
<apotheon> I used the crap out of VCR on a project two employers ago.
<simonfromspace> https://i.imgur.com/FckseyZ.png <---> This is a Ruby question, so on some of these pages, the magnet or some other item may not be available. How do I skip to the next one elegantly?
<simonfromspace> apotheon, you must be a Super Senior Dev
cliluw has quit [Quit: Leaving]
cliluw has joined #ruby
<simonfromspace> if it gets a nil response or error from the page, I want it to put a default value, maybe. any thoughts?
<havenwood> simonfromspace: Are you familiar with the lonely person operator?
<havenwood> &>> nil&.foo&.bar
<rubydoc> # => nil (https://carc.in/#/r/8l02)
<havenwood> simonfromspace: This looks like a longly person sitting crosslegged staring at a dot on the floor: &.
<havenwood> simonfromspace: Instead of `.` between methods, you can use `&.` to return `nil` when called on `nil` as the receiver.
<havenwood> simonfromspace: It's more common to call such a thing a "safe navigation operator."
fphilipe has joined #ruby
<apotheon> simonfromspace: I might eliminate some of the duplication in the code in that image by use of tap, by the way.
<apotheon> Too-long lines of code thanks to duplicated code kinda drives me batty sometimes.
<havenwood> simonfromspace: Instead of `(0..itemcount).each do` you can use `itemcount.times do`.
<apotheon> havenwood: You've been cemented in my mind as a good resource for info that hasn't crept into my coding cave yet.
<apotheon> Oh, yeah, I totally didn't even notice the (0..itemcount) part.
<havenwood> simonfromspace: I agree with apotheon that you should DRY out the `@parsed_page.css('tr.forum_header_boarder')`. Maybe start with a local variable?
<havenwood> simonfromspace: Then DRY up the `thread_posts`s portion too.
<havenwood> simonfromspace: Consider `.first` in place of `[0]`.
<havenwood> simonfromspace: Show us more code if you'd like more feedback?
<havenwood> (Are you allowed to get outside code reviews?)
<apotheon> havenwood: I thought about "local variable", but . . . I like tap, too.
<havenwood> apotheon: Or #then, when appropriate. :)
<havenwood> &>> 42.then { Float _1 }
<rubydoc> # => 42.0 (https://carc.in/#/r/8l09)
akemhp has joined #ruby
<havenwood> apotheon: I also like #tap and #then.
<leftylink> also that's a map
<leftylink> not an eac
<havenwood> leftylink: Yeah, was thinking how to say since unsure if @output already had anything in it?
<leftylink> even if it did, it's still to be a map
<havenwood> leftylink: I actually really seldom use #each.
fphilipe has quit [Ping timeout: 240 seconds]
<havenwood> Everything is a #map!
<havenwood> simonfromspace: @output = Array.new item_count do |x|
<havenwood> &>> Array.new(5) { rand }
<rubydoc> # => [0.7527483832325236, 0.5851293963958306, 0.7440047169026562, 0.8837207676000729, 0.5676242236050947] (https://carc.in/#/r/8l0e)
<havenwood> leftylink: I like `Array.new` over `item_count.times.map` slightly.
<leftylink> o
<havenwood> (Just to save a single intermediary Enumerator and a method call.)
<havenwood> I think we should stop teaching #each.
<havenwood> ;)
xco has joined #ruby
<CommunistWolf> I used zip in a valid context today \o/ /o\ \o/
<havenwood> CommunistWolf: Nice! Zipping along!
<CommunistWolf> doesn't happen often
<havenwood> CommunistWolf: I #zip more than I #each, which seems counterintuitive.
<havenwood> Or maybe more like as much?
<CommunistWolf> we could always do a golang and just have #for
<CommunistWolf> squeeze everything into that
<havenwood> CommunistWolf: nnooooooooo
<havenwood> &>> 'nnooooooooo'.squeeze
<rubydoc> # => "no" (https://carc.in/#/r/8l0l)
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
darkstardevx has quit [Remote host closed the connection]
darkstardevx has joined #ruby
<ytti> when ever i think of golang, i think of what linus said about svn's slogan of 'cvs done right'
<ytti> because golang is kinda like c done right, and similarlyt like you can't do cvs right, you can't do c right
<ytti> and simialrly like c, golang is full of bad NIH code, because the langauge itself offers so little out-of-the-box
<ytti> by design
<CommunistWolf> nah, go doesn't compete with C
<ytti> legit design philosophy, but one i don't subscribe to
<ytti> i don't mean it competes against c, of course it doesn't in all apllications due to GC
<CommunistWolf> that's zig's job
<ytti> and runtime
<ytti> but it is similar language and takes lot from c
<ytti> and the authors like c adn think c is good language
<ytti> sand they think it's advantage that the language is simple and contains very little
<ytti> because their argument is, then it's easier to employ developers
<CommunistWolf> thing is, go's stdlib is very comprehensive
<ytti> when they have simpler language to master, you can train them faster
<ytti> i disagree
<CommunistWolf> and in many cases better than ruby's
<ytti> not compared to ruby, rust or kotlin
<CommunistWolf> dunno about kotlin, but otherwise yes
<ytti> types have much fewer functions/methods than any of them
<CommunistWolf> wasn't really intending to get into a language war though
<ytti> i maen you can count this
<ytti> it's not like it's debate
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
* ewanchic watches two snow creatures: a yetti and a cold wolf, discuss the unique elegance of different languages.
zacts has joined #ruby
cd has quit [Quit: cd]
hoijui has quit [Ping timeout: 246 seconds]
drincruz_ is now known as drinceruz
drinceruz is now known as drincruz
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
coffeex3 has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
lxsameer has joined #ruby
<ewanchic> I hate to ask and run, but I installed Gemirro last night (Gem Server Mirror), and I wont download gems to my local system. I get: WARNING: Unable to pull data from 'http : //gems.wanchic.com/' : bad response Bad Gateway 502 (http : //gems.wanchic.com/specs.4.8.gz)
<ewanchic> What I did is I linked it up with Nginx. The webserver works, I get websites and the list from the website (local website, gems.wanchic.com, sorry it's not public). I test it on my local machine with ping and curl. It all works. I modified config.rb and loaded (and download) lost of gems. Finally I added the line that gemirro gave on the local website, 'gem sources -a http://gems.wanchic.com/', So I know that is in there.
<ewanchic> Any ideas I can try? Everything is in a local network environment. I figure that has to be one more thing I'm missing to make this all click and work. Thank for the help!
Mallot1 has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
<Mallot1> Please help. I'm using sinatra and ALL I want to do is get my ApplicationController class actually running. I have a get route for /, but for some reason when I visit it in browser it does not work.
<Mallot1> This should be insanely easy, but i cannot find the answer on the internet. This is my last resory
<Mallot1> *resort
<ewanchic> Mallot1: Did you try http://localhost:3000
<Mallot1> I use localhost:8080 since I set it for port 8080
<Mallot1> Sinatra says it doesn't know this ditty when I visit localhost:8080
<ewanchic> MAllot1: Gothca, what's the error?
<Mallot1> My route is the simple get "/" do
<Mallot1> Can I use pastebin in here?
<Mallot1> oh I'll use dpaste
<Mallot1> Thanks
cliluw has quit [Read error: Connection reset by peer]
cliluw has joined #ruby
duderonomy has quit [Read error: Connection reset by peer]
<Mallot1> ewanchic: ^^
<Mallot1> Ignore it says /hi, it didn't work with / either so I tried hi. Sorry about that
citizentwo has quit [Remote host closed the connection]
<Mallot1> https://dpaste.org/KQXF doesn't have that mistake.
citizentwo has joined #ruby
<ewanchic> Mallot1: out of curiosity, http://127.0.0.1:8080 ? maybe it's finiky although local host should be the same.
<ewanchic> Mallot1: Mac, Windows, or Linux?
<Mallot1> Thanks but same error
<Mallot1> Windows
<Mallot1> Windows 10
<ewanchic> Mallot1: Do you know if your virus scanner/windows firewall are blocking ports?
<Mallot1> It was working in the pas
<Mallot1> t
<Mallot1> Just not this code
duderonomy has joined #ruby
burningserenity has quit [Quit: Leaving.]
<ewanchic> Mallot1: I haven't done anything in sinatra before, sorry. I'm more of a Rails. I actually have to run, I teach class on the hour, and I have to finish this up. Perhaps I can try it on my own machine in 3 hours or so.
<Mallot1> Thanks
duderonomy has quit [Client Quit]
<ewanchic> Mallot1: No problem. If your still around I'll get back with you.
<Mallot1> Alright :)
akemrir has quit [Quit: WeeChat 2.7]
fercell has joined #ruby
duderonomy has joined #ruby
citizentwo has quit [Ping timeout: 240 seconds]
citizentwo has joined #ruby
duderonomy has quit [Client Quit]
xco has joined #ruby
tdy has joined #ruby
bsdbandit-01 has quit [Ping timeout: 272 seconds]
duderonomy has joined #ruby
AnomalyXII has joined #ruby
<simonfromspace> havenwood, apotheon I'm making changes and am implementing the advice you've given
SanguineAnomaly has quit [Ping timeout: 240 seconds]
hoijui has joined #ruby
coffeex3 has quit [Ping timeout: 272 seconds]
AnomalyXII is now known as SanguineAnomaly
bsdbandit-01 has joined #ruby
<Mallot1> hello
<Mallot1> How can I tell ruby where to look for config.ru when I rackup?
<leah2> las last argument?
<leah2> *as
<havenwood> Mallot1: rackup /path/to/config.ru
<havenwood> leah2: I just realized you beat me to the answer. That took me a sec.
<leah2> well i wrote it :P
<leah2> just had to verify it's still true
<Mallot1> Oh :D
<havenwood> leah2: --dir DIR is another option
<Mallot1> I was running it in the app/controllers directory. Thanks! guys
<havenwood> Mallot1: Or: --dir /path/
<havenwood> Mallot1: rackup --dir /path/to/dir/
xco has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<havenwood> Mallot1: "Change to DIR before starting"
<havenwood> Mallot1: See: rackup --help
<Mallot1> So it should be rackup --dir, not rackup?
Arahael has joined #ruby
<havenwood> Mallot1: You have options. Run just `rackup` in the right dir. Run `rackup --dir /right/dir`. Or run. `rackup /right/dir/config.ru`.
<Mallot1> Alright, thanks
<Mallot1> Now I get C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- app/controllers/application_controller.rb (LoadError)
<havenwood> Mallot1: Same result with `--dir DIR`?
<Mallot1> rackup --dirinvalid option: --dirUsage: rackup [ruby options] [rack options] [rackup config]
<havenwood> Mallot1: Have you run `bundle` in the project? Are you using the right Ruby from the directory you're running `rackup` in? Are you running `bundle exec rackup`? Have you run `bundle` already?
<havenwood> Mallot1: rackup --dir "/path/to/the/dir/your/config.ru/is/in"
<havenwood> Mallot1: Ah, never mind me. I'm too used to Puma.
<Mallot1> Alright, just ran bundle. It's running now
<havenwood> Mallot1: Are you using Puma?
<havenwood> Mallot1: Or what's your webserver?
cold_iron has joined #ruby
<Mallot1> "Fetching gem metadata from https://rubygems.org/.........Fetching gem metadata from https://rubygems.org/.Could not find gem 'em/pure_ruby x64-mingw32' in any of the gem sources listedin your Gemfile."
<havenwood> Mallot1: I see Rails in your error output, so I'm assuminng Puma?
<Mallot1> havenwood I am not sure. I just installed Ruby for windows from rubyforwindows.com
zacts has quit [Quit: zacts]
akemhp has quit [Remote host closed the connection]
<havenwood> Mallot1: Are you running an app in Windows that hasn't been run in Windows before? Looks like.
<havenwood> Mallot1: Puma is the default for Rails.
<Mallot1> I'm using sinatra
<havenwood> Mallot1: Oh.
<havenwood> Mallot1: Check the Gemfile for "puma" then?
<Mallot1> Alright
<havenwood> Mallot1: Is there "unicorn", "thin", "puma", "falcon" or any other webserver in the Gemfile?
<Mallot1> thin
<Mallot1> source 'https://rubygems.org'gem 'sinatra'gem 'activerecord', :require => 'active_record'gem 'sinatra-activerecord', :require => 'sinatra/activerecord'gem 'rake'gem 'require_all'gem 'sqlite3'gem 'thin'gem 'shotgun'gem 'pry'gem 'bcrypt'gem 'tux'gem 'rack-flash3'gem 'sinatra-flash'gem 'em/pure_ruby'
<Mallot1> Sorry: https://dpaste.org/Z3ky
<havenwood> Mallot1: See: thin -h
<havenwood> Mallot1: Try running the app with: bundle exec thin --chdir "/path/to/dir"
<Mallot1> okay
<Mallot1> Could not find gem 'em/pure_ruby x64-mingw32' in any of the gem sources listed in your Gemfile.
akemhp has joined #ruby
<Mallot1> Alright, I removed that gem.
<Mallot1> Main issue is "C:/Ruby26-x64/lib/ruby/2.6.0/rubygems/core_ext/kernel_require.rb:54:in `require': cannot load such file -- app/controllers/application_controller.rb (LoadError)"
bsdbandit-01 has quit [Ping timeout: 245 seconds]
<Mallot1> Got it!
<Mallot1> I had to use require_relative on require 'app/controllers/application_controller.rb'
<Mallot1> in my config.ru
<Mallot1> Now what is weird though is that I set my port to 1111, but it's listening on 4567
bsdband70 has joined #ruby
bsdband70 has quit [Max SendQ exceeded]
bsdbandit-01 has joined #ruby
alexherbo2 has quit [Ping timeout: 265 seconds]
alexherbo2 has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
Bounga has joined #ruby
Bounga` has joined #ruby
Bounga has quit [Ping timeout: 245 seconds]
akemhp has quit [Quit: Leaving]
Bounga` is now known as Bounga
Bounga has quit [Remote host closed the connection]
Bounga has joined #ruby
<Mallot1> Hey, what does require_all 'app' do? It requires all the files in a directory right?
<leftylink> first, I will notice
<leftylink> &ri Kernel#require
<leftylink> okay, so that's norma require
<leftylink> &ri Kernel#require_all
<rubydoc> Found no entry that matches class Kernel instance method require_all
<leftylink> no such thing, therefore it must be custom
<leftylink> therefore, it is not possible to answer that question, because we would need to know who and what defiend require_all
<havenwood> Mallot1: From the command line, run: ri require_all
<havenwood> Mallot1: Like leftylink said, it's not a Ruby method, but `ri` will tell you where it's defined.
<Mallot1> I just found the gem
<Mallot1> Thanks guys
<leftylink> you know
<leftylink> I should have known that &ri is named that because there's also a command line tool named that
<leftylink> but I didn't
sagax has quit [Remote host closed the connection]
pinpox- has joined #ruby
pinpox has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
JJonah_ has joined #ruby
TCZ has joined #ruby
pinpox- is now known as pinpox
clemens3 has joined #ruby
clemens3 has quit [Client Quit]
Axy has joined #ruby
clemens3 has joined #ruby
Mia has quit [Ping timeout: 260 seconds]
postmodern has joined #ruby
olddogbarks has joined #ruby
olddogbarks has quit [Client Quit]
davidw has quit [Ping timeout: 260 seconds]
hoijui has quit [Ping timeout: 260 seconds]
schne1der has quit [Ping timeout: 272 seconds]
fphilipe has joined #ruby
fphilipe has quit [Ping timeout: 248 seconds]
davidw has joined #ruby
davidw has quit [Changing host]
davidw has joined #ruby
Rob__ has quit [Ping timeout: 268 seconds]
yan13to has joined #ruby
yan13to has quit [Remote host closed the connection]
code_zombie__ has joined #ruby
code_zombie_ has quit [Ping timeout: 240 seconds]
Bounga has quit [Ping timeout: 248 seconds]
TCZ has quit [Quit: Leaving]
lucasb has quit [Quit: Connection closed for inactivity]
felyp has joined #ruby
<felyp> hey
felyp has quit [Client Quit]
lxsameer has quit [Quit: WeeChat 2.6]
GodFather has quit [Ping timeout: 240 seconds]
olddogbarks has joined #ruby
clemens3 has quit [Quit: WeeChat 2.1]