havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.6.1, 2.5.3, 2.4.5: 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!
spacesuitdiver has joined #ruby
spacesuitdiver has quit [Client Quit]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<zenspider> kirun: reduced: https://dpaste.de/n0kU
mamantoha has quit [Ping timeout: 252 seconds]
ellcs has quit [Ping timeout: 255 seconds]
mamantoha has joined #ruby
eightfold has quit [Quit: eightfold]
awkwords has joined #ruby
blaguvest has quit [Read error: Connection reset by peer]
AJA4350 has joined #ruby
stryek has quit [Quit: Connection closed for inactivity]
Tempesta has joined #ruby
<kirun> zenspider: I filed it... https://bugs.ruby-lang.org/issues/15640
<kirun> Also... time to sleep.
kirun has quit [Quit: Konversation terminated!]
gix has quit [Ping timeout: 255 seconds]
mamantoha has quit [Ping timeout: 255 seconds]
johnny56_ has quit [Ping timeout: 272 seconds]
elphe has joined #ruby
johnny56_ has joined #ruby
_whitelogger has joined #ruby
bmurt has joined #ruby
bmurt has quit [Client Quit]
bmurt has joined #ruby
elcuervo has quit [Ping timeout: 240 seconds]
t0x has joined #ruby
mangold has joined #ruby
al2o3-cr has quit [Quit: WeeChat 2.4]
agent_white has joined #ruby
al2o3-cr has joined #ruby
hightower3 has quit [Ping timeout: 245 seconds]
sgen has quit [Ping timeout: 252 seconds]
awkwords has quit [Ping timeout: 245 seconds]
sylario has quit [Quit: Connection closed for inactivity]
sgen has joined #ruby
ur5us has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
AJA4350 has quit [Ping timeout: 245 seconds]
mangold has quit [Quit: This computer has gone to sleep]
gnufied has quit [Remote host closed the connection]
AJA4350 has joined #ruby
elphe has joined #ruby
conta has joined #ruby
eb0t_ has joined #ruby
DaRock has joined #ruby
<DaRock> Hey guys - quick question: what is the reasoning behind the header limitations in rack?
eb0t has quit [Ping timeout: 255 seconds]
<DaRock> I have a multiple header, and it is also (by RFC documentation) further split by semicolons and spaces, and each definition can be defined over multiple lines
<DaRock> so how does that fit with rack's response header limitations?
<DaRock> allegedly, rack cannot handle multiple lines for a single definition
conta has quit [Ping timeout: 255 seconds]
mangold has joined #ruby
<DaRock> it also chokes on a \r\n which is also a foundation for http response
<DaRock> I can use \n, but I don't think that's working
Onwarion_re has joined #ruby
Onwarion has quit [Ping timeout: 255 seconds]
ascarter has joined #ruby
sgen has quit [Ping timeout: 252 seconds]
<havenwood> DaRock: I'm not familiar with any \r\n issue. Have a minimal reproduction case?
<DaRock> not really - depends on what you mean by "minimal" :-)
<DaRock> basically the linter invalidates the the string on \r
<DaRock> it will only accept \n
<DaRock> I've got something happening now, but I'm not 100% certain how valid it is, and even so it does make working with the response object harder than I believe it should be
<DaRock> I think there may be some confusion over the interpretation of rfc7230 and valid tokens
<havenwood> What version of Rack are you on?
<DaRock> simply looking at the request header invalidates the interpretation taken by the rack - see the accepts field
<DaRock> no idea :-)
<DaRock> I'm getting my ruby on, and I needed a http server, so I decided to learn it
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<DaRock> ruby's 2.4.5
<havenwood> DaRock: Assuming it's a Gemfile-based thing: bundle info rack
AJA4350 has quit [Remote host closed the connection]
<DaRock> haven't got to gemfiles yet - still learning ruby styling
<havenwood> DaRock: gem list rack
<havenwood> or rather: gem list -e rack
<havenwood> or: rackup -v
<DaRock> so gem's a bit like a pip equivalent?
<DaRock> rack (2.0.6)
<DaRock> or npm?
<havenwood> DaRock: Yeah, like pip or npm.
<havenwood> DaRock: RubyGems/Bundler ship with Ruby and provide packaging and dependency resolution.
<havenwood> DaRock: Actually, a closer to Yarn.
<havenwood> a bit*
<DaRock> ok
<havenwood> I'm curious what the discrepancy is in the reading of 7230.
<DaRock> well the discrepancy is when you look at pretty much any accept header field, which should be following the same spec, right?
<DaRock> it breaks that multiple ways - "text/html,application/xhtml+xm…ml;q=0.9,image/webp,*/*;q=0.8"
<DaRock> actually: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8
<DaRock> unless token is a smaller value than I read it
SeepingN has quit [Quit: The system is going down for reboot NOW!]
<DaRock> and of greater interest to myself is rfc8288 - which is also relevant and is based upon the rfc7230 document, at least the writers are well aware of it
<havenwood> i'm missing the invalid part?
<DaRock> am I reading it wrong then? I see semicolon, asterisk, +, ... as invalid
agent_white has quit [Quit: Lost terminal]
<DaRock> at least according to the way rack has interpreted it
<havenwood> it looks to me like the spec is saying those are all valid characters
<DaRock> Delimiters are chosen
<DaRock> # from the set of US-ASCII visual characters not allowed in a token
<DaRock> what really got me was the implementation of rfc8288 - where folding can take place using \r\n - and the rack linter choked
<havenwood> DaRock: right, but that's: "(),/:;<=>?@[\]{}
<DaRock> so what's a token as defined by rack then?
vonfry has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 245 seconds]
<havenwood> 1*tchar
agent_white has joined #ruby
<havenwood> it's following 7230 as far as I can tell. maybe i'm just not getting it.
<DaRock> so I set my header back so that the error returned, and this is the error message: invalid header value Link: "<jails/>;\r"
<havenwood> DaRock: \r is an invalid token, right?
<DaRock> the particular area is actually invalid header value Link: "<jails/>;\r\nrel=\"..."
<DaRock> not as I read it and apparently not according to rfc8288
<havenwood> DaRock: mind linking to the part of 8288 you mean?
<DaRock> tokens can be folded using \r\n, which apparently conflicts in interpretations of rfc7230
<DaRock> I mean I can make it happen apparently, but it seems harder than it should be, and I'm wondering if it may be a bug or at least some reference should be made to it - its been giving me a headache trying to figure out what I did wrong :-)
<DaRock> it was only after some rather extensive searching that I discovered the apparent limitations rack linter has on the header fields
<DaRock> as far as the rfc8288 is concerned, it is only one of the rigid examples that follow this style, I'm sure there are more - accept header is one example, but I can't find specifics on that right now
<havenwood> Fun new addition to Rack, Eileen added trailer headers! https://github.com/rack/rack/commit/cf0b8eaf0e373e2a315f7be90ea7b2d3051aaa17
ur5us has quit [Remote host closed the connection]
bambanx has joined #ruby
arekushi has quit [Quit: Gateway shutdown]
hahuang65 has quit [Ping timeout: 245 seconds]
hahuang65 has joined #ruby
<DaRock> so where does that leave us then?
<DaRock> even if I use \s\t it fails miserably
<havenwood> DaRock: "This specification deprecates such line folding"
vonfry has quit [Quit: WeeChat 2.4]
<DaRock> AFAIU the purpose is for "human readability", but bunching together isn't all that "human readable"
<DaRock> yes but rfc8288 was implemented _after_ rfc7230 :-)
<DaRock> rfc7230 - 2014
<DaRock> rfc8288 - 2017
<DaRock> and prev rfc8288 was rfc5988
<DaRock> do _they_ know what they are doing?
<DaRock> :-D
awkwords has joined #ruby
blackmesa has joined #ruby
<DaRock> looks like there's very little anyone in ruby can do, so I'll thank you for your help and grin and move on. I think I can do what I need now, so that's what matters - leave the politics to some other fools to figure out :-D
<havenwood> DaRock: Maybe RFC 1796 explains it :P "Not All RFCs are Standards"
<DaRock> lol
<DaRock> does make you wonder if any read their own rfc'sthough...
<havenwood> DaRock: maybe they're trying to avoid proposed standards relying on other proposed standards?
<DaRock> can you imagine how that would work in practice though?
<havenwood> DaRock: yeah, it's chaos. here, Rack is targeting 7239 since Rack version 1.6.
<DaRock> standards for a nut not relying on the standards for a bolt? lol
<havenwood> It's 7230**
<havenwood> DaRock: now we need a standard for the nut/bolt adapter
<DaRock> its all good - got to start somewhere. As long as there's a way around it might as well stick to it :-)
<DaRock> rofl
<DaRock> leave it to the philosophers at the top then :-)
hahuang65 has quit [Quit: ZNC - https://znc.in]
<DaRock> well thanks again havenwood - I guess I better eat something...
[Butch] has joined #ruby
<havenwood> application/text+plain; charset=utf-8; \r\nContent-Length:0\r\n\r\nHTTP/1.1 200 OK\r\n
hahuang65 has joined #ruby
<havenwood> DaRock: thanks for the interesting question - have good eats!
arekushi has joined #ruby
dellavg__ has joined #ruby
renich has joined #ruby
renich_ has quit [Ping timeout: 240 seconds]
iMadper is now known as Madper|Meeting
dviola has joined #ruby
tdy has quit [Ping timeout: 255 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 240 seconds]
dellavg__ has quit [Ping timeout: 245 seconds]
braincrash has quit [Quit: bye bye]
braincrash has joined #ruby
blackmesa has joined #ruby
ascarter has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
sgen has joined #ruby
Inline has quit [Quit: Leaving]
kapil____ has joined #ruby
marmotini_ has joined #ruby
ascarter has joined #ruby
v01d4lph4 has joined #ruby
elphe has joined #ruby
laaron has joined #ruby
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
elphe has quit [Ping timeout: 240 seconds]
<sagax> hi all!
<sagax> i can't understand, `Dir` - what this method? Example why `Dir["/"]` work but Dir ["/"] or Dir(["/"]) don't work ?
tdy has joined #ruby
<leftylink> since Dir is a class and not a function, `Dir ["/"]` and `Dir(["/"])` do not work. Both of those forms attempt to call a function named Dir with a single argument, ["/"]
blackmesa has quit [Ping timeout: 245 seconds]
<havenwood> sagax: It's syntactic sugar for: Dir.[]("/")
<havenwood> sagax: Or you can omit the parens: Dir.[] "/"
<havenwood> sagax: More succinctly: Dir["/"]
<sagax> Dir["/"] see like as magic
<havenwood> sagax: You can define your own #[] or #[]=
<havenwood> &was >> module Sagax; def self.[] n; n.digits.join.to_i end end; Sagax[42]
<rubydoc> parser error at position 0 around `w'
<havenwood> &>> module Sagax; def self.[] n; n.digits.join.to_i end end; Sagax[42]
<rubydoc> # => 24 (https://carc.in/#/r/6fdz)
<sagax> wow, thanks
elphe has joined #ruby
bambanx has quit [Remote host closed the connection]
bambanx has joined #ruby
elphe has quit [Ping timeout: 252 seconds]
dviola has quit [Quit: WeeChat 2.4]
laaron has quit [Remote host closed the connection]
laaron has joined #ruby
lytol_ has quit [Remote host closed the connection]
laaron has quit [Client Quit]
laaron has joined #ruby
elphe has joined #ruby
awkwords has quit [Ping timeout: 252 seconds]
elphe has quit [Ping timeout: 246 seconds]
duckpuppy has quit [Quit: ZNC 1.7.2 - https://znc.in]
duckpuppy has joined #ruby
Madper|Meeting is now known as Madper|Sleepy
DaRock has quit [Ping timeout: 240 seconds]
cyberRodent has quit [Ping timeout: 268 seconds]
<mjacob> is there a way to get the concatenation of the regexps? e.g. /a/ and /b/ -> /ab/
cyberRodent has joined #ruby
<mozzarella> mjacob: Regexp.union
<mjacob> mozzarella: maybe i'm missing something, but that would give me the union, doesn't it?
<mozzarella> so you want a literal concatenation?
elphe has joined #ruby
bambanxx has joined #ruby
<mjacob> what do you mean by "literal" concatenation?
luminousnine has joined #ruby
bambanxx has quit [Max SendQ exceeded]
bambanxx has joined #ruby
<havenwood> mjacob: /a#{/b/}/
bambanxx has quit [Max SendQ exceeded]
bambanxx has joined #ruby
bambanx has quit [Ping timeout: 245 seconds]
<leftylink> one must be careful if one of the two regexes to be concatenated contains |, since the first approach someone might think of won't do the trick there. but perhaps some parentheses can solve that problem
<leftylink> &>> r1 = /a|b/; r2 = /c/; rcat = /#{r1.source}#{r2.source}/; rcat.match?('a') # but you would think this should be false
<rubydoc> # => true (https://carc.in/#/r/6fe2)
elphe has quit [Ping timeout: 252 seconds]
<leftylink> so perhaps some parens, possibly with ?: if preventing capture is important
rafadc has joined #ruby
<mjacob> havenwood: i think that one is correct
<mjacob> /#{/a|b/}#{/c/}/ -> /(?-mix:a|b)(?-mix:c)/
marmotini_ has quit [Ping timeout: 244 seconds]
<mjacob> is there a way to get rid of the redundant options?
<leftylink> ah, that is fortunate.
<havenwood> mjacob: yeah, and a bit shorter than: Regexp.compile "#{/a|b/}#{/b/}"
<mozzarella> what's your use case mjacob? just curious
<havenwood> mjacob: no, I don't know of a way to remove the options
<mjacob> mozzarella: i have a prefix tree and want to regenerate the corresponding regex
<havenwood> this reminds me of the `o` option for interpolating only once: https://gist.github.com/havenwood/422e9fc9926328a3a192875aff519ddd
conta has joined #ruby
[Butch] has quit [Quit: Textual IRC Client: www.textualapp.com]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
iNs has quit [Remote host closed the connection]
iNs has joined #ruby
reber has joined #ruby
marmotini_ has joined #ruby
elphe has joined #ruby
elphe has quit [Ping timeout: 255 seconds]
za1b1tsu has joined #ruby
aufi has joined #ruby
keden has joined #ruby
teclator has joined #ruby
aupadhye has joined #ruby
nowhereman has quit [Ping timeout: 252 seconds]
keden has quit [Ping timeout: 240 seconds]
clemens3_ has joined #ruby
keden has joined #ruby
Dbugger has joined #ruby
elphe has joined #ruby
clemens3_ has quit [Ping timeout: 252 seconds]
elphe has quit [Ping timeout: 240 seconds]
<sagax> `defined? foo.method` it's good way to check that method exists?
<sagax> or `respond_to?` better?
laaron- has joined #ruby
laaron has quit [Remote host closed the connection]
elphe has joined #ruby
clemens3_ has joined #ruby
keden has quit [Ping timeout: 240 seconds]
sylario has joined #ruby
elphe has quit [Ping timeout: 245 seconds]
eightfold has joined #ruby
Madper|Sleepy is now known as Madper|Qiong
Madper|Qiong is now known as BaiMangHuo
BaiMangHuo is now known as MeiQianChiFan
<havenwood> sagax: the latter is better: foo.respond_to?(:method)
jcarl43 has quit [Quit: WeeChat 2.4]
elphe has joined #ruby
eightfold has quit [Quit: eightfold]
elphe has quit [Ping timeout: 250 seconds]
ellcs has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
jmcgnh has quit [Read error: Connection reset by peer]
lxsameer has joined #ruby
jmcgnh has joined #ruby
DTZUZO has quit [Ping timeout: 240 seconds]
ur5us has joined #ruby
kapil____ has quit [Quit: Connection closed for inactivity]
ur5us has quit [Ping timeout: 252 seconds]
keden has joined #ruby
szulak_ has joined #ruby
szulak_ has quit [Client Quit]
keden has quit [Ping timeout: 245 seconds]
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mangold has quit [Quit: This computer has gone to sleep]
keden has joined #ruby
elphe has joined #ruby
Swyper has joined #ruby
Swyper has quit [Ping timeout: 246 seconds]
Furai has quit [Quit: WeeChat 2.4]
Furai has joined #ruby
Swyper has joined #ruby
blackmesa has joined #ruby
Swyper has quit [Ping timeout: 250 seconds]
dionysus70 has joined #ruby
dionysus70 has quit [Client Quit]
Swyper has joined #ruby
cnsvc_ has quit [Ping timeout: 256 seconds]
bambanxx has quit [Read error: Connection reset by peer]
Swyper has quit [Ping timeout: 252 seconds]
Nicmavr has quit [Read error: Connection reset by peer]
t0x has quit [Quit: Connection closed for inactivity]
Nicmavr has joined #ruby
Emmanuel_Chanel has quit [Quit: Leaving]
cisco has joined #ruby
renich has quit [Ping timeout: 250 seconds]
hightower2 has joined #ruby
rizwan_ has joined #ruby
<rizwan_> hi all
Emmanuel_Chanel has joined #ruby
<rizwan_> I am trying to use Ruby console on my linux machine and am experiencing an error I do not know how to solve, I have been googling but can't find the right info on stackoverflow etc
<rizwan_> This is my error: https://dpaste.de/5nV3
cisco has quit [Quit: leaving]
<rizwan_> may someone please help me?
<tbuehlmann> rizwan_: you probably don't have bundler installed. try running `gem install bundler`
<rizwan_> I tried using 'gem' and it doesnt work on my computer
<rizwan_> apt-get and npm do
<rizwan_> will it work with those?
<rizwan_> i am currently installing bundler using npm
<rizwan_> Hi tbuehlmann I am still having the same problem: https://dpaste.de/0SHC
<tbuehlmann> npm has nothing to do with ruby, don't do that
<tbuehlmann> what exactly happens when you run `gem install bundler`?
<rizwan_> oh. o
<rizwan_> ok
<rizwan_> ill uninstall bundler with npm
<rizwan_> then try gem again
<rizwan_> one second
j416 has quit [Ping timeout: 272 seconds]
<rizwan_> oh - installing bundler worked!
<rizwan_> I remember trying it before and it not working
<rizwan_> i used 'gem install bundler' this time :)
<rizwan_> hi, the command worked but I am still getting an error message: https://dpaste.de/hMwU
<rizwan_> https://dpaste.de/dc2a <- please see this one instead
<tbuehlmann> you're running `ruby console`, you probably mean `rails console`
<rizwan_> i ran rails console too (See my last link https://dpaste.de/dc2a)
<tbuehlmann> even after installing bundler?
kapil____ has joined #ruby
<rizwan_> yes
<rizwan_> after installing bundler
<rizwan_> see this: https://dpaste.de/2578
<rizwan_> (and thanks for this btw :) )
keden has quit [Ping timeout: 252 seconds]
keden has joined #ruby
postmodern has quit [Quit: Leaving]
DTZUZO has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
j416 has joined #ruby
<rizwan_> hi, is anyone there?
<rizwan_> I also ran gem update --system but that didn't work either
<zenspider> mjacob: I've got: re.join("|").to_s.gsub(/-mix/, "")
ellcs has joined #ruby
<zenspider> so... no GOOD way. :P
eblip has joined #ruby
eb0t_ has quit [Ping timeout: 252 seconds]
j416 has quit [Ping timeout: 252 seconds]
j416 has joined #ruby
<c-c> rizwan_: ok you still need help?
<rizwan_> i still need help yes
<rizwan_> thing is, i am new to linux
<c-c> so
<c-c> lets start with your ruby and gem install
<rizwan_> so a lot of these errors really stump me and the solutoions online are too hard tou nderstand
<rizwan_> thanks c-c :)
<c-c> How did you install ruby? B)
<rizwan_> erm
<rizwan_> sudo apt-get
<c-c> Ok
<rizwan_> then i installed bundler via gem install bundler
<rizwan_> but im still getting error messages
<rizwan_> my dpaste links in this chatroom highlight it all
<rizwan_> ive opened and closed my command line multiple times
<c-c> so, bundler doesn't run? Or, gem install doesn't run?
<rizwan_> c-c i am getting these error messages: https://dpaste.de/2578
<c-c> Lets ignore bundler for a while.
<rizwan_> c-c when i try to run rails in my console i get this: https://dpaste.de/Jrft
<rizwan_> and i am trying to run rails console
<c-c> Lets check your ruby and gem install. Or, I'll try to show you how you can do that. Ignore rails, too, for now.
<rizwan_> thank you :)
<c-c> So, in your shell you have environment var $PATH, that is for searching for commands in dirs.
<rizwan_> yes
<c-c> Also, $GEM_HOME and $GEM_PATH are needed for gems
<rizwan_> ok
<rizwan_> i dont know what a gem is
<rizwan_> ill look it up
<c-c> its the gem command
<rizwan_> ah it is a packaging manager
<rizwan_> oh yes i see
<c-c> yes, gem is for ruby, what npm is for js
<rizwan_> when i echo $PATH this is the output btw https://dpaste.de/bXmN
<c-c> Ok, now you know the first thing: check path!
Swyper has joined #ruby
<c-c> second thing: whats gem doing. try looking at its paths: $ gem environment
<rizwan_> :)
<rizwan_> c-c i ran the command
<c-c> you already have the $, no need to retype it ;)
<c-c> so, try without
<rizwan_> oh ok !
<rizwan_> with $echo PATH I have to
<c-c> when you see $ before command, you know its supposed to be run in a shell or term
<rizwan_> c - c here it is: https://dpaste.de/1WQP
<rizwan_> ah i see, thanks :)
* c-c suggest you take a piece of paper and write the $ and path stuff down in large weird letters
<rizwan_> c-c why is it a good idea for me take a piece of paper and write $ and path stuff down in large weird letters?
<c-c> also try (and write in note) $ which ruby
<c-c> rizwan_: because writing it down will cause your brain to process it, and that will cause it to be memorized in your brain!
<rizwan_> sorry c-c, i dont understand what you mean y writing in note
<rizwan_> by*
<c-c> it means: make notes
<rizwan_> oh, i see
<c-c> 8)
<rizwan_> erm
Swyper has quit [Ping timeout: 255 seconds]
<rizwan_> just to memorise the output of gem environment/
<rizwan_> ?
<rizwan_> copy it all out onto paper/
<rizwan_> ?
<c-c> all of this
<rizwan_> ok
<rizwan_> to be honest thats a pretty big thing to do
<rizwan_> i might do it later
* c-c has to go, but will be back in 30
<rizwan_> right now i need rails console to run so that I can install and run a git repo
<rizwan_> ok
<c-c> rizwan_: you need to get this stuff right first, the path vars in your shell env
<c-c> later
tdy has quit [Ping timeout: 245 seconds]
v01d4lph4 has quit [Remote host closed the connection]
v01d4lph4 has joined #ruby
mangold has joined #ruby
akem has quit [Quit: Leaving]
v01d4lph4 has quit [Remote host closed the connection]
conta has quit [Ping timeout: 252 seconds]
v01d4lph4 has joined #ruby
<kke> does someone use ThreadGroup for something and why?
elphe has quit [Ping timeout: 246 seconds]
ldnunes has joined #ruby
elphe has joined #ruby
<c-c> kke: is it for gwtting your threads stopped etc at the same time
<kke> c-c: compared to a regular array, it only seems to give threads `Thread.current.group` accessor. group = []; group << Thread.new(group) { |group| Thread.current[:group] = group; # do stuff };
<kke> it could somehow interface with ThreadsWait but it doesn't.
conta has joined #ruby
donofrio has joined #ruby
opya has joined #ruby
marmotini_ has quit [Ping timeout: 240 seconds]
bvdw8 has quit [Quit: bvdw8]
<c-c> kke: well then you know where your threads are
<havenwood> kke: It automatically adds threads spawned by threads already in the group.
marmotini_ has joined #ruby
<havenwood> Or threads spawned by threads spawned by threads, and so on.
<havenwood> group = ThreadGroup.new; group.add Thread.new { Thread.new { Thread.new { sleep }; sleep }; sleep }; group.list.size #=> 3
opya has left #ruby [#ruby]
<kke> ok that makes sense
<kke> i would still expect the group to have some methods like group.alive? instead of having to do group.list.any?(&:alive?)
AJA4350 has joined #ruby
<c-c> Whats alive do on a thread anyway?
bvdw has joined #ruby
lucasb has joined #ruby
moonglum has quit [Quit: OFTC spam preventative kick]
kapil____ has quit [Quit: Connection closed for inactivity]
elphe has quit [Quit: leaving]
Swyper has joined #ruby
Tuor has joined #ruby
Swyper has quit [Ping timeout: 245 seconds]
<c-c> ok, it does exist on a thread instance to check if sleeping
v01d4lph4 has quit [Remote host closed the connection]
akem has joined #ruby
keden has quit [Ping timeout: 255 seconds]
AJA4351 has joined #ruby
AJA4350 has quit [Ping timeout: 240 seconds]
AJA4351 is now known as AJA4350
cd has quit [Quit: cd]
keden has joined #ruby
alem0lars has joined #ruby
merijn has joined #ruby
<merijn> Is there some sort of quickstart "how to read rubydocs in 10 minutes" style crash course?
jcalla has joined #ruby
<c-c> merijn: install ri, run $ ri <cmd>
<c-c> Thats less than a minute!
<c-c> hm, '<cmd>' isn't right, maybe that should be '<keyword>'
keden has quit [Ping timeout: 245 seconds]
keden has joined #ruby
yokel has quit [Remote host closed the connection]
yokel has joined #ruby
Onwarion_re is now known as Onwarion
Swyper has joined #ruby
duderonomy has joined #ruby
eightfold has joined #ruby
Swyper has quit [Ping timeout: 252 seconds]
eightfold has quit [Quit: eightfold]
blackmesa has joined #ruby
AJA4351 has joined #ruby
ljarvis has joined #ruby
AJA4350 has quit [Ping timeout: 250 seconds]
AJA4351 is now known as AJA4350
<merijn> c-c: No, I didn't mean how to display them, I meant "how do I learn enough Ruby to understand wtf any of this means"
<ljarvis> o/
xrexeon has joined #ruby
<phaul> \o
<phaul> merijn: I recommend reading an introductory book
<merijn> phaul: I don't want an introductory book, I want a short and dense overview for experienced programmers
<merijn> phaul: Too many introductory links waste a lot of time on basics of programming, I just want a syntax + semantics summary
rizwan_ has quit [Read error: Connection reset by peer]
<merijn> al2o3-cr: That covers most syntax, afaict, but doesn't at all define the semantics, just handwavey examples
<ryouba> hi!
<ryouba> is there a rubylicious way to achieve https://gist.github.com/sixtyfive/66da90ae299c032c58d4712d2ddbff7d ?
bmurt has joined #ruby
xrexeon has quit [Ping timeout: 240 seconds]
cyberarm has joined #ruby
<ellcs> flatten?
<ellcs> &>> {:blah=>"blah", :foobar=>{:lalala=>"lalala", :lipsum=>"lipsum"}}.flatten
<rubydoc> # => [:blah, "blah", :foobar, {:lalala=>"lalala", :lipsum=>"lipsum"}] (https://carc.in/#/r/6fj4)
<ellcs> nvm :D
<ryouba> ellcs: you hadn't seen the underscores at first? :)
<ellcs> noes :D
<ryouba> also i just discovered Enumerable#each_with_object ... seems like it's the much better choice, rather than #map.
<ellcs> Also #reduce would seem better, doesnt it?
Rapture has joined #ruby
xrexeon has joined #ruby
<ellcs> what about a level deeper?
<ellcs> a hash in a hash in a hash
conta has quit [Ping timeout: 252 seconds]
xrexeon has quit [Ping timeout: 240 seconds]
<ljarvis> &>> {:blah=>"blah", :foobar=>{:lalala=>"lalala", :lipsum=>"lipsum"}}.map { |k, v| v.is_a?(Hash) ? v.map { |vk, vv| ["#{k}_#{vk}", vv] } : [[k, v]] }.flatten(1).to_h
<rubydoc> # => {:blah=>"blah", "foobar_lalala"=>"lalala", "foobar_lipsum"=>"lipsum"} (https://carc.in/#/r/6fj7)
<ryouba> ellcs: i build the hash myself, so i know it's only 2 levels deep, ever
<ryouba> ljarvis: thank you! :D
<ljarvis> np
<ryouba> i also like the "vk,vv" naming
<ljarvis> it's lazy tbh, I hope it's not production code ;)
<ryouba> ljarvis: so you do think that #map is the best method to use for this, and neither #each_with_object nor #reduce?
skryking has joined #ruby
<ljarvis> yeah, reduce doesn't work for me because you're not really reducing, and each_with_object is nice except that you *always* want to append to this new enumerable object you've created, so it seems superfluous to me
<ryouba> ljarvis: production, schmoduction. it's a script that converts an excel file into an sqlite database. if for some reason it should ever fail, i'm the only user and i'm the only fixer.
<ljarvis> :)
tdy has joined #ruby
<ryouba> okay, then map it is.
<ryouba> i do think i'll monkey-patch this into Hash, though. it does seem useful enough to use every once in a while :)
<ljarvis> oh no
* ljarvis runs
<ryouba> Hash#underscorize_hierarchy or so
<ljarvis> -_-
<ryouba> heheheheheh you don't like the name?
<al2o3-cr> i'd prefer flat_map there ;)
<ljarvis> ^
<ljarvis> there's always someone.. (agree though)
<ryouba> as a name?
<ryouba> oh, wait ... /me googles
<ljarvis> you can remove the is_a?(Hash) too if you're creative
<ljarvis> but I think we've done enough damage
* al2o3-cr does and hides
<ryouba> lol
<ryouba> okay, googling Hash#flat_map brought me to https://money.stackexchange.com/questions/105885/can-i-become-debt-free-or-should-i-file-for-bankruptcy-how-do-i-manage-my-debt ... for whatever reason. you guys may laugh now.
<ljarvis> "Ruby flap_map"
<ljarvis> heh flap
<ryouba> not much gain over your original solution
<notZarthus> are people actually that bad at accounting?
<ljarvis> it creates less objects so it's better for large data
<notZarthus> it's not that hard to think "i need to save money" "let's stop going to restaurants, for one"
KeyJoo has joined #ruby
<notZarthus> every college student learns to live on ramen, it's nothing new
cow[moo] has joined #ruby
<ryouba> as someone from a country with usually-free education i'm chin-on-floor whenever i read about monetary situation of US students
Tuor has quit [Quit: Konversation terminated!]
<skryking> I learned to get really good at cooking grilled cheese on the heater in my dorm room when I was in college
gnufied has joined #ruby
<ryouba> i mean, the guy is just 1 year younger than me, makes around 10 times as much as i do, and still has to ask that question, whereas my whole student loan debts are ~25k$US and if i won't have been able to start paying them off in the next 15 years then i'll never have to pay sthem off
<ryouba> well okay, my rent is not 1500$US, either ... that's a HUGE expense. and i don't own a car, don't want to, don't have to, probably never will.
<notZarthus> 1500$ US on a 80k income after taxes is pretty acceptable
<notZarthus> your rent is your most expensive expense, after all
<ryouba> true ... he should be able to live more stress free with those numbers anyways.
cow[moo] has quit [Ping timeout: 246 seconds]
<ryouba> first sentence of the first answer is the whole story already
<skryking> Depends on where in the US a person lives
<ryouba> sounds like one of the bigger cities, no?
<skryking> I live way out in suburbs of chicago and 1500 gets a small apartment
<ryouba> o_O
<ryouba> i have a nice apartment (80m², balcony, shared garden) in a big German city and it's 550€ per month, water, sewage, electricity, internet, etc. included.
<notZarthus> ryouba: same here, though in the Netherlands and I pay 1100 EUR
<notZarthus> this building was built in 2018 though :)
<ryouba> notZarthus: always thought the netherlands were cheaper than that ... would you say that's mid-range?
<notZarthus> the Netherlands is expensive
<notZarthus> Germany is way cheaper in everything.
<skryking> before I bought my house about 12 years ago I was paying $1400 for an apartment that didn't include water, electricity, internet...
AJA4351 has joined #ruby
<ryouba> shame, we're wondering whether my gf will do her PhD there or here
<notZarthus> I've lived for 2 years in Germany, would welcome all of it back except for the location/people.
mustmodify has joined #ruby
<skryking> I lived in Germany a really long time ago... was nice
<ryouba> skryking: then no wonder there's whole tent cities full of employed (?) citizens in the US
awkwords has joined #ruby
<ryouba> notZarthus: sounds like the south west?
<notZarthus> ryouba: Leipzig, Germany and all over the Netherlands.
<mustmodify> How do I represent this character in ruby, so that I can use gsub to remove it? https://www.fileformat.info/info/unicode/char/200b/index.htm
<ryouba> notZarthus: curious. i always thought as a student you'll meet nice people in the eastern states of Germany.
<ryouba> (and i have, so far)
<notZarthus> east-germany is not my kinda thing, personally.
AJA4350 has quit [Ping timeout: 245 seconds]
AJA4351 is now known as AJA4350
<mustmodify> current guess is "\u200B"
<notZarthus> the students are OK but still woeful at english
<ryouba> it is an acquired taste, yes :)
<ljarvis> mustmodify: "\u200B"
<ljarvis> yes
<mustmodify> great thanks
<mustmodify> zero-width space is the dumbest character I've ever considered considering.
<ryouba> notZarthus: don't get me started. my gf is from India. sometimes (read: often) i feel ashamed for my fellow Germans.
<notZarthus> ryouba: I'm still getting nags from Vodafone DE that "I owe them money" for a terminated contract that is fully paid. :|
<notZarthus> they have 0 options for support.
<ryouba> mustmodify: wait until you start having to deal with zero-width joiner and zero-width NON-joiner
<ryouba> notZarthus: okay, stupid you for having chosen Vodafone then ;-)
<notZarthus> ryouba: that is fair, but they were the only ISP with a decent internet bundle
<notZarthus> not all germans are bad, most of my current colleagues are german. But if you walk around in a city, there is no comparison. Dutch people are more friendly.
<notZarthus> If you go inside of a story in Germany they actively don't want to sell you their product, which baffles me a little bit.
<ryouba> hel lekker notZarthus :)
<notZarthus> store*
<ryouba> and yeah, feels the same to me
<notZarthus> you guys have amazing lunches though
<ryouba> huh? we do?
<notZarthus> in the Netherlands I pay 11 for a barebones Schnitzel
<ryouba> like what?
<ryouba> oh you mean the prizes
<notZarthus> In Germany this is 5 EUR
<ryouba> c*
<notZarthus> just in general, also the taste.
<ryouba> how's non-meet food in the netherlands?
<ryouba> money-wise?
marmotini_ has quit [Ping timeout: 245 seconds]
<ryouba> meat*
<notZarthus> food here is decent, but most restaurants open at 4 PM
<ryouba> that seems weird
<notZarthus> price-wise, it's all about double from germany
<ryouba> perhaps we'll just skip europe entirely and move to india instead
<ljarvis> folks, please consider joining #ruby-offtopic for non-Ruby discussion to avoid discouraging new joiners from asking questions
<ryouba> whoops, sorry!
<notZarthus> sorry :)
<notZarthus> ryouba: I'll PM instead
Inline has joined #ruby
<ljarvis> no worries, do continue your nice conversation though :)
<ryouba> notZarthus: i should continue working anyways :}
<mustmodify> I'm sometimes frustrated by people who figure that because JS is available in all browsers, it must be the superior language for back-ends.
<mustmodify> I mean, it's an option, but to rule out other options because of wide availability... hm...
comerijn has joined #ruby
merijn has quit [Ping timeout: 246 seconds]
aupadhye has quit [Ping timeout: 252 seconds]
comerijn has quit [Ping timeout: 245 seconds]
mangold has quit [Ping timeout: 252 seconds]
endorama has quit [Ping timeout: 250 seconds]
zapata has quit [Quit: WeeChat 2.4]
rippa has joined #ruby
jmcgnh has quit [Ping timeout: 252 seconds]
mangold has joined #ruby
eb0t_ has joined #ruby
eblip has quit [Ping timeout: 240 seconds]
ascarter has joined #ruby
ellcs has quit [Ping timeout: 240 seconds]
agent_white has quit [Quit: leaving]
zapata has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
polishdub has joined #ruby
AJA4350 has quit [Ping timeout: 252 seconds]
ascarter has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
marmotini_ has joined #ruby
<ryouba> q
aufi has quit [Ping timeout: 268 seconds]
conta has joined #ruby
conta has quit [Ping timeout: 240 seconds]
mustmodify has left #ruby [#ruby]
lxsameer has quit [Ping timeout: 245 seconds]
KeyJoo has quit [Quit: KeyJoo]
duderonomy has joined #ruby
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
<robotcars> gonna ask a very unexperienced question. :P
<robotcars> i'm using Shoryuken to poll SQS messages, and pass each to a Sequel.insert
polishdub has quit [Remote host closed the connection]
<robotcars> I want to run routine outside that that will check the DB for the IP address of new rows and collect the geo info from a third party api (i've written this part)
<robotcars> but I don't know how/where to add that routine, and have it run every few minutes and not with every single event
<robotcars> i feel like sleep(60) isn't enough… because if shoryuken kicks up multiple threads, then I'm running multiple threads of sleep(60) method()
<robotcars> not really looking for 'the answer', maybe just an article, concept, or ruby idea that might help me get there
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa has quit [Ping timeout: 252 seconds]
marmotini_ has quit [Ping timeout: 245 seconds]
ascarter has joined #ruby
ascarter has quit [Client Quit]
v01d4lph4 has joined #ruby
mangold has quit [Quit: This computer has gone to sleep]
blackmesa has joined #ruby
v01d4lph4 has quit [Remote host closed the connection]
marmotini_ has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
v01d4lph4 has joined #ruby
eightfold has joined #ruby
sameerynho has joined #ruby
v01d4lph4 has quit [Ping timeout: 252 seconds]
blaguvest has joined #ruby
blackmesa has joined #ruby
cnsvc_ has joined #ruby
duderonomy has joined #ruby
blackmesa has quit [Ping timeout: 252 seconds]
marmotini_ has quit [Remote host closed the connection]
marmotini_ has joined #ruby
blackmesa has joined #ruby
gix has joined #ruby
AJA4350 has joined #ruby
v01d4lph4 has joined #ruby
postmodern has joined #ruby
eightfold has quit [Quit: eightfold]
lytol_ has joined #ruby
awkwords has quit [Ping timeout: 245 seconds]
v01d4lph4 has quit [Ping timeout: 245 seconds]
awkwords has joined #ruby
clemens3_ has quit [Ping timeout: 244 seconds]
keden has quit [Ping timeout: 250 seconds]
rprimus has quit [Ping timeout: 244 seconds]
blackmesa has quit [Ping timeout: 258 seconds]
rprimus has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
jcarl43 has joined #ruby
orbyt_ has joined #ruby
jmcgnh has joined #ruby
szulak_ has joined #ruby
szulak_ has quit [Client Quit]
coffeejunk has quit [Excess Flood]
coffeejunk has joined #ruby
agent_white has joined #ruby
Averna has joined #ruby
elcontrastador has joined #ruby
<elcontrastador> What's the most accurate way of determining if a file is open/changing prior to performing an operation on that file? Similarly, what is the most pragmatic way? Using system calls like 'lsof' is very slow but may be my only option...
Averna has quit [Remote host closed the connection]
marmotini_ has quit [Remote host closed the connection]
sgen has quit [Ping timeout: 252 seconds]
t0x has joined #ruby
conta has joined #ruby
xrexeon has joined #ruby
conta has quit [Ping timeout: 252 seconds]
sgen has joined #ruby
<elcontrastador> Even 'lsof' is not any guarantee...
<al2o3-cr> elcontrastador: is it a file you're opening?
<elcontrastador> al2o3-cr: No, that's an easier problem. I'm just processing files of arbitrary dir that could have files open by any app/process
<al2o3-cr> elcontrastador: you gonna have a hard time then doing that from ruby.
Ekho has quit [Quit: An alternate universe was just created where I didn't leave. But here, I left you. I'm sorry.]
ravenousmoose has joined #ruby
<elcontrastador> al2os-cr: yeah, figured that, if possible at all, it would be a syscall or two
<elcontrastador> lsof is unbearably slow
<al2o3-cr> elcontrastador: what syscalls do you have in mind for this?
<elcontrastador> lsof and it's options...looking at FD and such...
<al2o3-cr> oh, system calls?
<al2o3-cr> elcontrastador: i thought you meant syscall.
<elcontrastador> al2os-cr: yeah, sorry...that was confusing. system call
<al2o3-cr> yeah, i was thinking then haha
<elcontrastador> i'm getting pounded with texts and calls...shorthanding it
<al2o3-cr> yeah, no worries.
makr8100 has joined #ruby
hightower2 has quit [Ping timeout: 250 seconds]
nowhereman has joined #ruby
<makr8100> any recommendations on docs for a beginner on ruby deployments with apache? I'm new ot ruby, not to programming in general
<makr8100> I should specify it's ROR
Averna has joined #ruby
<al2o3-cr> makr8100: you might be better off asking in #rubyonrails if no one answers here.
tdy has joined #ruby
<makr8100> ah, didn't realize it was a separate channel. thanks
<miah> i just put webbrick / puma whatever behind haproxy and only route the dynamic requests to that endpoint. putting it behing apache just adds another layer that isnt helpful
<miah> one haproxy that knows about all your rails endpoints will get amaze performance
<miah> and you can better distribute the load and handle failures.
<miah> https://www.amazon.com/Art-Capacity-Planning-Scaling-Resources/dp/0596518579 is really great if you want to learn all about building stable web sites =)
<miah> sadly its really common to have like 'load balancer -> apache -> rails' rather than 'load balancer -> rails'
alem0lars has quit [Ping timeout: 245 seconds]
<miah> and you can swap apache/nginx in most scenarios. its just another layer of indirection where requests can get lost and tied up waiting for your rails backend to process.
<miah> rather than letting haproxy route things to available rails endpoints
Averna has quit [Read error: Connection timed out]
<makr8100> I'm 3 days into working as a php dev in-house at a factory and they sprung this on me. It's an existing system that needs maintenance. First request is that someone actually hard coded the cost per mile into the ruby source, so new install it is?
<miah> i'll shush now, i can rant about this for hours because ive seen it so many times and it frustrates me to no end
<makr8100> I have near 0 ruby experience
Averna has joined #ruby
<makr8100> so hurray for that
nowhereman has quit [Ping timeout: 257 seconds]
orbyt_ has quit [Ping timeout: 250 seconds]
mozzarella has quit [Remote host closed the connection]
ravenousmoose has quit [Ping timeout: 258 seconds]
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
mozzarella has joined #ruby
Ekho has joined #ruby
za1b1tsu has quit [Remote host closed the connection]
renich has joined #ruby
<havenwood> kirun: zenspider: Nobu already fixed it :) https://github.com/ruby/ruby/commit/7fed9a2df50404c734504e0405ecaa98f0d9147c
spacesuitdiver has joined #ruby
SeepingN has joined #ruby
rizwan_ has joined #ruby
ur5us has joined #ruby
awkwords has quit [Read error: Connection reset by peer]
skryking has quit [Quit: Leaving]
skryking has joined #ruby
<ljarvis> :)
clemens3_ has joined #ruby
ellcs has joined #ruby
Averna has quit [Remote host closed the connection]
Rapture has quit [Quit: Textual IRC Client: www.textualapp.com]
v01d4lph4 has joined #ruby
rizwan_ has quit [Remote host closed the connection]
renich_ has joined #ruby
Averna has joined #ruby
renich has quit [Ping timeout: 268 seconds]
renich_ is now known as renich
v01d4lph4 has quit [Ping timeout: 240 seconds]
laaron- has quit [Quit: ZNC 1.7.1 - https://znc.in]
laaron has joined #ruby
al2o3-cr has quit [Ping timeout: 246 seconds]
al2o3-cr has joined #ruby
clemens3 has joined #ruby
hightower3 has joined #ruby
clemens3_ has quit [Ping timeout: 255 seconds]
ldnunes has quit [Quit: Leaving]
jinie has joined #ruby
tdy has quit [Ping timeout: 252 seconds]
reber has quit [Remote host closed the connection]
kevinburke has joined #ruby
cd has joined #ruby
tdy has joined #ruby
Dbugger has quit [Ping timeout: 240 seconds]
Tempesta has quit [Quit: AdiIRC is updating to v3.4 Beta Build (2019/03/06 UTC) 64 Bit]
Tempesta has joined #ruby
renich_ has joined #ruby
renich has quit [Ping timeout: 245 seconds]
sgen has quit [Ping timeout: 252 seconds]
skryking has quit [Quit: Leaving]
teclator has quit [Ping timeout: 240 seconds]
Fusl has quit [Excess Flood]
renich has joined #ruby
renich_ has quit [Ping timeout: 255 seconds]
ellcs has quit [Ping timeout: 240 seconds]
bmurt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
t0x has quit [Quit: Connection closed for inactivity]
Fusl has joined #ruby
blackmesa has joined #ruby
cthulchu is now known as cthaeh
TheBloke has quit [Ping timeout: 240 seconds]
TheBloke has joined #ruby
v01d4lph4 has joined #ruby
renich has quit [Ping timeout: 245 seconds]
sgen has joined #ruby
v01d4lph4 has quit [Ping timeout: 255 seconds]
cthaeh is now known as cthulchu
ellcs has quit [Ping timeout: 240 seconds]
DTZUZO has quit [Ping timeout: 240 seconds]
ellcs has joined #ruby
lucasb has quit [Quit: Connection closed for inactivity]
rafadc has quit [Ping timeout: 245 seconds]
luminousnine has quit [Read error: Connection reset by peer]
ivanskie has joined #ruby
sameerynho has quit [Ping timeout: 245 seconds]
spacesuitdiver has quit [Ping timeout: 245 seconds]
al2o3-cr has quit [Quit: WeeChat 2.4]
al2o3-cr has joined #ruby
laaron- has joined #ruby
laaron has quit [Ping timeout: 256 seconds]
xrexeon has quit [Remote host closed the connection]
angryrobot has joined #ruby
gnufied has quit [Remote host closed the connection]