havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com || Ruby 2.4.1, 2.3.4 & 2.2.7: https://www.ruby-lang.org || Paste >3 lines of text to: https://gist.github.com || Rails questions? Ask in: #RubyOnRails || Logs: https://irclog.whitequark.org/ruby || Books: https://goo.gl/wpGhoQ
micalexander has left #ruby [#ruby]
micalexander has joined #ruby
micalexander has left #ruby [#ruby]
xMopxShell has joined #ruby
whippythellama has quit [Ping timeout: 248 seconds]
solocshaw has joined #ruby
ketan has joined #ruby
solocshaw has quit [Remote host closed the connection]
quobo has quit [Quit: Connection closed for inactivity]
ketan has quit [Ping timeout: 255 seconds]
jak has quit [Remote host closed the connection]
jak has joined #ruby
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
PaulCapestany has quit [Quit: .]
helpa has quit [Remote host closed the connection]
helpa has joined #ruby
PaulCapestany has joined #ruby
nofxx has quit [Ping timeout: 260 seconds]
nofxx has joined #ruby
jud has joined #ruby
clemens3 has quit [Quit: WeeChat 1.0.1]
<al2o3-cr> learner123: https://eval.in/826871 # just for fun, consider using a hash :)
nofxx has quit [Remote host closed the connection]
singer22 has left #ruby ["Leaving"]
nofxx has joined #ruby
ascarter has joined #ruby
solocshaw has joined #ruby
arescorpio has joined #ruby
mim1k has joined #ruby
<V1s1ble> oh man, I missed a crazy spam bot
montanonic has quit [Ping timeout: 248 seconds]
<V1s1ble> anyone actually check out that TOR url?
marr has quit [Ping timeout: 260 seconds]
ascarter has quit [Ping timeout: 240 seconds]
solocshaw has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 240 seconds]
* al2o3-cr eyes are like lead shutters
whippythellama has joined #ruby
gusrub has quit []
cyphase has quit [Ping timeout: 246 seconds]
duderonomy has joined #ruby
whippythellama has quit [Ping timeout: 240 seconds]
solocshaw has joined #ruby
solocshaw has quit [Remote host closed the connection]
jak has quit [Ping timeout: 246 seconds]
jak_ has joined #ruby
jackjackdripper has joined #ruby
jackjackdripper has quit [Client Quit]
cyphase has joined #ruby
linduxed has quit [Ping timeout: 255 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
duderonomy has joined #ruby
nadir has quit [Quit: Connection closed for inactivity]
<V1s1ble> Is there a simple way to flatten an array of hashes into just a hash? For example:
<V1s1ble> [{"web1" => ["firewall","docker","web"]}, {"vpn" => ["firewall", "openvpn"] }}
d^sh has joined #ruby
<V1s1ble> converting that to just a hash with web1 and vpn pointing to those lists
<V1s1ble> Like I'm using a map to generate that first line. In Scala I know I can use flatMap or map + flatten, but flatten in Ruby doesn't seem to have the same effect
jtd has quit [Remote host closed the connection]
mim1k has joined #ruby
jtd has joined #ruby
d^sh_ has quit [Ping timeout: 248 seconds]
mvensky has quit [Quit: mvensky]
<V1s1ble> oh nevermind .. Ruby does have a flat_map
gix- has joined #ruby
gix has quit [Disconnected by services]
<al2o3-cr> V1s1ble: use Enumerable#inject
mim1k has quit [Ping timeout: 248 seconds]
whippythellama has joined #ruby
mniip has quit [Ping timeout: 600 seconds]
<V1s1ble> al2o3-cr, ah..so inject is like reduce where you hand it an empty {} as the accumulator?
<al2o3-cr> yep
<al2o3-cr> >> [{"web1" => ["firewall","docker","web"]}, {"vpn" => ["firewall", "openvpn"]}].inject(:update)
<ruby[bot]> al2o3-cr: # => {"web1"=>["firewall", "docker", "web"], "vpn"=>["firewall", "openvpn"]} (https://eval.in/826873)
swills has quit [Quit: Leaving]
Rr4sT has joined #ruby
solocshaw has joined #ruby
<V1s1ble> al2o3-cr, awesome. That works great. Thanks :)
<al2o3-cr> V1s1ble: yw
whippythellama has quit [Ping timeout: 240 seconds]
amclain has quit [Quit: Leaving]
Cohedrin_ has quit [Ping timeout: 258 seconds]
solocshaw has quit [Remote host closed the connection]
solocshaw has joined #ruby
Cohedrin_ has joined #ruby
charliesome has joined #ruby
solocshaw has quit [Remote host closed the connection]
jak_ has quit [Remote host closed the connection]
jak has joined #ruby
ioSelect has joined #ruby
SteenJobs has joined #ruby
solocshaw has joined #ruby
gizmore|2 has joined #ruby
NeutronStarr has quit [Ping timeout: 240 seconds]
jak_ has joined #ruby
gizmore has quit [Ping timeout: 268 seconds]
jak has quit [Read error: Connection reset by peer]
troys is now known as troys_
whippythellama has joined #ruby
dcunit3d has quit [Ping timeout: 255 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Cohedrin_ has joined #ruby
mim1k has joined #ruby
Joufflu has joined #ruby
rgiscard has joined #ruby
mim1k has quit [Ping timeout: 255 seconds]
whippythellama has quit [Ping timeout: 260 seconds]
dcunit3d has joined #ruby
NeutronStarr has joined #ruby
ketan has joined #ruby
solocshaw has quit [Ping timeout: 255 seconds]
Cohedrin_ has quit [Ping timeout: 255 seconds]
ioSelect has quit [Quit: Going offline, see ya! (www.adiirc.com)]
ketan has quit [Ping timeout: 268 seconds]
Cohedrin_ has joined #ruby
mim1k has joined #ruby
umaaji has joined #ruby
umaaji has quit [Client Quit]
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
HoierM_ has quit [Ping timeout: 248 seconds]
umaaji has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
devtroid has joined #ruby
<devtroid> Hi
<havenwood> devtroid: hi
jak_ has quit [Remote host closed the connection]
Cohedrin_ has quit [Ping timeout: 246 seconds]
jak has joined #ruby
whippythellama has joined #ruby
Cohedrin_ has joined #ruby
guest2017 has joined #ruby
guest2017 has left #ruby [#ruby]
jak has quit [Remote host closed the connection]
jak has joined #ruby
edgr has quit [Quit: ZNC - http://znc.in]
whippythellama has quit [Ping timeout: 260 seconds]
ascarter has joined #ruby
<devtroid> I'm new here.
ionte_ has quit [Ping timeout: 268 seconds]
<devtroid> HOw does this work?
<devtroid> Good topics?
<devtroid> Jobs? New tech?
<havenwood> devtroid: Ruby!
<devtroid> I know, but more specific.
<devtroid> havenwood, Are u a pro dev?
ascarter_ has joined #ruby
ascarter has quit [Ping timeout: 260 seconds]
<havenwood> devtroid: it's what i get paid to do, yes
<devtroid> I'm just a junior rub dev.
<devtroid> Working with rails
<havenwood> devtroid: welcome
<devtroid> Thanks.
<havenwood> mruby 1.3.0 was just released, in Ruby news
<devtroid> I wanna know ruby web around the world
<havenwood> Or at least it was tagged. Release soon!: http://mruby.org/
<devtroid> mruby?
jameser has joined #ruby
<havenwood> devtroid: It's a lightweight implementation of Ruby that can be embedded like Lua.
<havenwood> devtroid: https://github.com/mruby/mruby
<havenwood> devtroid: Here's mruby running in the browser, for one example: https://joshnuss.github.io/mruby-web-irb/
Cohedrin_ has quit [Ping timeout: 246 seconds]
<havenwood> devtroid: Or running on Nginx (quite fast): https://github.com/matsumotory/ngx_mruby
<havenwood> devtroid: See for example, mgx_mruby at ~380k json requests served per second: https://www.techempower.com/benchmarks/#section=data-r14&hw=ph&test=json
<havenwood> That even beats Roda with Sequal and Puma on MRI at ~193k requests per second.
<havenwood> <3 Roda
mim1k has joined #ruby
jak_ has joined #ruby
jak has quit [Read error: Connection reset by peer]
<devtroid> havenwood, R u senior or slt?
jak_ has quit [Remote host closed the connection]
<havenwood> devtroid: What's slt?
jak_ has joined #ruby
<devtroid> havenwood, something like that* haha
mim1k has quit [Ping timeout: 255 seconds]
* havenwood must leave in search of food
<devtroid> ?
<havenwood> dinner
<devtroid> havenwood: Now? Here is late at night
Cohedrin_ has joined #ruby
br0d1n has quit [Quit: Leaving]
montanonic has joined #ruby
ionte has joined #ruby
whippythellama has joined #ruby
mim1k has joined #ruby
<devtroid> havenwood: Where do u work?
mim1k has quit [Ping timeout: 248 seconds]
devtroid has quit [Quit: Leaving]
Cohedrin_ has quit [Ping timeout: 255 seconds]
whippythellama has quit [Ping timeout: 248 seconds]
knight33 has joined #ruby
Rr4sT has quit [Quit: Connection closed for inactivity]
Cohedrin_ has joined #ruby
Rodya_ has quit [Remote host closed the connection]
Dimik has quit [Ping timeout: 248 seconds]
cschneid has quit [Ping timeout: 276 seconds]
isBEKaml has left #ruby [#ruby]
ascarter_ has quit [Ping timeout: 268 seconds]
ascarter has joined #ruby
nullfxn has joined #ruby
cschneid has joined #ruby
claw has quit [Ping timeout: 255 seconds]
gix- has quit [Ping timeout: 255 seconds]
ahrs has quit [Remote host closed the connection]
claw has joined #ruby
gix has joined #ruby
nadir has joined #ruby
ahrs has joined #ruby
ascarter has quit [Ping timeout: 268 seconds]
Cohedrin_ has quit [Read error: Connection reset by peer]
cschneid_ has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
duderonomy has quit [Ping timeout: 246 seconds]
Cohedri__ has joined #ruby
mim1k has joined #ruby
Tempesta has quit [Quit: AdiIRC is updating to v2.9 Beta Build (2017/07/03-1) 64 Bit]
Tempesta has joined #ruby
dasher00 has quit [Ping timeout: 276 seconds]
cschneid_ has quit [Ping timeout: 246 seconds]
cschneid has quit [Ping timeout: 246 seconds]
mim1k has quit [Ping timeout: 255 seconds]
cadillac_ has quit [Ping timeout: 260 seconds]
dasher00 has joined #ruby
jak has joined #ruby
shinnya has joined #ruby
cschneid has joined #ruby
cadillac_ has joined #ruby
jak_ has quit [Ping timeout: 255 seconds]
ketan has joined #ruby
charliesome has joined #ruby
troys_ is now known as troys
TheBloke has quit [Ping timeout: 260 seconds]
ketan has quit [Ping timeout: 248 seconds]
pragmatism has quit [Quit: Connection.close!]
dcunit3d has quit [Ping timeout: 260 seconds]
uZiel has joined #ruby
kobain has quit [Quit: KVIrc 4.2.0 Equilibrium http://www.kvirc.net/]
mim1k has joined #ruby
arescorpio has quit [Quit: Leaving.]
Rodya_ has joined #ruby
mim1k has quit [Ping timeout: 248 seconds]
minimalism has quit [Quit: minimalism]
Rodya_ has quit [Ping timeout: 246 seconds]
enterprisey has joined #ruby
duderonomy has joined #ruby
* dminuoso pokes havenwood with an oddly Shannon-shaped stick.
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Ishido has quit [Ping timeout: 248 seconds]
SteenJobs has quit [Quit: SteenJobs]
agent_white has joined #ruby
mrconfused has quit [Ping timeout: 258 seconds]
mniip has joined #ruby
Ishido has joined #ruby
Fysicus has quit [Quit: The Truth Is Just An Excuse For A Lack Of Imagination]
hutch34 has joined #ruby
WhatsGoi` has quit [Read error: Connection reset by peer]
harfangk has joined #ruby
troys has quit [Quit: Bye]
quiller has quit [Ping timeout: 240 seconds]
podlech has joined #ruby
hutch34 has quit [Ping timeout: 246 seconds]
patrontechnosoft has joined #ruby
akkad has quit [Excess Flood]
akkad has joined #ruby
SteenJobs has joined #ruby
montanonic has quit [Ping timeout: 248 seconds]
tens0r has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
bjmllr has quit [K-Lined]
oleo has quit [Quit: irc client terminated!]
Alina-malina has quit [Ping timeout: 246 seconds]
SteenJobs has quit [Quit: peaceee]
govg has joined #ruby
ozzloy has quit [Remote host closed the connection]
Silthias1 has joined #ruby
Silthias has quit [Ping timeout: 248 seconds]
aupadhye has joined #ruby
AnoHito has joined #ruby
Silthias1 has quit [Ping timeout: 248 seconds]
ozzloy has joined #ruby
AnoHito_ has quit [Ping timeout: 268 seconds]
dcunit3d has joined #ruby
cam27 has quit [Quit: cam27]
Rodya_ has joined #ruby
podlech has quit [Quit: WeeChat 1.7.1]
podlech has joined #ruby
mitt3ns has joined #ruby
agent_white has quit [Ping timeout: 246 seconds]
mitt3ns is now known as agent_white
Rodya_ has quit [Ping timeout: 255 seconds]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jameser has joined #ruby
tastygradient has joined #ruby
<zenspider> V1s1ble: inject isn't like reduce... it IS reduce. just an alias
andrzejku has joined #ruby
Orbixx has joined #ruby
<havenwood> and use #merge rather than #merge! or its alias #update
<Orbixx> I need a quick-start guide to Ruby made for programmers.
<havenwood> reduce(:merge)
Ishido has quit [Read error: Connection reset by peer]
latemus has quit [Ping timeout: 248 seconds]
<havenwood> Orbixx: What background do you come from? What type of langs?
<havenwood> Orbixx: The Well-Grounded Rubyist, Second Edition is a good book to get quickly oriented.
<Orbixx> havenwood: All sorts, PHP, C#, Java, Python, ASM...
<tastygradient> Regardless, there's always this: https://www.ruby-lang.org/en/documentation/ruby-from-other-languages/
<Orbixx> Golang
Silthias has joined #ruby
latemus has joined #ruby
roshanavand has joined #ruby
Ishido has joined #ruby
TomyLobo has joined #ruby
ta_ has quit [Remote host closed the connection]
<Orbixx> tastygradient: That's pretty handy
Hess has joined #ruby
<Orbixx> Ah, so it's strongly typed
<havenwood> Yes
Hess is now known as Hess`
Hess has joined #ruby
Hess` has quit []
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
xall has joined #ruby
dasher00 has quit [Ping timeout: 260 seconds]
Ishido has quit [Ping timeout: 240 seconds]
anisha has joined #ruby
vondruch has quit [Remote host closed the connection]
ketan has joined #ruby
Ishido has joined #ruby
dasher00 has joined #ruby
ketan has quit [Ping timeout: 248 seconds]
vifino has quit [Ping timeout: 246 seconds]
podlech has quit [Quit: WeeChat 1.7.1]
tvw has joined #ruby
ur5us has quit [Read error: No route to host]
Cohedri__ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ur5us has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cschneid has quit [Ping timeout: 258 seconds]
jameser has joined #ruby
yepobebot has joined #ruby
yepobebot has quit [Read error: Connection reset by peer]
cschneid has joined #ruby
dionysus69 has joined #ruby
tastygradient has quit [Quit: leaving]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
conta has joined #ruby
Cohedrin_ has joined #ruby
dionysus69 has quit [Ping timeout: 240 seconds]
jak has quit [Remote host closed the connection]
jak has joined #ruby
djbkd has joined #ruby
ascarter has joined #ruby
Alina-malina has joined #ruby
perniciouscaffei has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
aufi has joined #ruby
doublemalt_ has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
andikr has joined #ruby
ascarter has quit [Ping timeout: 258 seconds]
Mortomes|Work has joined #ruby
vondruch has joined #ruby
Alina-malina has quit [Changing host]
Alina-malina has joined #ruby
hutch34 has joined #ruby
biberu has joined #ruby
jameser has joined #ruby
hutch34 has quit [Ping timeout: 276 seconds]
djbkd has quit [Remote host closed the connection]
dionysus69 has joined #ruby
Orbixx has quit [Quit: Lost terminal]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Pumukel has joined #ruby
vondruch has quit [Quit: vondruch]
nullfxn has quit [Quit: leaving]
abrahampolishchu has quit [Ping timeout: 246 seconds]
jaruga has joined #ruby
tens0r has quit [Quit: tens0r]
eizua has joined #ruby
mark_66 has joined #ruby
solocshaw has joined #ruby
ur5us has quit [Remote host closed the connection]
mostlybadfly has quit [Quit: Connection closed for inactivity]
cschneid has quit [Ping timeout: 246 seconds]
jameser has joined #ruby
cschneid has joined #ruby
ta_ has joined #ruby
jak_ has joined #ruby
BSaboia has quit [Read error: Connection reset by peer]
jak has quit [Read error: Connection reset by peer]
quobo has joined #ruby
Rodya_ has joined #ruby
hutch34 has joined #ruby
jameser has quit [Quit: Textual IRC Client: www.textualapp.com]
antgel has joined #ruby
Rodya_ has quit [Ping timeout: 258 seconds]
mathys has joined #ruby
andrzejku has quit [Quit: Textual IRC Client: www.textualapp.com]
marlinc has left #ruby ["Leaving"]
jameser has joined #ruby
hutch34 has quit [Ping timeout: 258 seconds]
linduxed has joined #ruby
hs366 has joined #ruby
harfangk has quit [Ping timeout: 248 seconds]
jak_ has quit [Remote host closed the connection]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jak_ has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
yeticry has joined #ruby
enterprisey has quit [Remote host closed the connection]
<ar1a> there's an api that you can GET and it redirects you to an image. how can i chuck that into some ruby code and grab the url it redirects me to?
yeticry_ has quit [Read error: Connection reset by peer]
<matthewd> ar1a: What have you come up with so far?
<ar1a> looking at httprb, that's about it
xall has quit [Ping timeout: 255 seconds]
<ar1a> ah ok. got it
<ar1a> :D
<ar1a> easier than i thought
duderonomy has joined #ruby
zapata has quit [Ping timeout: 276 seconds]
<ar1a> easy question, in some cases a method on this object does not exist, and if so i want to call a different method
<ar1a> author = cmd.message.author.display_name || cmd.message.author.username
<ar1a> i thought that would be it, but it's not
<ar1a> is there an easier way of doing it other than rescuing the exception?
<ljarvis> ar1a: you should check if author.respond_to?(:display_name)
<ljarvis> or build a better system into your author object
<ar1a> not my library
<ljarvis> then respond_to?
<ar1a> yep, ty
charliesome has joined #ruby
moei has quit [Quit: Leaving...]
mikecmpbll has joined #ruby
bjmllr has joined #ruby
hs366 has quit [Quit: Leaving]
patarr has joined #ruby
Klumben has quit [Ping timeout: 258 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
alem0lars has quit [Ping timeout: 258 seconds]
Cohedrin_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ketan has joined #ruby
pandaant has joined #ruby
xMopxShell has quit [Ping timeout: 248 seconds]
Joufflu has quit [Ping timeout: 255 seconds]
cschneid has quit [Ping timeout: 276 seconds]
solocshaw has quit [Ping timeout: 276 seconds]
patarr has quit [Ping timeout: 260 seconds]
hs366 has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ketan has quit [Ping timeout: 260 seconds]
MrBusiness has joined #ruby
jenrzzz has joined #ruby
MrBismuth has quit [Ping timeout: 240 seconds]
Klumben has joined #ruby
charliesome has joined #ruby
vondruch has joined #ruby
xall has joined #ruby
mim1k has joined #ruby
<ar1a> oh wow :) thanks
cschneid has joined #ruby
harfangk has joined #ruby
<ar1a> it works! it seems faster too :)
<ljarvis> the bottleneck is the http request anyway, so it's probably not faster, just nicer looking
<ar1a> maybe so, i would think the regex is slower than .include?
<ar1a> appreciate it, im still learning ruby :)
<ljarvis> actually the regexp is probably faster, but that doesn't mean it's better :)
jenrzzz has quit [Ping timeout: 248 seconds]
<ar1a> fair enough. it's a chat bot anyways, it doesn't have to be idiomatic :p
jenrzzz has joined #ruby
Beams has joined #ruby
<ljarvis> cool, but yeah, include? would be faster, but File.extname will slow it down. So I imagine if you benchmarked, "foo.jpg" =~ /.jpg/ would be slower than SUFFIXES.include?(".jpg") but much faster than SUFFIXES.include?(File.extname("foo.jpg"))
<elomatreb> Also, your regex isn't anchored, it would accept .jpg.exe just fine
<ar1a> oooh true
<ljarvis> yep, you want a \z
alem0lars has joined #ruby
alem0lars has quit [Excess Flood]
<herwin> and \. instead of .
<herwin> and probably require something before the dot
<ljarvis> yep, and then throw the regexp away and use File.extname
<herwin> exactly my idea ;)
<ar1a> \z?
<ljarvis> yep
<ar1a> don't you mean $?
<ljarvis> nope
<elomatreb> ^ and $ match lines, \A and \z match the entire string
<elomatreb> (In Ruby)
<ljarvis> ^ so using $ would match "foo.jpg\nomg hax"
lxsameer has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
<ljarvis> >> ["foo.jpg\nomghax" =~ /\.jpg$/, "foo.jpg\nomghax" =~ /\.jpg\z/]
<ruby[bot]> ljarvis: # => [3, nil] (https://eval.in/827073)
xMopxShell has joined #ruby
<ljarvis> but still.. File.extname ;)
marr has joined #ruby
zapata has joined #ruby
Paraxial has joined #ruby
Guest1397 is now known as Sp4rKy
Sp4rKy has quit [Changing host]
Sp4rKy has joined #ruby
zapata has quit [Ping timeout: 246 seconds]
ketan has joined #ruby
ferr has joined #ruby
freedrull has quit [Quit: leaving]
alem0lars has joined #ruby
moei has joined #ruby
umaaji has quit [Ping timeout: 260 seconds]
mim1k has quit [Read error: Connection reset by peer]
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
dasher00 has quit [Ping timeout: 248 seconds]
nofxx has quit [Ping timeout: 240 seconds]
dasher00 has joined #ruby
hplar has quit [Ping timeout: 268 seconds]
doublemalt_ has quit [Ping timeout: 258 seconds]
nofxx has joined #ruby
Mia has joined #ruby
Mia has joined #ruby
Mia has quit [Changing host]
mim1k has joined #ruby
antgel has quit [Ping timeout: 255 seconds]
cschneid has quit [Ping timeout: 246 seconds]
CrazyEddy has joined #ruby
sekmo has joined #ruby
cschneid has joined #ruby
s1kx has quit [Ping timeout: 260 seconds]
InfinityFye has joined #ruby
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
theod has joined #ruby
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
antgel has joined #ruby
eizua has quit [Quit: Leaving]
charliesome has joined #ruby
patarr has joined #ruby
charliesome has quit [Ping timeout: 255 seconds]
pandaant has quit [Remote host closed the connection]
patarr has quit [Ping timeout: 248 seconds]
sekmo has quit [Read error: Connection reset by peer]
vondruch has quit [Read error: Connection reset by peer]
vondruch has joined #ruby
doublemalt_ has joined #ruby
charliesome has joined #ruby
charliesome has quit [Client Quit]
charliesome has joined #ruby
charliesome has quit [Client Quit]
nicesignal has quit [Ping timeout: 276 seconds]
nicesignal has joined #ruby
psychicist__ has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
nicesignal has quit [Ping timeout: 240 seconds]
cschneid has quit [Ping timeout: 255 seconds]
mim1k_ is now known as mim1k
cschneid has joined #ruby
TheBloke has joined #ruby
im0nde has joined #ruby
zapata has joined #ruby
jenrzzz has joined #ruby
<rapha> jesus christ, not only debian, now also ruby. what is it with those pesky spammers.
jenrzzz has quit [Ping timeout: 248 seconds]
Pumukel has quit [Remote host closed the connection]
quobo has joined #ruby
oskurot has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
xall has quit [Ping timeout: 268 seconds]
bkxd has joined #ruby
bkxd_ has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
nadir has quit [Quit: Connection closed for inactivity]
romankapitonov has joined #ruby
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
workmad3 has joined #ruby
pandaant has joined #ruby
bkxd_ has quit [Ping timeout: 260 seconds]
bkxd has quit [Ping timeout: 260 seconds]
oskurot has quit [Quit: Leaving]
bkxd has joined #ruby
bkxd_ has joined #ruby
abhi56rai has joined #ruby
kke_ has quit [Changing host]
kke_ has joined #ruby
ChilledOut has joined #ruby
<ar1a> rapha: huh?
xall has joined #ruby
<ar1a> also what an OG name
<ChilledOut> Hi Team..I am new to Ruby and reading this book "Learn to Program"...I am trying to understand an exercise "Integer to Roman number Converter" can someone please help me how to write this?
<ar1a> shane hendrixson must hate you :P
harfangk has quit [Remote host closed the connection]
<ledestin> ChilledOut the answer is 42
<ChilledOut> ledestin how buddy..I am trying to understand the Ruby code .Wait let me post what I have found so far
<herwin> ledestin: no, it's XLI
<herwin> XLII
<ledestin> herwin that's good too
<ChilledOut> ROMAN_NUMS = { "M" => 1000, "CM" => 900, "D" => 500, "CD" => 400, "C" => 100, "XC" => 90, "L" => 50, "XL" => 40, "X" => 10, "IX" => 9, "V" => 5, "IV" => 4, "I" => 1 }
<ChilledOut> def romanize(num)
hightower2 has joined #ruby
<ChilledOut> ROMAN_NUMS.map do |ltr, val|
<ar1a> Paste >3 lines of text to: https://gist.github.com
xall has quit [Client Quit]
<ChilledOut> amt, num = num.divmod(val)
<ChilledOut> ltr * amt
<ChilledOut> end.join
<ChilledOut> end
<ChilledOut> I am not understanding this romanize method
<ChilledOut> brb
<tobiasvl> ChilledOut: please use https://gist.github.com for long pastes
<adaedra> Please don't paste code directly in the channel, use something like gist.github.com and paste the link
<tobiasvl> ChilledOut: what are you not understanding exactly though
ldnunes has joined #ruby
<ar1a> ChilledOut: if you would rather an easier method i found this on google https://codereview.stackexchange.com/questions/7937/roman-numeral-converter
<ar1a> with info
<rapha> What's an "OG" name?
<rapha> @arla
<ar1a> its a 1 not an l
<rapha> ar1a, sorry
<ar1a> original
<rapha> yeah, messed my brain up :)
<ar1a> rapha
<rapha> ur
<ar1a> pro quake player
<rapha> it's my name
<rapha> and it's been my handle since around 1995
Mortomes|Work has quit [Ping timeout: 260 seconds]
<ar1a> what a coinkidink :p
<rapha> that dude was probably not even out of his nappies by that time
pandaant has quit [Remote host closed the connection]
<rapha> ar1a: what's a coinkidink?
<rapha> (sorry, not a native speaker)
<ar1a> my dumb way of saying coincidence
<rapha> oic
<ar1a> well in 95 he was 6
<rapha> well, okay, prolly barely out of them then
<rapha> anyways, one of my given names is Raphael so i don't feel like there's anything wrong with my handle
<rapha> and to add to that, i did play Quake 1 and 2 and also 3 in a clan for quite a while
<ar1a> im not saying anything is wrong with it
<ar1a> i was just commenting
nadir has joined #ruby
workmad3 has quit [Ping timeout: 260 seconds]
mr_foto has joined #ruby
skweek has joined #ruby
alex`` has joined #ruby
petruff has joined #ruby
postmodern has quit [Quit: Leaving]
mim1k has joined #ruby
DaveTabo_ has joined #ruby
DaveTabo_ has quit [Client Quit]
DaveTabo_ has joined #ruby
DaveTaboola has quit [Ping timeout: 268 seconds]
ketan has quit [Remote host closed the connection]
gregf_ has quit [Ping timeout: 260 seconds]
ketan has joined #ruby
mtkd has quit [Ping timeout: 260 seconds]
mtkd has joined #ruby
<ChilledOut> Hey Thanks guys...Will check it out...
nicesignal has joined #ruby
S007 has quit [Ping timeout: 240 seconds]
ketan has quit [Remote host closed the connection]
ketan has joined #ruby
uZiel has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
<ChilledOut> can someone explain me the logic in the def method
mim1k has joined #ruby
<canton7> ChilledOut, which bit specifically do you have trouble with?
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has joined #ruby
petruff has quit [Quit: WeeChat 1.9]
vifino has joined #ruby
jak_ has quit [Remote host closed the connection]
jak_ has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
<ChilledOut> canton7 the romanize method bit mate.Thank you
<adaedra> What part of it?
<canton7> ChilledOut, it calls a bunch of methods. Which method don't you understand?
DaveTabo_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
belmoussaoui_ has joined #ruby
mwlang has joined #ruby
alex`` has quit [Quit: WeeChat 1.8]
<ChilledOut> @adaedra & @canton7 = The "def romanize (num)" part ..not understanding whats happening inside that and how its able to produce Roman numbers given an Integer
alex`` has joined #ruby
<canton7> ChilledOut, go through it line by line. Make sure you understand what each line does
<adaedra> What did you understand of it so far?
bkxd_ has quit [Ping timeout: 268 seconds]
bkxd has quit [Ping timeout: 268 seconds]
<ChilledOut> ROMAN_NUMS.map do |ltr, val| takes one array at a time and assigns ltr="M" and val=1000
DaveTaboola has joined #ruby
sepp2k has joined #ruby
cgfbee has quit [Remote host closed the connection]
truenito has joined #ruby
truenito has quit [Remote host closed the connection]
truenito has joined #ruby
<ChilledOut> we passed a parameter num ,say 24.. now amt,num=24.divmod(1000) ..so amt=0 and num=24
<ChilledOut> ltr*amt="M" * 0 =0
<adaedra> Sure?
<ChilledOut> not sure
<canton7> just check what "M" * 0 is
<adaedra> well try it in a irb, what does "M" * 0 gives you
<ChilledOut> its nil?
chmuri has quit [Ping timeout: 240 seconds]
<ChilledOut> like I don't get an Output
<canton7> irb gives me "" as the output
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
vondruch has quit [Ping timeout: 255 seconds]
<ChilledOut> yup in IRB ""
<canton7> right. What does irb show you for nil?
<canton7> type 'nil' in irb, see what the output is
<ChilledOut> nil itself
<canton7> right, so irb shows 'nil' for a nil value
<canton7> what do you think "" could be?
uZiel has quit [Ping timeout: 248 seconds]
cgfbee has joined #ruby
<ChilledOut> "" could be empty string
<canton7> cool. Test that theory: "".class
<ChilledOut> haha...string ..
<canton7> great, so "M" * 0 gives you an empty string
truenito has quit [Ping timeout: 248 seconds]
<canton7> (what does "M" * 5 give you?)
<ChilledOut> wow.makes sense now
<ChilledOut> MMMMM
<ChilledOut> string multiplication
<adaedra> Still have problems with this method?
<ChilledOut> canton7 and adaedra thanks guys...I will try and understand now with each iteration and get back
<adaedra> 👍
<adaedra> Don't hesitate to test things in irb, it's here for that
<ChilledOut> Copy that Sir!
Sembei has quit [Ping timeout: 240 seconds]
elsevero has joined #ruby
catphish has joined #ruby
chmurifree has joined #ruby
jyaworski has joined #ruby
petruff has joined #ruby
jak has joined #ruby
jak_ has quit [Read error: Connection reset by peer]
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
jyaworski has quit [Client Quit]
KevinMGranger has quit [Ping timeout: 240 seconds]
voltai[m] has quit [Ping timeout: 240 seconds]
el_ocho[m] has quit [Ping timeout: 255 seconds]
M107262[m] has quit [Ping timeout: 255 seconds]
aidalgol has quit [Ping timeout: 255 seconds]
Giphy[m] has quit [Ping timeout: 255 seconds]
aviraldg has quit [Ping timeout: 246 seconds]
dman[m] has quit [Ping timeout: 255 seconds]
jyaworski has joined #ruby
testnick[m] has quit [Ping timeout: 276 seconds]
johnson[m] has quit [Ping timeout: 276 seconds]
heftig has quit [Ping timeout: 258 seconds]
jonjits[m] has quit [Ping timeout: 264 seconds]
velu_aon[m] has quit [Ping timeout: 276 seconds]
kp666[m] has quit [Ping timeout: 255 seconds]
torarne has quit [Ping timeout: 255 seconds]
turt2live has quit [Ping timeout: 255 seconds]
Tagami[m] has quit [Ping timeout: 255 seconds]
intermo[m] has quit [Ping timeout: 258 seconds]
workmad3 has joined #ruby
kryptoz has joined #ruby
Sembei has joined #ruby
ddddddd has joined #ruby
patrontechnosoft has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 246 seconds]
GodFather_ has joined #ruby
oleo has joined #ruby
GodFather_ has quit [Ping timeout: 260 seconds]
_whitelogger has joined #ruby
chouhoulis has joined #ruby
jameser has joined #ruby
Tagami[m] has joined #ruby
chouhoulis has quit [Ping timeout: 246 seconds]
anisha has quit [Quit: This computer has gone to sleep]
mr_foto has quit []
GodFather_ has joined #ruby
quobo has quit [Quit: Connection closed for inactivity]
jak_ has joined #ruby
jak has quit [Read error: Connection reset by peer]
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Tagami[m] has quit [Remote host closed the connection]
JustTheDoctor has quit [Quit: Connection closed for inactivity]
jameser has joined #ruby
ujjain has quit [Ping timeout: 240 seconds]
err_ok has quit [Ping timeout: 260 seconds]
err_ok has joined #ruby
ujjain has joined #ruby
ujjain has joined #ruby
ujjain has quit [Changing host]
Tagami[m] has joined #ruby
bkxd has joined #ruby
bkxd_ has joined #ruby
workmad3 has quit [Ping timeout: 276 seconds]
mim1k has joined #ruby
oscurochu has joined #ruby
bkxd_ has quit [Ping timeout: 248 seconds]
bkxd has quit [Ping timeout: 248 seconds]
<oscurochu> how do i get apache to execute my ruby files? i dont know where to locate my apache module for passenger. i installed it using "gem install passenger"
ta_ has quit [Remote host closed the connection]
<dminuoso> oscurochu: passenger has grown out of style largely.
<catphish> i believe passenger has a CLI tool that guides you through the process
tau has joined #ruby
<catphish> but there are more popular rack servers, i'd way most people run a separate server and proxy to it, no reason *not* to use passenger though
<dminuoso> oscurochu: Unless you really need that apache, it's probably easiest if you just use a plain and simple sinatra application.
<dminuoso> (or ramaze if you're into that)
<dminuoso> It avoid that big fat http server with that awkward custom compiled passenger plugin.
bweston92_ has joined #ruby
DLSteve has joined #ruby
<oscurochu> i dont need apache i suppose, its just the only web server ive ever known.
cam27 has joined #ruby
<catphish> oscurochu: consider puma + nginx, there are many other options though, and good tutorials
im0nde has quit [Quit: im0nde]
<dminuoso> oscurochu: In the modern age, you usually avoid apache/nginx (and only use them for things like TLS termination, SNI, proxying) and directly use some rack application.
<catphish> i'm assuming your app is rack compatible and you're not trying to do something unusual
<dminuoso> oscurochu: rack like through sinatra, ramaze. puma is not exactly best suited, since it has a slightly different purpose
<oscurochu> i have a spreadsheet that i use and it would just very useful to me to turn it into an application
<dminuoso> (puma itself is rather used to run rack applications)
<oscurochu> i want to possibly sell it or give it away as a web or mobile app. im really not sure where to start, so i think developing web apps with ruby is a good start, until im ready to go mobile
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
torarne has joined #ruby
johnson[m] has joined #ruby
aidalgol has joined #ruby
jonjits[m] has joined #ruby
aviraldg has joined #ruby
turt2live has joined #ruby
KevinMGranger has joined #ruby
dman[m] has joined #ruby
Giphy[m] has joined #ruby
M107262[m] has joined #ruby
intermo[m] has joined #ruby
kp666[m] has joined #ruby
voltai[m] has joined #ruby
heftig has joined #ruby
testnick[m] has joined #ruby
velu_aon[m] has joined #ruby
el_ocho[m] has joined #ruby
<oscurochu> i eventually will need to create graphs and just perform mostly mathmetical calculations with the help of a user interface that can be accessed from multiple devices.
jameser has joined #ruby
<oscurochu> storing the data that will be analyzed into a mysql database
<oscurochu> sounds pretty simple, right?
<catphish> that's what we do here :)
<catphish> UI + math + database
jameser has quit [Ping timeout: 248 seconds]
afisher has joined #ruby
mikecmpbll has quit [Quit: inabit. zz.]
mikecmpbll has joined #ruby
jameser has joined #ruby
jphase has joined #ruby
jameser has quit [Ping timeout: 258 seconds]
Harzilein has quit [Ping timeout: 240 seconds]
chmurifree is now known as chmuri
<chmuri> Hi there what is best ide for start in ruby?
<adaedra> none
<adaedra> just use a basic text editor, vim, emacs, atom, sublime text, visual studio code, notepad++, whatever
TheBloke has quit [Ping timeout: 240 seconds]
minimalism has joined #ruby
tvw has quit [Remote host closed the connection]
<dminuoso> adaedra: but in that list there is one best, and the other ones are just for inferior developers.
Sembei has quit [Ping timeout: 240 seconds]
<dminuoso> But at least you listed them in order of importance.
<dminuoso> :D
<adaedra> ssssh
<adaedra> just use what you're used to
S007 has joined #ruby
ShekharReddy has joined #ruby
ar1a has left #ruby ["WeeChat 1.9"]
conta has quit [Quit: conta]
aupadhye has quit [Ping timeout: 260 seconds]
elsevero has quit [Quit: elsevero]
ascarter has joined #ruby
ferr has quit [Quit: WeeChat 1.8]
ascarter has quit [Ping timeout: 240 seconds]
abhi56ra1 has joined #ruby
abhi56rai has quit [Ping timeout: 258 seconds]
swills has joined #ruby
hightower2 has quit [Ping timeout: 255 seconds]
theod has quit [Quit: Lost terminal]
jphase has quit [Remote host closed the connection]
alex`` has quit [Quit: WeeChat 1.8]
alex`` has joined #ruby
aufi has quit [Ping timeout: 240 seconds]
mikecmpbll has quit [Quit: inabit. zz.]
mim1k has quit [Ping timeout: 246 seconds]
<leah2> is there a trick to match a union of regexp, and see which one matched?
<leah2> matching the match again could fail due to anchors etc
<apeiros> put them into capturing groups
<apeiros> either numbered or named
<leah2> then i cant use numbered matches in the regexp...
mim1k has joined #ruby
<apeiros> ?
<leah2> they dont mix afaiu
<apeiros> too little information
<leah2> > /(?<foo>ba(r)\1)/
<leah2> > /(?<foo>ba(r)\1)/
<leah2> >> /(?<foo>ba(r)\1)/
<ruby[bot]> leah2: # => /tmp/execpad-87e5cc3fc1e0/source-87e5cc3fc1e0:2: numbered backref/call is not allowed. (use name): / ...check link for more (https://eval.in/827401)
<leah2> the input regexp can contain backreferences
<apeiros> ah, yes, you need to stick to one choice.
<leah2> (whyyy)
<elomatreb> You can have named backreferences, \k IIRC?
<apeiros> oh well, if you have uncontrollable input, this problem will be hard
<apeiros> that is, uncontrollable regex as input
<leah2> the posix ere subset is good enough
mikecmpbll has joined #ruby
<leah2> i'll match them one by one and use the leftmost matching...
<apeiros> and "uncontrollable regex input" is relevant context btw., which you should not have left out when asking.
<leah2> yeah, sorry
Sembei has joined #ruby
PaulCapestany has quit [Quit: .]
PaulCapestany has joined #ruby
__Yiota has joined #ruby
JustTheDoctor has joined #ruby
InfinityFye has quit [Ping timeout: 248 seconds]
skweek has quit [Ping timeout: 260 seconds]
uZiel has joined #ruby
oscurochu has quit [Quit: Leaving.]
kvant has joined #ruby
kvant has left #ruby [#ruby]
oscurochu has joined #ruby
abhi56ra1 has quit [Quit: WeeChat 1.9]
nanoz has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
abhi56rai has joined #ruby
ltem has joined #ruby
jak_ has quit [Remote host closed the connection]
mlehrer has joined #ruby
jak_ has joined #ruby
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
LukyCZ has joined #ruby
<LukyCZ> Is there a way to get Ruboto working on Nougat ?
kobain has joined #ruby
kies has quit [Ping timeout: 248 seconds]
elsevero has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
mathys has quit [Quit: Leaving]
catphish has left #ruby ["Leaving"]
baweaver is now known as baweaver_away
conta1 has joined #ruby
workmad3 has joined #ruby
BSaboia has joined #ruby
ascarter has joined #ruby
chouhoulis has joined #ruby
abhi56rai has quit [Ping timeout: 240 seconds]
ascarter has quit [Ping timeout: 260 seconds]
cadillac_ has quit [Ping timeout: 260 seconds]
cadillac_ has joined #ruby
chouhoulis has quit [Remote host closed the connection]
catphish has joined #ruby
oscurochu has quit [Quit: Leaving.]
dionysus69 has quit [Ping timeout: 240 seconds]
<catphish> i have an event driven application and i need to do DNS lookups, i'm struggling to find an off the shelf way to do this, right now DNS lookups are hanging my app
TheBloke has joined #ruby
nanoz has quit [Quit: <3]
spastorino has joined #ruby
GodFather_ has quit [Read error: Connection reset by peer]
GodFather_ has joined #ruby
<catphish> all the solutions are associated with existing frameworks, i'm sure i can put something together
mwlang has quit [Quit: mwlang]
mwlang has joined #ruby
ledestin has joined #ruby
perniciouscaffei has joined #ruby
tau has quit [Remote host closed the connection]
tau has joined #ruby
jak has joined #ruby
jak_ has quit [Ping timeout: 255 seconds]
chouhoulis has joined #ruby
workmad3 has quit [Ping timeout: 248 seconds]
theRealGent has joined #ruby
<theRealGent> Hello. Does anyone know why writing to an array with FFI and then reading it returns different results for the first element? https://pastebin.com/vXPKdp3e
<ruby[bot]> theRealGent: we in #ruby do not like pastebin.com, I reposted your paste to gist for you: https://gist.github.com/9fff102fee24c52b1519d72b64d28d70
<ruby[bot]> theRealGent: pastebin.com loads slowly for most, has ads which are distracting and has terrible formatting.
ledestin has quit [Ping timeout: 260 seconds]
spastorino has quit []
Joufflu has joined #ruby
jaruga has quit [Read error: Connection reset by peer]
jaruga has joined #ruby
p0p0pr37 has quit [Quit: p0p0pr37]
skweek has joined #ruby
cam27 has quit [Quit: cam27]
Rodya_ has joined #ruby
Wando has joined #ruby
Wando has quit [Client Quit]
catphish has quit [Quit: Leaving]
mikecmpbll has quit [Quit: inabit. zz.]
mtkd has quit [Ping timeout: 248 seconds]
mtkd has joined #ruby
<theRealGent> Kinda look like a bug in FFI
<leah2> https://bugs.ruby-lang.org/issues/11258 2 years open and not merged :(
hutch34 has joined #ruby
p0p0pr37 has joined #ruby
mwlang has quit [Quit: mwlang]
mwlang has joined #ruby
conta1 has quit [Ping timeout: 248 seconds]
workmad3 has joined #ruby
vuoto has joined #ruby
roshanavand has quit [Quit: roshanavand]
arup_r has joined #ruby
xMopxShell has quit [Ping timeout: 276 seconds]
meshsmith has joined #ruby
mark_66 has quit [Remote host closed the connection]
kryptoz has quit [Remote host closed the connection]
ascarter has joined #ruby
hutch34 has quit [Ping timeout: 255 seconds]
muelleme_ has joined #ruby
rgiscard has quit [Quit: Gone fishing]
elsevero has quit [Quit: elsevero]
alex`` has quit [Quit: WeeChat 1.8]
ascarter has quit [Ping timeout: 240 seconds]
Beams has quit [Quit: .]
solocshaw has joined #ruby
kies has joined #ruby
doublemalt_ has quit [Ping timeout: 248 seconds]
Rodya_ has quit [Remote host closed the connection]
__g_k__1_w_m__s_ has joined #ruby
kies has quit [Ping timeout: 240 seconds]
__g_k__1_w_m__s_ has left #ruby [#ruby]
Rodya_ has joined #ruby
arup_r has quit [Remote host closed the connection]
chouhoulis has quit [Ping timeout: 260 seconds]
ta_ has joined #ruby
sylario has joined #ruby
__g_k__1_w_m__s_ has joined #ruby
__g_k__1_w_m__s_ has quit [K-Lined]
ketan has quit [Remote host closed the connection]
ketan has joined #ruby
chouhoulis has joined #ruby
belmoussaoui_ has quit [Ping timeout: 258 seconds]
ta_ has quit [Ping timeout: 248 seconds]
t-recx has joined #ruby
Rodya_ has quit [Remote host closed the connection]
nowhere_man has quit [Read error: Connection reset by peer]
nowhere_man has joined #ruby
andikr has quit [Remote host closed the connection]
duderonomy has joined #ruby
julian has quit [Ping timeout: 276 seconds]
CrazyEddy has quit [Remote host closed the connection]
ddddddd has quit [Ping timeout: 255 seconds]
Cohedrin_ has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
gothicsouth has joined #ruby
uZiel has quit [Remote host closed the connection]
alamar has joined #ruby
alamar is now known as Guest37281
dionysus69 has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ShekharReddy has quit [Quit: Connection closed for inactivity]
vuoto has quit [Quit: Lost terminal]
ketan has quit [Ping timeout: 268 seconds]
mathys has joined #ruby
uZiel has joined #ruby
pankaj has joined #ruby
<pankaj> t-chat
romankapitonov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AckZ has left #ruby [#ruby]
LukyCZ has quit [Quit: Connection closed for inactivity]
duderonomy has joined #ruby
t-recx has quit [Read error: Connection reset by peer]
t-recx has joined #ruby
petruff1 has joined #ruby
xzhao has quit [Remote host closed the connection]
Joufflu has quit [Read error: Connection reset by peer]
petruff has quit [Ping timeout: 246 seconds]
xzhao has joined #ruby
Joufflu has joined #ruby
SeepingN has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
antgel has quit [Ping timeout: 255 seconds]
uZiel has quit [Remote host closed the connection]
SeepingN has quit [Client Quit]
mathys has quit [Quit: Leaving]
cam27 has joined #ruby
jaruga has quit [Quit: jaruga]
__Yiota has joined #ruby
GodFather_ has quit [Ping timeout: 260 seconds]
uZiel has joined #ruby
oscurochu has joined #ruby
sagax has joined #ruby
oscurochu has quit [Client Quit]
petruff1 has quit [Quit: WeeChat 1.9]
ta_ has joined #ruby
shinnya has quit [Ping timeout: 240 seconds]
theRealGent has quit [Ping timeout: 246 seconds]
muelleme_ has quit [Ping timeout: 240 seconds]
solocshaw has quit [Ping timeout: 258 seconds]
muelleme_ has joined #ruby
blackwind_123 has quit [Ping timeout: 268 seconds]
blackwind_123 has joined #ruby
pankaj has quit [Ping timeout: 240 seconds]
pankaj has joined #ruby
nOwz has quit [Quit: WeeChat 1.7]
raul782 has joined #ruby
jenrzzz has joined #ruby
romankapitonov has joined #ruby
uZiel_ has joined #ruby
dionysus69 has quit [Remote host closed the connection]
xMopxShell has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
belmoussaoui has joined #ruby
ChilledOut has quit [Ping timeout: 260 seconds]
romankapitonov has quit [Read error: Connection reset by peer]
npgm has joined #ruby
snowda has joined #ruby
ascarter has joined #ruby
<snowda> does ruby provides any string escape when accessing bash? I mean variable = "ABC", so puts `echo "#{variable}"`
romankapitonov has joined #ruby
<snowda> is it possible to inject a rm -rf /?
kobain has quit [Ping timeout: 255 seconds]
nofxx has quit [Remote host closed the connection]
guardian has quit [Remote host closed the connection]
ascarter has quit [Ping timeout: 260 seconds]
<jordanm> snowda: yes, if "variable" is built using external data, but you are not executing it in your example
andrzejku has joined #ruby
xMopxShell has quit [Ping timeout: 240 seconds]
pankaj has quit [Ping timeout: 260 seconds]
elsevero has joined #ruby
<jordanm> you can also use popen to execute external commands without a shell
uZiel_ has quit [Quit: leaving]
<havenwood> snowda: Your example will print: rm -rf /
<havenwood> oh
<havenwood> snowda: You can use Shellwords.escape
sepp2k has quit [Ping timeout: 268 seconds]
<havenwood> snowda: If your payload was "`rm -rf /`" or "$(rm -rf /)" it'd be a problem
<havenwood> snowda: But it's a problem that Shellwords.escape fixes.
<manveru> snowda: use system instead
<jordanm> I am pretty sure system() still uses a shell
<havenwood> jordanm: It can, or not.
<jordanm> IO.popen does not
<jordanm> ah, right I see the no-shell syntax in the docs
<manveru> popen i'd use if i care about the output
<jordanm> bit odd since the libc function system() you would expect it uses is always shell
<manveru> but system is perfectly safe for stuff you don't :)
<manveru> (just make sure you pass as separate arguments, not a long string)
raul782 has quit [Remote host closed the connection]
jenrzzz has joined #ruby
<snowda> thank you all
pankaj has joined #ruby
<snowda> I'll go with shellwords
theRealGent has joined #ruby
meshsmith has quit [Remote host closed the connection]
oscurochu has joined #ruby
antgel has joined #ruby
oscurochu has quit [Client Quit]
podlech has joined #ruby
guardian has joined #ruby
podlech has quit [Quit: WeeChat 1.7.1]
podlech has joined #ruby
Joufflu has quit [Ping timeout: 248 seconds]
jak has quit [Remote host closed the connection]
jak has joined #ruby
oscurochu has joined #ruby
ketan has joined #ruby
alex`` has joined #ruby
xrlk has joined #ruby
naprimer3 has joined #ruby
naprimer2 has quit [Ping timeout: 248 seconds]
ketan has quit [Ping timeout: 268 seconds]
snowda has quit [Quit: Page closed]
Ka has quit [Quit: ZNC 1.7.x-git-775-96c92ef8 - https://znc.in]
N0ATN has joined #ruby
antgel has quit [Ping timeout: 260 seconds]
nahra has joined #ruby
jenrzzz has quit [Ping timeout: 240 seconds]
podlech has quit [Ping timeout: 248 seconds]
mtkd has quit [Ping timeout: 255 seconds]
mtkd has joined #ruby
lxsameer has quit [Quit: WeeChat 1.7]
freeman42 has joined #ruby
nahra has quit [Remote host closed the connection]
<freeman42> is there a function that takes another function from string to string and pipes input/output through it?
kobain has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
SCHAPiE has quit [Read error: Connection reset by peer]
nahra has joined #ruby
knight33 has joined #ruby
sepp2k has joined #ruby
<Papierkorb> freeman42: What are you trying to do?
<Papierkorb> freeman42: And, what have you tried yet?
theRealGent has quit [Ping timeout: 258 seconds]
montanonic has joined #ruby
<freeman42> trying to find a Ruby standard function that does the following: "The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device."
<freeman42> what I tried? google-ing for it :p
SCHAPiE has joined #ruby
<Papierkorb> What do you need? Really, the moment you read the string from anywhere, it's a string you can do things with you like, and then later print out again. Nothing special needed.
<adam12> IO.copy_stream maybe? but it would be nice to know what your doing, and if this is homework.
<Papierkorb> It sure sounds like homework :)
<freeman42> it is not homework, but here it sure smells like... attitude, bad attitude
kculpic has joined #ruby
<adam12> freeman42: Let's not forget you came here. We didn't seek you out.
<freeman42> I asked a very clear question, and people are asking "is it homework" and "what are you trying to accomplish", I just said what I am trying to accomplish
<freeman42> adam12, that is not excuse for being rude to newcomers
<adam12> freeman42: If you can't handle a) people wanting to suggest the best solution for you and b) people not wanting to give away homework answers, but rather help you come up with the solution
<adam12> I think you'll need to change your tune.
<freeman42> adam12, this is not a "think through it type of question", it was a simple, is there a function that does that question? yes or no
<Papierkorb> freeman42: It would be rude to give bad suggestions. Your question is not really clear, and thus required clarifications from our end.
<adam12> freeman42: I gave you the method you wanted. Enjoy.
<freeman42> Papierkorb, what was unclear about this? "The interact function takes a function of type String->String as its argument. The entire input from the standard input device is passed to this function as its argument, and the resulting string is output on the standard output device."
muelleme_ has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
<freeman42> adam12, might be mistaken, but IO.copy_stream does not seem to take a string to string function as argument
umaaji has joined #ruby
dcunit3d has quit [Ping timeout: 260 seconds]
umaaji has quit [Client Quit]
shinnya has joined #ruby
dasher00 has quit [Ping timeout: 258 seconds]
konsolebox has quit [Ping timeout: 248 seconds]
ddddddd has joined #ruby
patteh has quit [Remote host closed the connection]
abstr0n has joined #ruby
patteh has joined #ruby
mim1k has joined #ruby
konsolebox has joined #ruby
mwlang has quit [Quit: mwlang]
dasher00 has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
xMopxShell has joined #ruby
andrzejku has quit [Quit: Textual IRC Client: www.textualapp.com]
abstr0n has quit [Quit: WeeChat 1.8]
HoierM_ has joined #ruby
podlech has joined #ruby
podlech has quit [Client Quit]
quobo has joined #ruby
mim1k has joined #ruby
hangelo has joined #ruby
psychicist__ has quit [Ping timeout: 268 seconds]
blackwind_123 has quit [Ping timeout: 268 seconds]
hangelo has quit [Client Quit]
blackwind_123 has joined #ruby
mim1k has quit [Ping timeout: 240 seconds]
abstr0n has joined #ruby
t-recx has quit [Quit: t-recx]
ncthom91 has joined #ruby
xMopxShell has quit [Ping timeout: 240 seconds]
abstr0n has quit [Quit: WeeChat 1.8]
brent__ has joined #ruby
enterprisey has joined #ruby
trac3r_ has joined #ruby
jak has quit [Remote host closed the connection]
jak has joined #ruby
montanonic has quit [Ping timeout: 240 seconds]
sneakerhax has quit [Ping timeout: 258 seconds]
pankaj has quit [Ping timeout: 276 seconds]
ldnunes has quit [Quit: Leaving]
mim1k has joined #ruby
pankaj has joined #ruby
hutch34 has joined #ruby
biberu has quit []
wilbert has joined #ruby
helpa-bot has joined #ruby
helpa has quit [Write error: Broken pipe]
mozzarella has quit [Remote host closed the connection]
matled has quit [Write error: Broken pipe]
matled- has joined #ruby
matled- is now known as matled
_Tristan-Speccy_ has quit [Quit: -= A click to real life biatches!!! =-]
helpa-bot has quit [Remote host closed the connection]
helpa has joined #ruby
mozzarella has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
lucas has quit [Quit: leaving]
<ineb> freeman42: i have an answer to your initial question: no.
lucas has joined #ruby
mrconfused has joined #ruby
<freeman42> ineb, thank you, I thought the same since it should have been relatively easy to find if it was in the base libraries
romankapitonov has joined #ruby
Karunamon|2 has quit [Remote host closed the connection]
xMopxShell has joined #ruby
knight33 has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
theRealGent has joined #ruby
hutch34 has quit [Ping timeout: 258 seconds]
orobor has joined #ruby
ketan has joined #ruby
romankapitonov has quit [Read error: Connection reset by peer]
orobor has quit [Ping timeout: 248 seconds]
ahrs has quit [Remote host closed the connection]
duderonomy has quit [Quit: Textual IRC Client: www.textualapp.com]
ketan has quit [Ping timeout: 246 seconds]
ahrs has joined #ruby
BlkDynmt has joined #ruby
romankapitonov has joined #ruby
ltem has quit [Quit: Leaving]
<zenspider> freeman42: try not to be a dick. people here are trying to help... but we won't help you cheat on homework and we WILL ask questions for context.
skweek has quit [Ping timeout: 258 seconds]
jak has quit [Remote host closed the connection]
<zenspider> looks like that's a haskell function and is awkward at best in ruby
InfinityFye has joined #ruby
biox has quit [Quit: brb servers are ded]
<freeman42> what do you mean by: `awkward at best in ruby`? either it exists or not in base libraries
<zenspider> freeman42: intentional or not, you are coming off as a complete jackass
<zenspider> strike 2
knight33 has joined #ruby
<zenspider> could it occur to you that OO and lazy functional are completely different beasts and that some ideas don't translate cleanly?
biox has joined #ruby
<zenspider> "string to string function" doesn't really translate in ruby. Ruby is OO. So it'd be a "nothing to string" method in the first place (the receiver of the message is the "input" string)
<bougyman> there are plenty of high-order FP type methods and methodologies possible in ruby
<bougyman> I just don't think he's expressing his need well.
<bougyman> what the fuck do you want this method to do?
<zenspider> it sounds like map to me
<bougyman> That'd be my ask.
<zenspider> >> io = StringIO.new "blah\nblah\nblah"; def io.interact name; self.map &name; end; io.interact :upcase
<ruby[bot]> zenspider: # => ["BLAH\n", "BLAH\n", "BLAH"] (https://eval.in/827587)
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bougyman> ^
<zenspider> but map doen't take a function... the function isn't string->string... etc... but this whole "just give me a yes/no" attitude needs to stop now
nadir has quit [Quit: Connection closed for inactivity]
<bougyman> StringIO.new("blah\nblah\nblah").map { |w| w.upcase }
<bougyman> => ["BLAH\n", "BLAH\n", "BLAH"]
<bougyman> the block is the function.
<zenspider> yeah. I was just trying to make it look more like the spec
sepp2k has quit [Read error: Connection reset by peer]
<zenspider> which quotes haskell doco
<zenspider> I don't know haskell's type signatures enough... but "-> IO ()" says outputs an IO to me, but the doco says "the resulting string is output on the standard output device"
<zenspider> that seems wrong? maybe it is the '()' part?
<bougyman> that should need a monad, shouldn't it?
<bougyman> It's side effect.
<bougyman> +1
<bougyman> er +a
<Papierkorb> IO is *magic*
ncthom91 has quit [Quit: Textual IRC Client: www.textualapp.com]
<zenspider> I know more ML than haskell at this point. dunno. just seems wierd. I would kinda expect no result... maybe it outputs AND returns the IO
<zenspider> it doesn't say it is lazy IO either... unlike getContents, for example
<zenspider> reads like "slurp all of stdin, map, print the whole thing"
fumk has quit [Read error: Connection reset by peer]
biox has quit [Quit: brb servers are ded]
fumk has joined #ruby
brent__ has quit [Remote host closed the connection]
biox has joined #ruby
biox has quit [Client Quit]
brent__ has joined #ruby
spiette has quit [Ping timeout: 255 seconds]
biox has joined #ruby
<zenspider> also seems misnamed or at least a violation of responsibilities to me
spiette has joined #ruby
oscurochu has quit [Quit: Leaving.]
brent__ has quit [Ping timeout: 240 seconds]
kobain has quit [Ping timeout: 255 seconds]
oleo has quit [Read error: Connection reset by peer]
xrlk has quit [Ping timeout: 240 seconds]
oleo has joined #ruby
br0d1n has joined #ruby
oleo has quit [Read error: Connection reset by peer]
oleo has joined #ruby
boombox_ has joined #ruby
ascarter has joined #ruby
zenspider has left #ruby ["ERC (IRC client for Emacs 25.1.1)"]
ascarter has quit [Ping timeout: 240 seconds]
romankapitonov has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
belmoussaoui has quit [Remote host closed the connection]
oleo has quit [Read error: Connection reset by peer]
alex`` has quit [Ping timeout: 240 seconds]
oleo has joined #ruby
async_pr1 is now known as async_prince
zenspider has joined #ruby
mim1k has quit [Ping timeout: 260 seconds]
barx has joined #ruby
<barx> hello… I’m learning Ruby. May I ask, what’s going on here:
<barx> >> Symbol.is_a?(Module)
<barx> => true
<barx> >> module Symbol
<barx> >> end
<barx> TypeError: Symbol is not a module
<barx> from (irb):137
<barx> from /usr/local/bin/irb:11:in `<main>'
<zenspider> do not paste in here
<zenspider> please use gist
async_prince has quit [Quit: WeeChat 1.7.1]
<barx> I’m sorry. What is the correct way to ask that question, zenspider ?
<zenspider> ask the question, in English. Provide code via gist
<zenspider> unless it is 1-2 lines long
async_prince has joined #ruby
<barx> okay. got it.
jyaworski has quit [Ping timeout: 255 seconds]
<barx> redo: is Symbol a module? If so, why can I not extend it as such?
<zenspider> Symbol is a Class. Class is a subclass of Module. is_a? answers true for subclasses
<barx> ahhhh cool.
<zenspider> >> Symbol.class
<ruby[bot]> zenspider: # => Class (https://eval.in/827594)
<zenspider> >> Class.class
<ruby[bot]> zenspider: # => Class (https://eval.in/827595)
xrlk has joined #ruby
<zenspider> >> Class.superclass
<ruby[bot]> zenspider: # => Module (https://eval.in/827596)
<barx> cool.
<barx> so why doesn’t this work? https://is.gd/GCmHZ8
<zenspider> because symbols aren't modules
<zenspider> Symbol is a module. instances of Symbol are symbols
<zenspider> >> class Symbol; def + o; "#{self}#{o}"; end; end; :a + :b
<ruby[bot]> zenspider: # => "ab" (https://eval.in/827597)
TomyLobo has quit [Ping timeout: 240 seconds]
soLucien has joined #ruby
<soLucien> hi guys ! Is it possible to somehoe access ENV[] variables inside a instance_eval() ?
<barx> ah, duh, thanks zenspider
<Papierkorb> soLucien: What do you mean? You can just use it in the eval'd code like normal
<soLucien> it didn't work for me , but i can try again
__Yiota has joined #ruby
TheBloke has quit [Ping timeout: 240 seconds]
<zenspider> soLucien: can you show us what you tried?
bkxd has joined #ruby
bkxd_ has joined #ruby
kobain has joined #ruby
__Yiota has quit [Client Quit]
oleo has quit [Read error: Connection reset by peer]
oleo has joined #ruby
bkxd has quit [Ping timeout: 248 seconds]
bkxd_ has quit [Ping timeout: 248 seconds]
<soLucien> i checked the value of ENV in pry and it does contain the variables i am referring to
<soLucien> maybe i'm not quoting them properly or something
<zenspider> you're doing ENV[USERNAME]... the error says that ::USERNAME is not defined... it isn't.
<zenspider> where is that supposed to come from?
<zenspider> ENV is a magic hash and the keys are strings. Maybe you mean "USERNAME" ?
<soLucien> zenspider i fixed it
<soLucien> it was quoting indeed
<soLucien> thanks
<soLucien> ENV is my environment variables
<soLucien> and magically this makes the git client authenticate against a password-protected git repo
<soLucien> Good Guy Ruby
<barx> Another rando beginner question… Why are nonexistent symbols saved when they are searched for? https://eval.in/827603
<barx> I’m coming from Scala, so a lot of things astonish me about Ruby.
<barx> ..and what are those list three global vars...
<zenspider> barx: searched for?
<barx> yeah see the snippet - I typed What.foo but there’s no such thing. the symbol table was checked for them, and then added.
<zenspider> you defined the symbol :foo by compiling it into your code
<zenspider> they were added to the symbol table the second the code was parsed
ddddddd has quit [Ping timeout: 240 seconds]
<barx> huh.
<barx> that makes sense, I guess.
<zenspider> What.foo compiles to something looking like: s(:call, s(:const, :What), :foo)
<barx> but it does throw a NameError. so it’s also non-existent.
<zenspider> so :What gets looked up as a const, then :foo gets sent to it... but you raise on the first part
<barx> right, okay.
<barx> but - if it were a class, would it be looked up in the same manner?
<zenspider> roughly: Object.const_get(:What).send(:foo)
<zenspider> wouldn't matter if it were a class or some random object...
<barx> ahhh okay - same error.
<barx> thanks. :)
<zenspider> >> What = 42; What.foo
<ruby[bot]> zenspider: # => undefined method `foo' for 42:Fixnum ...check link for more (https://eval.in/827604)
<zenspider> that's a failure at the send level
oleo has quit [Read error: Connection reset by peer]
<barx> aight.
alveric4 has joined #ruby
PaulCapestany has quit [Ping timeout: 248 seconds]
alveric3 has quit [Ping timeout: 240 seconds]
mrconfused has quit [Ping timeout: 246 seconds]
PaulCapestany has joined #ruby
MrBusiness has quit [Ping timeout: 240 seconds]
mostlybadfly has joined #ruby
br0d1n has quit [Quit: Leaving]
ketan has joined #ruby
raul782 has joined #ruby
ketan has quit [Ping timeout: 260 seconds]
AnoHito_ has joined #ruby
__Yiota has joined #ruby
AnoHito has quit [Ping timeout: 255 seconds]