havenwood changed the topic of #ruby to: Rules & more: https://ruby-community.com | Ruby 2.5.1, 2.4.4, 2.3.7, 2.6.0-preview2: https://www.ruby-lang.org | Paste 4+ lines of text to https://gist.github.com | Rails questions? Ask in #RubyOnRails | Books: https://goo.gl/wpGhoQ | Logs: https://irclog.whitequark.org/ruby
xuyuheng has quit [Ping timeout: 240 seconds]
cagomez has quit [Remote host closed the connection]
<zxq2> is there a way to access the underlying file descriptor that belongs to a socket obj?
cagomez has joined #ruby
karapetyan has quit [Ping timeout: 245 seconds]
cagomez has quit [Remote host closed the connection]
duderonomy has joined #ruby
cschneid has joined #ruby
blackmesa1 has quit [Ping timeout: 256 seconds]
cschneid has quit [Remote host closed the connection]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
cagomez has joined #ruby
cagomez has quit [Remote host closed the connection]
<konsolebox> zxq2: #fileno or #to_i. See IO, which is a grandparent of Socket.
caleBOT_ has quit [Remote host closed the connection]
caleBOT has joined #ruby
wilbert has joined #ruby
planigan has quit [Remote host closed the connection]
xuyuheng has joined #ruby
alex`` has quit [Ping timeout: 256 seconds]
<darkhanb> spaces or tabs?
planigan has joined #ruby
caleBOT has quit [Ping timeout: 240 seconds]
cschneid has joined #ruby
blackmesa1 has joined #ruby
<havenwood> ?tabs darkhanb
<ruby[bot]> darkhanb: Ruby community standards recommend using 2 spaces as indentation (see https://github.com/bbatsov/ruby-style-guide#spaces-indentation and https://ukupat.github.io/tabs-or-spaces/).
<havenwood> darkhanb: 489 repos, 100% 2-space, soft tabs.
xuyuheng has quit [Ping timeout: 245 seconds]
<havenwood> darkhanb: There is more than one way to do it, but we've all agreed on the right way. ;-)
cschneid has quit [Remote host closed the connection]
<konsolebox> I code 2-spaces in Ruby as well, even though I generally prefer tabs. But "Ruby community standards" is quite misleading. It's "A community-driven Ruby coding style guide".
amar_ has joined #ruby
darkhanb has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
rshetty has joined #ruby
amar_ has quit [Ping timeout: 248 seconds]
starseed0000 has quit [Ping timeout: 245 seconds]
planigan has quit [Quit: leaving]
mynameisdebian has quit [Remote host closed the connection]
rshetty has quit [Ping timeout: 268 seconds]
planigan has joined #ruby
tff^ has quit []
<zenspider> there's nothing misleading about it where tabs are concerned. Spaces or we knife you!
xuyuheng has joined #ruby
mynameisdebian has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
xuyuheng has quit [Ping timeout: 248 seconds]
SeepingN has quit [Quit: The system is going down for reboot NOW!]
addyluxe has joined #ruby
dviola has quit [Quit: WeeChat 2.1]
<headius> tabs suck
r29v has quit [Quit: r29v]
mynameis_ has joined #ruby
mynameisdebian has quit [Read error: Connection reset by peer]
d^sh has quit [Ping timeout: 240 seconds]
addyluxe has quit [Ping timeout: 276 seconds]
orbyt_ has joined #ruby
d^sh has joined #ruby
eckhardt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jcarl43 has quit [Quit: WeeChat 2.1]
wilbert has quit [Ping timeout: 256 seconds]
caleBOT has joined #ruby
cschneid has joined #ruby
tdy has quit [Ping timeout: 240 seconds]
cadillac_ has quit [Ping timeout: 248 seconds]
wilbert has joined #ruby
cschneid has quit [Remote host closed the connection]
quobo has quit [Quit: Connection closed for inactivity]
cschneid has joined #ruby
roamingdog has joined #ruby
jrafanie has joined #ruby
cadillac_ has joined #ruby
cschneid has quit [Remote host closed the connection]
cschneid has joined #ruby
caleBOT has quit [Remote host closed the connection]
caleBOT has joined #ruby
tag has quit [Quit: Connection closed for inactivity]
mynameis_ has quit [Remote host closed the connection]
caleBOT has quit [Ping timeout: 248 seconds]
noobineer has joined #ruby
wilbert has quit [Ping timeout: 240 seconds]
cschneid has quit [Remote host closed the connection]
zachk has quit [Quit: Leaving]
xuyuheng has joined #ruby
mynameisdebian has joined #ruby
cschneid has joined #ruby
ciscam has quit [Ping timeout: 256 seconds]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
blackmesa1 has quit [Ping timeout: 255 seconds]
ciscam has joined #ruby
sylario has quit [Quit: Connection closed for inactivity]
AJA4350 has quit [Quit: AJA4350]
caleBOT_ has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
n0m4d1c has joined #ruby
karapetyan has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
caleBOT_ has quit [Ping timeout: 256 seconds]
bradleyprice has joined #ruby
nicht has quit [Ping timeout: 256 seconds]
karapetyan has quit [Ping timeout: 260 seconds]
graphene has quit [Remote host closed the connection]
mupt has quit [Ping timeout: 245 seconds]
graphene has joined #ruby
mynameisdebian has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
bjpenn has joined #ruby
bjpenn has quit [Ping timeout: 240 seconds]
c0ncealed2 has quit [Remote host closed the connection]
c0ncealed2 has joined #ruby
RougeT430 has quit [Ping timeout: 256 seconds]
cschneid has quit [Remote host closed the connection]
amar_ has joined #ruby
cschneid has joined #ruby
r29v has joined #ruby
r29v has quit [Client Quit]
amar_ has quit [Ping timeout: 265 seconds]
mynameisdebian has quit [Remote host closed the connection]
n0m4d1c has quit [Quit: leaving]
cschneid has quit [Remote host closed the connection]
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
erratic has quit [Ping timeout: 256 seconds]
cadillac_ has quit [Quit: I quit]
cadillac_ has joined #ruby
karapetyan has joined #ruby
jinie has quit [Ping timeout: 268 seconds]
mynameisdebian has joined #ruby
jinie has joined #ruby
braincrash has quit [Quit: bye bye]
karapetyan has quit [Ping timeout: 265 seconds]
n0m4d1c has joined #ruby
n0m4d1c has left #ruby [#ruby]
cschneid has joined #ruby
xuyuheng has quit [Quit: Quit: My MacBook Pro has gone to sleep. ZZZzzz?]
braincrash has joined #ruby
coderphive has quit [Remote host closed the connection]
coderphive has joined #ruby
cschneid has quit [Remote host closed the connection]
apeiros__ has joined #ruby
apeiros has quit [Ping timeout: 240 seconds]
apeiros__ has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
ciscam has quit [Ping timeout: 256 seconds]
ciscam has joined #ruby
fluxAeon has quit [Ping timeout: 256 seconds]
taylorzr has joined #ruby
apeiros has quit [Ping timeout: 264 seconds]
apeiros__ has joined #ruby
NingaLeaf has joined #ruby
noobineer has quit [Ping timeout: 245 seconds]
NingaLeaf has quit [Client Quit]
kapil___ has joined #ruby
gix has joined #ruby
gix- has quit [Ping timeout: 268 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
graphene has quit [Remote host closed the connection]
apeiros has joined #ruby
graphene has joined #ruby
fluxAeon has joined #ruby
darkhanb has joined #ruby
apeiros__ has quit [Ping timeout: 264 seconds]
mr_rich101 has quit [Quit: ZNC - http://znc.in]
mr_rich101 has joined #ruby
bradleyprice has quit [Remote host closed the connection]
alex`` has joined #ruby
bradleyprice has joined #ruby
caleBOT has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Crack has joined #ruby
mynameisdebian has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
orbyt_ has joined #ruby
orbyt_ has quit [Client Quit]
caleBOT has quit [Ping timeout: 264 seconds]
rshetty has joined #ruby
erratic has joined #ruby
arekushi has quit [Remote host closed the connection]
rshetty has quit [Remote host closed the connection]
Hobbyboy has quit [Ping timeout: 276 seconds]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
_rshetty_ has joined #ruby
tolerablyjake has joined #ruby
rshetty has quit [Ping timeout: 240 seconds]
Hobbyboy has joined #ruby
Axy has joined #ruby
Axy has quit [Changing host]
Axy has joined #ruby
Mia has quit [Ping timeout: 265 seconds]
anisha has joined #ruby
taylorzr has quit [Ping timeout: 256 seconds]
tdy has joined #ruby
orbyt_ has joined #ruby
BloopMonster has quit [Ping timeout: 256 seconds]
reber has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
starseed0000 has joined #ruby
zapata has quit [Read error: Connection reset by peer]
zapata has joined #ruby
sauvin has joined #ruby
orbyt_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jsrtr_ has quit [Ping timeout: 265 seconds]
Inline has quit [Quit: Leaving]
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
aupadhye has joined #ruby
bjpenn has joined #ruby
roamingdog has quit [Remote host closed the connection]
tolerablyjake has joined #ruby
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
aufi has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
roamingdog has quit [Remote host closed the connection]
rshetty has joined #ruby
apeiros has quit [Remote host closed the connection]
wget has quit [Ping timeout: 276 seconds]
wget has joined #ruby
wget has quit [Changing host]
wget has joined #ruby
_rshetty_ has quit [Ping timeout: 256 seconds]
mynameisdebian has joined #ruby
howdoi has quit [Quit: Connection closed for inactivity]
apeiros has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
akaiiro has quit [Remote host closed the connection]
apeiros has quit [Remote host closed the connection]
halbbalda has joined #ruby
amar has joined #ruby
amar has quit [Ping timeout: 240 seconds]
rshetty has quit [Remote host closed the connection]
andikr has joined #ruby
halbbalda has left #ruby ["Leaving"]
Crack has quit [Ping timeout: 268 seconds]
konsolebox has quit [Ping timeout: 255 seconds]
marius has quit [Quit: baj]
dionysus69 has joined #ruby
marius has joined #ruby
konsolebox has joined #ruby
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
jnollette has quit [Ping timeout: 250 seconds]
megamos has joined #ruby
amar has joined #ruby
schleppel has joined #ruby
mtkd has joined #ruby
yohji has joined #ruby
amar has quit [Ping timeout: 248 seconds]
vonfry has joined #ruby
pauliesaint has quit [Ping timeout: 256 seconds]
<dionysus69> Greetings to the Jedis of the red gem
<dionysus69> I have a strange problem
<dionysus69> I am using Jimson to send RPC commands to the server
<dionysus69> I create it like this Jimson::Client.new("http://localhost:123")
BloopMonster has joined #ruby
TomyWork has joined #ruby
<dionysus69> Jimson::Client.new("http://localhost:8545").SomeMethod works fine and returns successfully but I cannot do the same with method_missing
amar has joined #ruby
pauliesaint has joined #ruby
<dionysus69> so, this gives an error, invalid or empty response from server https://gist.github.com/webzorg/d7a6801270d30e999bad650e1a391a22
<dionysus69> but those two ways are the same right? in one I call method directly on the jimson orbject, while here I use method.send
<dionysus69> one works the other doesn't
anisha has quit [Ping timeout: 256 seconds]
sysvalve has joined #ruby
Tharbakery has quit [Ping timeout: 256 seconds]
claudiuinberlin has joined #ruby
blackmesa1 has joined #ruby
conta has joined #ruby
amar has quit [Remote host closed the connection]
amar has joined #ruby
<Bish> havenwood: so ruby tries to call unary ** of {} ?
<havenwood> Bish: MRI is alone it seems in interpreting the {} as a block - hence no return value.
anisha has joined #ruby
<havenwood> Bish: I bisected it to this commit, where it goes from thinking it's a block to the segfault: https://github.com/ruby/ruby/commit/4b279cfdd2e3e4a05e852632f3305c893f6c46a4
<havenwood> I haven't had a chance to look into it further than that yet.
<Bish> thanks for your work :) although this bug unlikely would ever affect anyone
Venomen has joined #ruby
Venomen has joined #ruby
Venomen has quit [Changing host]
<havenwood> Bish: yeah, no wonder it went undetected
<Bish> i am wondering none ever played with ** in pry
<Bish> i guess people write clean code :D
conta has quit [Quit: conta]
clemens3 has joined #ruby
caleBOT_ has joined #ruby
megamos has quit [Ping timeout: 256 seconds]
amar has quit [Remote host closed the connection]
amar has joined #ruby
caleBOT_ has quit [Ping timeout: 276 seconds]
conta has joined #ruby
amar has quit [Ping timeout: 248 seconds]
nowhereman_ has quit [Ping timeout: 256 seconds]
suukim has joined #ruby
Burgestrand has joined #ruby
vonfry has quit [Quit: WeeChat 2.1]
bjpenn has quit [Ping timeout: 276 seconds]
alem0lars has joined #ruby
mikecmpbll has joined #ruby
hurricanehrndz has quit [Quit: Goodbye]
hurricanehrndz has joined #ruby
herbmillerjr has quit [Quit: Konversation terminated!]
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
Tharbakim has joined #ruby
blackmesa1 has quit [Ping timeout: 245 seconds]
Burgestrand has quit [Quit: Closing time!]
desperek has joined #ruby
rshetty has joined #ruby
rshetty has quit [Read error: Connection reset by peer]
rshetty has joined #ruby
jnollette has joined #ruby
amar has joined #ruby
Crack has joined #ruby
nahra has quit [Remote host closed the connection]
nowhereman_ has joined #ruby
apeiros has joined #ruby
amar has quit [Ping timeout: 264 seconds]
amar has joined #ruby
Burgestrand has joined #ruby
conta has quit [Quit: conta]
amar has quit [Ping timeout: 265 seconds]
conta has joined #ruby
Mike11 has joined #ruby
za1b1tsu has joined #ruby
sylario has joined #ruby
TinkerT has quit [Quit: ZNC 1.8.x-nightly-20180616-bdbcaca0 - https://znc.in]
TinkerT has joined #ruby
Alina-malina has quit [Ping timeout: 256 seconds]
Puffball has quit [Read error: Connection reset by peer]
alex`` has quit [Quit: WeeChat 2.1]
Crack has left #ruby [#ruby]
amar has joined #ruby
rippa has joined #ruby
andikr has quit [Ping timeout: 256 seconds]
Beams has joined #ruby
andikr has joined #ruby
amar_ has joined #ruby
<apeiros> anybody aware of any yaml emitters which provide lower level control on the formatting? such as aligning values, using specific forms of string representations etc.?
amar has quit [Ping timeout: 256 seconds]
mynameisdebian has quit [Remote host closed the connection]
d^sh has quit [Ping timeout: 240 seconds]
d^sh has joined #ruby
Mike11 has quit [Quit: Leaving.]
beefjoe has joined #ruby
conta has quit [Quit: conta]
\void has quit [Quit: So long, and thanks for all the fish.]
alex`` has joined #ruby
konsolebox has quit [Ping timeout: 256 seconds]
tvw has joined #ruby
Tharbakim has quit [Ping timeout: 240 seconds]
bjpenn has joined #ruby
roamingdog has joined #ruby
bjpenn has quit [Ping timeout: 256 seconds]
starseed0000 has quit [Ping timeout: 245 seconds]
ellcs has joined #ruby
andikr has quit [Ping timeout: 256 seconds]
Tharbakim has joined #ruby
Tharbakim has quit [Changing host]
Tharbakim has joined #ruby
anisha has quit [Ping timeout: 245 seconds]
ellcs has quit [Ping timeout: 276 seconds]
ferr has quit [Quit: WeeChat 2.1]
ellcs has joined #ruby
ferr has joined #ruby
schneider has joined #ruby
anisha has joined #ruby
Puffball has joined #ruby
kryptoz has joined #ruby
vondruch has quit [Ping timeout: 245 seconds]
vondruch has joined #ruby
rshetty has quit [Remote host closed the connection]
_rshetty_ has joined #ruby
_rshetty_ has quit [Remote host closed the connection]
rikkipitt has joined #ruby
konsolebox has joined #ruby
_rshetty_ has joined #ruby
_rshetty_ has quit [Remote host closed the connection]
rshetty has joined #ruby
pauliesaint has quit [Ping timeout: 248 seconds]
rshetty has quit [Remote host closed the connection]
alem0lars has quit [Read error: Connection reset by peer]
alem0lars has joined #ruby
pauliesaint has joined #ruby
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
biberu has joined #ruby
beefjoe has quit [Remote host closed the connection]
naftilos76 has joined #ruby
dreamthese has quit [Remote host closed the connection]
dreamthese has joined #ruby
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
rshetty has joined #ruby
cschneid has joined #ruby
Alina-malina has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
cschneid has quit [Ping timeout: 276 seconds]
Dbugger has joined #ruby
bjpenn has joined #ruby
alem0lars has quit [Ping timeout: 256 seconds]
kryptoz has quit [Remote host closed the connection]
Burgestrand has quit [Quit: Closing time!]
kryptoz has joined #ruby
_sfiguser has joined #ruby
<_sfiguser> hello all i tried this https://github.com/argos83/ritm
<_sfiguser> but after having installed the certificate on firefox
<_sfiguser> it still does not work on https websites...
<canton7> what does "does not work" mean?
bjpenn has quit [Ping timeout: 264 seconds]
<_sfiguser> canton7, are you confident with https and certificates stuff ? i generated the certificate... so i have both .crt and key file
<_sfiguser> i imported in firefox...
<_sfiguser> under "view certificates" and in the tab "Authorities" i imported the crt
<_sfiguser> and if i activate the proxy and browse with firefox , for http i have no problems, for https i have the "add exception page"
<canton7> what's the actual problem you're having?
kryptoz has quit [Ping timeout: 240 seconds]
<_sfiguser> but for google or fcebook... i have an additional warning about hsts
<canton7> what does the additional warning say?
<_sfiguser> wait i'm pasting it to you
<_sfiguser> The owner of duckduckgo.com has configured their website improperly. To protect your information from being stolen, Firefox has not connected to this website.
<_sfiguser> This site uses HTTP Strict Transport Security (HSTS) to specify that Firefox may only connect to it securely. As a result, it is not possible to add an exception for this certificate.
<_sfiguser> duckduckgo.com uses an invalid security certificate. The certificate is not trusted because the issuer certificate is unknown. The server might not be sending the appropriate intermediate certificates. An additional root certificate may need to be imported. Error code: SEC_ERROR_UNKNOWN_ISSUER
rshetty has quit [Remote host closed the connection]
<_sfiguser> sorry if i pasted on channel my bad
drale2k_ has joined #ruby
<_sfiguser> anyay you can read it in the bpaste
<canton7> and you've definitely imported the right root cert into firefox?
rshetty has joined #ruby
<canton7> the right VA, rather
<canton7> *CA
<_sfiguser> canton7, i just have the crt i generated with: openssl pkcs12 -export -out certificate.pfx -inkey insecure_ca.key -in insecure_ca.crt
<_sfiguser> anyway when it was asking info, i just inserted random infos
<_sfiguser> like name
<_sfiguser> email
<_sfiguser> and country code and so on
<_sfiguser> in firefox, i imported the .crt
<canton7> what about `openssl req -new -nodes -x509 -days 365 -extensions v3_ca -keyout insecure_ca.key -out insecure_ca.crt`?
<_sfiguser> canton7, this is to generate the certificate
<canton7> (afk)
<_sfiguser> canton7, sorry i misitook to paste
<_sfiguser> the right common
<_sfiguser> the right command
<_sfiguser> i did this penssl req -new -nodes -x509 -days 365 -extensions v3_ca -keyout insecure_ca.key -out insecure_ca.crt
<_sfiguser> *openssl
rshetty has quit [Ping timeout: 260 seconds]
schneider has quit [Ping timeout: 256 seconds]
RougeT430 has joined #ruby
amar_ has quit [Ping timeout: 256 seconds]
andikr has joined #ruby
conta has joined #ruby
SebastianThorn has joined #ruby
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
rikkipitt has quit [Quit: Leaving...]
ellcs has quit [Remote host closed the connection]
hfp_work has quit [Quit: bye]
RougeT430 has quit [Ping timeout: 268 seconds]
schneider has joined #ruby
BloopMonster has quit [Ping timeout: 260 seconds]
hfp_work has joined #ruby
Burgestrand has joined #ruby
anisha has quit [Ping timeout: 260 seconds]
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
psychicist__ has joined #ruby
rshetty has joined #ruby
rshetty has quit [Remote host closed the connection]
anisha has joined #ruby
apeiros has quit [Remote host closed the connection]
apeiros has joined #ruby
rshetty has joined #ruby
Cork has quit [Ping timeout: 240 seconds]
fernando_basso_ has joined #ruby
jrafanie has joined #ruby
SebastianThorn2 has joined #ruby
SebastianThorn2 has quit [Client Quit]
SebastianThorn has quit [Read error: Connection reset by peer]
conta has quit [Quit: conta]
apparition has joined #ruby
vonfry has joined #ruby
_rshetty_ has joined #ruby
<fernando_basso_> https://repl.it/@FernandoBasso/ruby-blocks I need help understanding the @boxes.select(&:buyable?) part.
<fernando_basso_> How does select know buyable? comes from Box?
rshetty has quit [Ping timeout: 256 seconds]
<Burgestrand> fernando_basso_ It doesn't, it just assumes it does
<Burgestrand> fernando_basso_ it's equivalent to @boxes.select { |box| box.buyable? }
<fernando_basso_> I have read that the & syntax turns something into a block.
<fernando_basso_> So, &:buyable? turns the method buyable? into a block?
ldnunes has joined #ruby
<apeiros> in `foo(&bar)`, the & invokes to_proc on bar, and then passes that Proc as a block
<Burgestrand> fernando_basso_ ^
caleBOT has joined #ruby
<Burgestrand> fernando_basso_ so to continue that, it does :buyable?.to_proc
<apeiros> and :some_symbol.to_proc creates a slightly more sophisticated proc than proc { |receiver| receiver.__send__(:some_symbol) }
<Burgestrand> i.e. :buyable? is not a method, it's a symbol
<apeiros> hence `.select(&:buyable?)` becomes `select { |receiver| receiver.buyable? }`
* Burgestrand apeiros collaboration high five
<apeiros> yeah, not a method, "only" the name of the method
<apeiros> ^5 Burgestrand
<Burgestrand> :D
* apeiros forgot to /me, /me sad
* Bish hates the fact there is no shortcut for .select {|x| x[:a]}
* apeiros has a snippet for that
<Bish> snippet as in?
<Bish> overwriting to_proc of Array?
<apeiros> and else, baweaver has a lib
<Bish> apeiros: how does that look
<Bish> when used
caleBOT has quit [Ping timeout: 245 seconds]
<fernando_basso_> Burgestrand, apeiros, I think I got it, and notes taken. Thank you both. Much appreciated.
<Burgestrand> fernando_basso_ https://repl.it/repls/JaggedAgedCamel
<Bish> overwriting to_proc of array actually works fine
<Burgestrand> Yeah, I like it
<Bish> how much would the ruby community hate me for that?
<Bish> Burgestrand: you do that?
<apeiros> Bish: hm, can't find the snippet
<Burgestrand> Bish no, I don't think I've needed that syntax often enough
<Bish> i did
<Burgestrand> Bish for an app project I wouldn't blame you, but if you put it in a library that I use I will find you
<Burgestrand> (;p)
<apeiros> Bish: but yes, iirc it was `.select(&[:a])`
<Bish> class Array;def to_proc;return proc {|x| x[first] };end;end;
<apeiros> and it used Array#to_proc being something along: `__send__(:[], *self)`
naftilos76 has quit [Quit: Leaving]
<Burgestrand> hehe
<Bish> but this should be a ruby feature
<apeiros> I had a couple more, like Integer#to_proc doing .send(:[], self)
<apeiros> so .select(&1) works
<Bish> i mean without polluting some namespace
<apeiros> "without polluting" - contradictory, sorry.
<Bish> ? apeiros how so?
<apeiros> every added feature will pollute in one way or another
<Bish> how does ** pollute anything
<Bish> i mean it should be syntax(without breaking old code)
<fernando_basso_> Burgestrand: I'm scratching my head :D
<apeiros> either you bloat syntax to mean different things in different contexts (worse), or you exploit methods to mean things suiting specific tasks (still bad, but IMO less bad than syntax abuse)
<Bish> like the lonely operator, that thing certainly didnt kill code
<apeiros> ** increases syntax space. there's now two meanings for **, method or kwarg-splat-operator
<fernando_basso_> Burgestrand: Ah, got it. Nice!
<Burgestrand> fernando_basso_ :)
<Bish> i would even be fine with
<apeiros> it does not come for free.
<Bish> .map(&&:x) to get hash[:x]
<Bish> i will just define method ⇒ globally, that will make me popular among colleagues
blackmesa1 has joined #ruby
<Bish> .map(>>x<<)
suukim has quit [Quit: Konversation terminated!]
<Bish> lul
<Bish> apeiros: don't you like the lonely operator?
<Bish> it's a blessing to me
conta has joined #ruby
<apeiros> o0
blackmesa1 has quit [Ping timeout: 276 seconds]
<Bish> apeiros: hm? the loney operator &.?
<apeiros> oh, safe-navigator
<Bish> added in 2.3, i think
<Bish> "matz called it lonely operator in a talk, because it looks like a kneeing man looking at a dot"
<Bish> &.
<Bish> these japenese
<Bish> rather a sitting man
MagePsycho has joined #ruby
Cork has joined #ruby
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
banisterfiend has joined #ruby
banisterfiend has quit [Client Quit]
<Burgestrand> Yeah, that has to be a butt
<Burgestrand> &. no?
<Burgestrand> Bish hadn't thought of that before, now I can't unsee it
bak1an has joined #ruby
<Bish> Burgestrand: i laughed so hard when realizing
Zaab1t has joined #ruby
bjpenn has joined #ruby
bjpenn has quit [Ping timeout: 248 seconds]
blackmesa1 has joined #ruby
AJA4350 has joined #ruby
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
simmaniac has joined #ruby
za1b1tsu has quit [Ping timeout: 240 seconds]
sysvalve has quit [Ping timeout: 245 seconds]
nowhereman_ has quit [Ping timeout: 240 seconds]
graphene has quit [Read error: Connection reset by peer]
graphene has joined #ruby
roamingdog has quit [Remote host closed the connection]
roamingdog has joined #ruby
blackmesa1 has quit [Ping timeout: 260 seconds]
BloopMonster has joined #ruby
megamos has joined #ruby
vondruch has quit [Quit: vondruch]
vondruch has joined #ruby
megamosaren has joined #ruby
jrafanie has joined #ruby
ellcs has joined #ruby
mupt has joined #ruby
megamosaren has quit [Client Quit]
yokel has quit [Ping timeout: 248 seconds]
andikr has quit [Remote host closed the connection]
jrafanie has quit [Client Quit]
Puffball has quit [Quit: Puffball]
Venomen has quit [Quit: Leaving...]
cadillac_ has quit [Read error: Connection reset by peer]
bjpenn has joined #ruby
cadillac_ has joined #ruby
schneider has quit [Ping timeout: 245 seconds]
bjpenn has quit [Ping timeout: 248 seconds]
herbmillerjr has joined #ruby
yokel has joined #ruby
<MagePsycho> how to store value in key value pair in ruby and loop it later?
za1b1tsu has joined #ruby
<ellcs> hash = {}; hash[:a] =1
<ellcs> on the hash you can call any highorder method
<ellcs> :each, :reduce, :map
<ellcs> first argument of the highorder method is the key, the second the value
_rshetty_ has quit [Remote host closed the connection]
<elomatreb> Not exactly true, iterator blocks get yielded an array of two elements, it just gets destructured when you put two parameters on the block
za1b1tsu has quit [Ping timeout: 248 seconds]
_rshetty_ has joined #ruby
_rshetty_ has quit [Read error: Connection reset by peer]
<ellcs> aight, so in `{:a => 1}.each { |k, v| puts "#{k} #{v}"}` the two variables are actually elements of an array?
saTchymoto has joined #ruby
<ellcs> with two variables i do mean k and v
NingaLeaf has joined #ruby
rshetty has joined #ruby
<ellcs> so when using one variable i get the keyvalue pair as an array? `{:a => 1}.each { |kv| puts "#{kv}"}`
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
<ellcs> ran it in irb and it is a fact :)
vonfry has quit [Quit: WeeChat 2.1]
Mike11 has joined #ruby
rshetty has quit [Ping timeout: 260 seconds]
<elomatreb> You can use this anywhere btw, e.g. `a, b = [1, 2]` assigns 1 to a and 2 to b
herbmillerjr has quit [Quit: Konversation terminated!]
megamos has quit [Ping timeout: 256 seconds]
bjpenn has joined #ruby
BloopMonster has quit [Ping timeout: 256 seconds]
kryptoz has joined #ruby
caleBOT_ has joined #ruby
simmaniac is now known as sysvalve
kryptoz has quit [Remote host closed the connection]
kryptoz has joined #ruby
megamos has joined #ruby
bjpenn has quit [Ping timeout: 240 seconds]
ren0v0_ has quit [Remote host closed the connection]
bathtub_shark has quit [Quit: WeeChat 2.1]
kryptoz has quit [Ping timeout: 255 seconds]
Zarthus has quit [Ping timeout: 260 seconds]
megamos has quit [Ping timeout: 256 seconds]
<MagePsycho> how to check if path is a directory or file in ruby?
saTchymoto has quit []
<tbuehlmann> there are Pathname.new('/path/to/file').file? and Pathname.new('/path/to/file').directory?
<canton7> also File.file? and File.directory?
<canton7> (e.g. File.file?('/some/file'))
ellcs has quit [Ping timeout: 256 seconds]
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Zarthus has joined #ruby
taylorzr has joined #ruby
<MagePsycho> test("[ -f #{shared_path}/pub/sitemap.xml ]") ?
<elomatreb> Alternatively there is File.ftype
<lupine> definitely use something that doesn't depend on interpolation
Inline has joined #ruby
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
naftilos76_ has joined #ruby
aupadhye has quit [Remote host closed the connection]
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
<MagePsycho> I have a file.rake and how to test it quickly?
Azure has quit [Ping timeout: 245 seconds]
Azure has joined #ruby
p0s1x has joined #ruby
p0s1x has quit [Quit: Segmentation fault]
bathtub_shark has joined #ruby
mtkd has quit []
<canton7> MagePsycho, using one of the suggestions which tbuehlmann and I gave you?
<canton7> oh, you mean run the rakefile using rake?
bathtub_shark has quit [Client Quit]
bathtub_shark has joined #ruby
kryptoz has joined #ruby
megamos has joined #ruby
claudiuinberlin has joined #ruby
claudiuinberlin has quit [Client Quit]
<MagePsycho> canton7, Yes I have file.rake where I have defined some task, how to run it just to test
<canton7> MagePsycho, there's a parameter you can pass to rake to get it to load a particular file
claudiuinberlin has joined #ruby
mtkd has joined #ruby
za1b1tsu has joined #ruby
houhoulis has joined #ruby
<MagePsycho> set :app_symlinks, ["/media", "/var", "/sitemaps"] -> how to set as key value pair
<MagePsycho> et :app_symlinks, ["/media": "/images", "/var": "/tmp", "/sitemaps": "/seo"]
<MagePsycho> ?
<MagePsycho> I want that array [] to have key value pair
<canton7> MagePsycho, use a hash
RougeT430 has joined #ruby
<MagePsycho> I have to use that approach as per capistrano
raynold has quit [Quit: Connection closed for inactivity]
kryptoz has quit [Remote host closed the connection]
dionysus69 has quit [Ping timeout: 276 seconds]
kryptoz has joined #ruby
conta has quit [Quit: conta]
drale2k_ has joined #ruby
conta has joined #ruby
orbyt_ has joined #ruby
kryptoz has quit [Ping timeout: 245 seconds]
<canton7> MagePsycho, so you want to use a hash but you're not allowed to use a hash?
bjpenn has joined #ruby
Burgestrand has quit [Quit: Closing time!]
motstgo has quit [Ping timeout: 268 seconds]
orbyt_ has quit [Ping timeout: 240 seconds]
subroot has joined #ruby
<MagePsycho> set :mage2_custom_symlinks, {'pub/Tools' => '/var/www/Tools', 'pub/feed' => '/var/www/magento/feed', 'pub/maintenance' => '/var/www/magento/maintenance'}
<MagePsycho> not sure if this will work or not
<JJonah> The "or" method `:|` exists on TrueClass and FalseClass, but the short circuit `||` operator does not? Why this asymmetry? And is the `||` operator an exception to ruby's "everything is an object" metaphor? Is it instead just a baked in bit of global syntax? If not, what is it?
<eam> MagePsycho: { :key => [:array, :of, :values] ] perhaps?
<eam> if you're looking for your key to point to a list
<MagePsycho> {:key1 => :value1, :key2 => :value2}
<MagePsycho> do you have to add : in front?
blackmesa1 has joined #ruby
ciscam has quit [Ping timeout: 240 seconds]
ciscam has joined #ruby
Es0teric has joined #ruby
kapil___ has joined #ruby
<eam> no, I just did that as an example
<eam> you can use any literal or variable
NingaLeaf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ellcs has joined #ruby
yohji has quit [Remote host closed the connection]
suukim has joined #ruby
Es0teric has quit [Quit: Computer has gone to sleep.]
bradleyprice has quit [Remote host closed the connection]
feelx- has quit []
feelx has joined #ruby
amar has joined #ruby
blackmesa has joined #ruby
nowhereman_ has joined #ruby
aufi has quit [Remote host closed the connection]
NingaLeaf has joined #ruby
karapetyan has joined #ruby
blackmesa1 has quit [Ping timeout: 276 seconds]
amar has quit [Ping timeout: 240 seconds]
edwardly has quit [Ping timeout: 264 seconds]
kujira has joined #ruby
karapetyan has quit [Ping timeout: 245 seconds]
taylorzr has quit [Ping timeout: 256 seconds]
cschneid has joined #ruby
ellcs has quit [Ping timeout: 260 seconds]
mtkd has quit []
cschneid has quit [Ping timeout: 248 seconds]
edwardly has joined #ruby
edwardly has quit [Changing host]
edwardly has joined #ruby
megamos has quit [Ping timeout: 260 seconds]
mupt has quit [Ping timeout: 240 seconds]
troys has joined #ruby
alem0lars has joined #ruby
apeiros has quit [Read error: Connection reset by peer]
apeiros has joined #ruby
yohji has joined #ruby
Azure has quit [Ping timeout: 260 seconds]
subroot has quit [Read error: Connection reset by peer]
bradleyprice has joined #ruby
mtkd has joined #ruby
rshetty has joined #ruby
Azure has joined #ruby
BloopMonster has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
blackmesa has quit [Ping timeout: 256 seconds]
tff^ has joined #ruby
jrich523_ has joined #ruby
jrich523 has quit [Ping timeout: 264 seconds]
jrich523_ is now known as jrich523
tolerablyjake has joined #ruby
poranek has joined #ruby
andikr has joined #ruby
ren0v0 has joined #ruby
<MagePsycho> https://paste.ubuntu.com/p/8Qc8wXdhMC/ -> undefined local variable or method `m2_custom_linked_dirs'
apeiros has quit [Read error: Connection reset by peer]
mupt has joined #ruby
jcarl43 has joined #ruby
apparition has quit [Quit: Bye]
<canton7> MagePsycho, I'm not sure what the 'set' method does, but it doesn't define a new variable...
yohji has quit [Remote host closed the connection]
nowhereman_ has quit [Ping timeout: 256 seconds]
mtkd has quit []
mmattice has quit [Ping timeout: 245 seconds]
Kuukunen has quit [Quit: leaving]
jrich523_ has joined #ruby
karapetyan has joined #ruby
noobineer has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
sysvalve has quit [Quit: Leaving]
lxsameer has quit [Ping timeout: 240 seconds]
jrich523 has quit [Ping timeout: 260 seconds]
jrich523_ is now known as jrich523
mtkd has joined #ruby
karapetyan has quit [Ping timeout: 240 seconds]
graphene has quit [Remote host closed the connection]
drale2k_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
graphene has joined #ruby
mupt has quit [Ping timeout: 240 seconds]
andikr has quit [Remote host closed the connection]
bsamorim has joined #ruby
taylorzr has joined #ruby
tty has quit [Quit: tty]
apeiros has joined #ruby
<bsamorim> Hello! I'm using a lib that has a "foo(bar, &block)" method in one of its classes. If I subclass that class, and write as method to that subclass "def ext_foo(bar, &block);foo(bar, &block);end", it behaves perfectly
bradleyprice has quit [Ping timeout: 240 seconds]
<bsamorim> But, if I do "def ext_foo(bar, &block);foo(bar) do block.call end;end", the scope in which "block" gets executed is completely messed up
<bsamorim> What's happening? How can I extend block and forward it too "foo" so that it behaves the same as if it was passed untouched?
clemens3 has quit [Remote host closed the connection]
<cthulchu> Actually, rubocop does good. adds some strictness to the language
<cthulchu> the language that prematurely lacks discipline
<cthulchu> Clean you room, Ruby!
<cthulchu> *your
Beams has quit [Quit: .]
lxsameer has joined #ruby
<elomatreb> bsamorim: The scope in which a block is executed is lexical to where the block is located, from where you do block.call does not change it
_sfiguser has quit [Remote host closed the connection]
<elomatreb> You can change the receiver object (self) through things like instance_eval, but it's kind of a bad idea because it's not apparent at the call site
mikecmpbll has quit [Ping timeout: 245 seconds]
caleBOT_ has quit [Remote host closed the connection]
herbmillerjr has joined #ruby
caleBOT has joined #ruby
<bsamorim> elomatreb: if the place where I put in "block.call" is irrelevant, how is the behaviour from both definitions of "ext_foo" different?
Kuukunen has joined #ruby
megamos has joined #ruby
<elomatreb> You're probably making some assumption about scope somewhere. If you could show actual code instead of a reduced example it's usually much easier to help
amar has joined #ruby
<bsamorim> that's pretty much it, as far as my extensions go
<bsamorim> Would the code for "foo" help?
caleBOT has quit [Ping timeout: 260 seconds]
nowhereman_ has joined #ruby
<elomatreb> My gut feeling would be the code inside the actual block
Kuukunen has quit [Quit: leaving]
amar has quit [Ping timeout: 240 seconds]
Kuukunen has joined #ruby
InfinityFye has joined #ruby
megamos has quit [Ping timeout: 256 seconds]
lxsameer has quit [Ping timeout: 256 seconds]
TomyWork has quit [Remote host closed the connection]
lxsameer has joined #ruby
<apeiros> bsamorim: `foo(bar) do block.call end;end` does not pass on arguments yielded to the block as `foo(bar, &block)` does
<apeiros> but why do you change it from &block anyway?
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<bsamorim> apeiros: I wanted to run some operations before the block is executed
mupt has joined #ruby
<bsamorim> I mean, the block isn't executed when "foo" is called - it is registered as a class method for one of the lib's classes
<bsamorim> I wanted that dynamically created method to include these operations that I want to perform
<apeiros> ok. so it's either the arguments thing, or we need a better description than "it is completely messed up".
<bsamorim> I'll look into it and get back to you.
tolerablyjake has joined #ruby
<bsamorim> It can't be the arguments thing, though, because that's not the issue with the block call
<bsamorim> Basically, the class has a method that's found normally when I do "foo(bar, &block)", but now when the block is passed the other way
<bsamorim> I get a "MethodNotFound" exception
tolerablyjake has quit [Client Quit]
caleBOT has joined #ruby
lxsameer has quit [Ping timeout: 256 seconds]
<apeiros> you'll have to provide an actual reproducible example.
<apeiros> with the parts you've given, it doesn't add up.
<elomatreb> Try inserting `p self` to see where your methods are going, if there's confusion about that
alem0lars has quit [Remote host closed the connection]
<bsamorim> apeiros: sure, no problem..do you guys have a pastebin for the channel?
<apeiros> ?gist
<ruby[bot]> https://gist.github.com - Multiple files, syntax highlighting, even automatically with matching filenames, can be edited
mupt has quit [Ping timeout: 260 seconds]
<apeiros> I wish they dropped the login requirement again, though.
drale2k_ has joined #ruby
<elomatreb> Oh you can't create anonymous gists anymore?
<elomatreb> that sucks
<apeiros> indeed.
mtkd has quit []
<apeiros> makes me want to remove the pastebin grumbler from ruboto.
<elomatreb> Might be worth considering to recommend another service in that case, requiring people to have a github account does seem inappropriate
<apeiros> I see that similarly. feel free to make a good suggestion.
<elomatreb> I would if I could :/
quobo has joined #ruby
<bsamorim> there it is
<bsamorim> It's a sinatra app, so I included the "config.ru" also
<bsamorim> but I think it's irrelevant for the discussion, though
alem0lars has joined #ruby
<bsamorim> The project, I think, is in a instance scope/class scope conflict
<apeiros> yeah, that block probably gets instance evaled
<elomatreb> And the request in print_request is what's being messed up?
<apeiros> so instead of block.call, you probably need instance_eval(&block) instead.
<bsamorim> elomatreb: I get a "undefined local variable or method `print_request' for FooController:Class" exception
<apeiros> that's the one thing I dislike about blocks. you can't tell from the outside in what context they'll be eval'ed
Mike111 has joined #ruby
Mike111 has quit [Client Quit]
<elomatreb> In that case it gets class_evald apparently
mtkd has joined #ruby
<elomatreb> What happens if you change `def print_request` to `def self.print_request`?
<apeiros> ah, right. might be class_eval instead of instance_eval too.
<bsamorim> elomatreb: it'd work in that particular example, but I actually want to use instance variables in those helper functions :(
Mike11 has quit [Ping timeout: 276 seconds]
<elomatreb> This feels more like a strange behavior from Sinatra, I can't really help with that, sorry
<bsamorim> so, should I do "get(route) do instance_eval(&block) end" ?
lxsameer has joined #ruby
<bsamorim> yep, worked like a charm! thanks, man! I've never used instance_eval, though. How hacky is it?
<elomatreb> It changes the self in the block
<elomatreb> So all the methods you call end up being called on the object you want, instead of the the lexical default from the blocks location
herbmillerjr has quit [Quit: Konversation terminated!]
<elomatreb> Which makes building things like DSLs convenient, but you also can't see that it's happening just from looking at the block itself, so it can be very confusing if you e.g. get NoMethodErrors for methods that you defined just above (similar to the confusion you got)
claudiuinberlin has joined #ruby
<bsamorim> elomatreb: ok, thanks a lot for the explanation!
tvw has quit [Remote host closed the connection]
mynameisdebian has joined #ruby
rshetty has quit [Remote host closed the connection]
rshetty has joined #ruby
mynameisdebian has quit [Remote host closed the connection]
rshetty has quit [Ping timeout: 248 seconds]
ellcs has joined #ruby
taylorzr has quit [Ping timeout: 256 seconds]
tolerablyjake has joined #ruby
<bsamorim> Man, Ruby certainly has its share of magic
<bsamorim> It's just one surprise after the other
mupt has joined #ruby
blackmesa has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AJA4350 has quit [Quit: AJA4350]
mupt has quit [Ping timeout: 240 seconds]
lxsameer has quit [Ping timeout: 276 seconds]
mynameisdebian has joined #ruby
shinnya has quit [Ping timeout: 265 seconds]
MagePsycho_ has joined #ruby
lxsameer has joined #ruby
ByronJohnson has quit [Remote host closed the connection]
alex`` has quit [Ping timeout: 256 seconds]
mynameis_ has joined #ruby
hanmac has quit [Ping timeout: 276 seconds]
mynameisdebian has quit [Ping timeout: 276 seconds]
starseed0000 has joined #ruby
tolerablyjake has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Dimik has joined #ruby
poranek has quit [Quit: Leaving.]
ellcs has quit [Ping timeout: 240 seconds]
herbmillerjr has joined #ruby
BTRE has quit [Ping timeout: 260 seconds]
hanmac has joined #ruby
BTRE has joined #ruby
karapetyan has joined #ruby
blackmesa has quit [Ping timeout: 255 seconds]
claudiuinberlin has joined #ruby
conta has quit [Quit: conta]
karapetyan has quit [Ping timeout: 265 seconds]
tff^ has quit []
caleBOT has quit [Remote host closed the connection]
caleBOT has joined #ruby
bairyn has joined #ruby
taylorzr has joined #ruby
bairyn has quit [Remote host closed the connection]
caleBOT has quit [Ping timeout: 260 seconds]
regedit has joined #ruby
jamesaxl has joined #ruby
suukim has quit [Quit: Konversation terminated!]
drale2k_ has quit [Ping timeout: 248 seconds]
mmattice has joined #ruby
taylorzr has quit [Ping timeout: 256 seconds]
pauliesaint has quit [Ping timeout: 256 seconds]
nowhereman_ has quit [Ping timeout: 248 seconds]
hfp_work has quit [Quit: bye]
noobineer has quit [Ping timeout: 240 seconds]
Fr4n has joined #ruby
lxsameer has quit [Ping timeout: 260 seconds]
lxsameer has joined #ruby
Paul91 has joined #ruby
Puffball has joined #ruby
mupt has joined #ruby
\void has joined #ruby
ellcs has joined #ruby
lxsameer has quit [Ping timeout: 268 seconds]
caleBOT_ has joined #ruby
lxsameer has joined #ruby
amar has joined #ruby
NingaLeaf has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mtkd has quit []
mupt has quit [Ping timeout: 240 seconds]
mtkd has joined #ruby
amar has quit [Ping timeout: 265 seconds]
lxsameer has quit [Ping timeout: 264 seconds]
alex`` has joined #ruby
taylorzr has joined #ruby
claudiuinberlin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
claudiuinberlin has joined #ruby
noobineer has joined #ruby
caleBOT_ has quit [Read error: Connection reset by peer]
caleBOT has joined #ruby
zachk has joined #ruby
zachk has joined #ruby
zachk has quit [Changing host]
megamos has joined #ruby
caleBOT has quit [Ping timeout: 268 seconds]
dkmueller has joined #ruby
anisha has quit [Quit: This computer has gone to sleep]
blackmesa has joined #ruby
megamos has quit [Ping timeout: 240 seconds]
naftilos76_ has quit [Quit: Leaving]
bjpenn has quit [Ping timeout: 248 seconds]
ellcs has quit [Ping timeout: 265 seconds]
willthechill has joined #ruby
Paul91 has left #ruby [#ruby]
<willthechill> hello all, I am trying to debug somebody else's Ruby code, we have a subroutine named `execmd()` which is called by `safesystemin()` and friends in order to execute some system commands, unfortunately one of the system commands is hanging and I can not figure out how to un-hide the STDOUT & STDERR in execmd() so as to see what is actually happening and where the hang occurs
bsamorim has quit [Ping timeout: 256 seconds]
caleBOT_ has joined #ruby
ellcs has joined #ruby
<willthechill> the main software in question is the `fpm` tool used to create RPM and DEB files, I have made my own fork, here is the execmd() subroutine: https://github.com/wbraswell/fpm/blob/master/lib/fpm/util.rb#L103
<willthechill> here is where execmd() is called from safesystemin(): https://github.com/wbraswell/fpm/blob/master/lib/fpm/util.rb#L246
<willthechill> and here is the line where it is actually hanging, and I never see any of the STDOUT or STDERR: https://github.com/wbraswell/fpm/blob/master/lib/fpm/util.rb#L252
<MagePsycho_> how to strip last directory from path in ruby?
<willthechill> I tried to use a pipe with tee as well as I/O redirection, they both executed but neither one actually created an output file! :-( https://github.com/wbraswell/fpm/blob/master/lib/fpm/util.rb#L244-L245
<willthechill> I just need to see what is actually happening with the running system commands, thanks so much for any help!!!
<MagePsycho_> ‘/var/www/app/abc’ -> how to strip /abc and return ‘/var/www/app’ ??
karapetyan has joined #ruby
<zenspider> MagePsycho: look at the File class
karapetyan has quit [Ping timeout: 276 seconds]
<willthechill> okay partial success via random hacking... if I replace this line "if block_given?" with "if false" then it shows me output! https://github.com/wbraswell/fpm/blob/master/lib/fpm/util.rb#L165
psychicist__ has quit [Quit: Lost terminal]
blackmesa has quit [Ping timeout: 256 seconds]
<willthechill> watching output fly by now, waiting to see if it hangs, OR maybe the hanging was somehow a result of the way it was handling I/O
<willthechill> and it does NOT hang now!
<willthechill> so somehow the execmd() I/O handling is responsible for the system commands hanging, bizarre!
<zenspider> "hanging" might just be buffering
cagomez has joined #ruby
<willthechill> zenspider: I thought the same thing, but it shouldn't buffer on one system command for 12+ minutes when that system command should take only a few seconds to run
<willthechill> thus, I must classify it as hanging or frozen
Zaab1t has joined #ruby
kapil___ has quit [Quit: Connection closed for inactivity]
<willthechill> although YES, I suspect attempted buffering or some other I/O magic is the culprit
<zenspider> does the cmd normally run and exit in under a few seconds? Even if it isn't attached to a TTY? some programs act differently depending on whether they detect they're interactive or not
graphene has quit [Remote host closed the connection]
<zenspider> act -> behave
caleBOT_ has quit [Ping timeout: 260 seconds]
<willthechill> yes it is actually a call to gcc which is hanging
<zenspider> gcc will totally hang out and do "nothing" if it thinks it is being piped its IO.
<willthechill> more details here: https://github.com/jordansissel/fpm/issues/1519
graphene has joined #ruby
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
<willthechill> well this is an automated build tool which calls gcc all day long as part of numerous build & configuration processes, so it should definitely NOT be hanging like this
daemonwrangler has joined #ruby
daemonwrangler has quit [Remote host closed the connection]
<zenspider> that "interactive" part in the title seems like a hint?
daemonwrangler has joined #ruby
<willthechill> I'm the one who wrote that title, and the "interactive" part has already been solved
<willthechill> scroll to the bottom of the github issue to see the gcc/as command which is hanging
<willthechill> gcc & ac are definitely NOT interactive
<willthechill> *as
hph^ has joined #ruby
<willthechill> as proven by the fact that they run just fine when I disable the I/O handling in execmd()
<MagePsycho_> Pathname worked like a charm
taylorzr has quit [Ping timeout: 245 seconds]
<MagePsycho_> anyone using capistrano for deployment here?
<zenspider> MagePsycho: Pathname is overkill for what you were asking. Like I said above... look at File
houhoulis has quit [Remote host closed the connection]
<zenspider> willthechill: yeah. that cmd looks kosher to me. Once I reformatted it to multiline...
<willthechill> well the strange thing is it all works fine as soon as I disable the I/O handling
starseed0000 has quit [Ping timeout: 265 seconds]
<zenspider> willthechill: yeah. that would be my suggestion is to exec w/ < /dev/null
Mike11 has joined #ruby
<zenspider> how odd
megamos has joined #ruby
<willthechill> zenspider: you mean I should append "< /dev/null" to the end of each system command (gcc, as, etc) to be executed by execmd()?
<zenspider> oh. I wonder if ... how crazy has cpp/m4 gotten? maybe it is doing something w/ subprocesses... I'm blindly guessing tho.
<zenspider> I don't know execmd, so I don't know what is appropriate for you. But it sounds like you already did it with "disable the I/O handling"
fernando_basso_ has quit [Ping timeout: 252 seconds]
<willthechill> well I was just blindly hacking, I replaced "if block_given?" with "if false" and it disabled I/O stuff, now it shows me all output and does NOT hang on gcc/as https://github.com/wbraswell/fpm/blob/master/lib/fpm/util.rb#L165
<willthechill> AFAICT, execmd() was written from scratch as part of the fpm tool
<zenspider> it's probably just a stupid wrapper for exec or spawn... *shrug*
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
daemonwrangler has joined #ruby
<zenspider> spawn is crazy powerful (too much, imo)... you should be able to do all the redirection stuff you want
<willthechill> well there appears to be a class (?) called ChildProcess, an object of which is created named "process" and then "process.start" is called
sameerynho has joined #ruby
megamos has quit [Ping timeout: 256 seconds]
starseed0000 has joined #ruby
nowhereman_ has joined #ruby
shinnya has joined #ruby
<zenspider> seems like overkill to me... but whatevs
<willthechill> ah okay I see, so there is an external library named "childprocess", well I am not the maintainer of fpm so I will not try to change things like that on my own :-P
amar has joined #ruby
claudiuinberlin has quit [Quit: Textual IRC Client: www.textualapp.com]
zautomata has joined #ruby
bsamorim has joined #ruby
amar has quit [Ping timeout: 240 seconds]
mattp__ has quit [Read error: Connection reset by peer]
mattp__ has joined #ruby
bak1an has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
mupt has joined #ruby
ricer2 has quit [Remote host closed the connection]
megamos has joined #ruby
mupt has quit [Ping timeout: 240 seconds]
dkmueller has quit [Quit: Konversation terminated!]
<willthechill> new, second bug report: https://github.com/jordansissel/fpm/issues/1522
mynameis_ has quit [Ping timeout: 260 seconds]
sameerynho has quit [Ping timeout: 240 seconds]
Dbugger has quit [Quit: Leaving]
zleap has joined #ruby
regedit has quit [Quit: Connection closed for inactivity]
stairmast0r has quit [Quit: bye]
ldnunes has quit [Quit: Leaving]
megamos has quit [Ping timeout: 240 seconds]
schleppel has quit [Quit: Konversation terminated!]
stairmast0r has joined #ruby
daemonwrangler has quit [Quit: ZNC 1.6.5 - http://znc.in]
daemonwrangler has joined #ruby
reber has quit [Remote host closed the connection]
mynameisdebian has joined #ruby
MagePsycho_ has quit [Quit: MagePsycho_]
megamos has joined #ruby
jottr has joined #ruby
agent_white has joined #ruby
alem0lars has quit [Ping timeout: 260 seconds]
zlogan2003 has joined #ruby
DTZUZO has quit [Quit: WeeChat 2.0]
megamos has quit [Ping timeout: 256 seconds]
graphene has quit [Remote host closed the connection]
graphene has joined #ruby
DTZUZO has joined #ruby
bsamorim has quit [Ping timeout: 240 seconds]
dgaff has joined #ruby
nowhereman_ has quit [Ping timeout: 256 seconds]
nowhere_man has joined #ruby
jrafanie has joined #ruby
Zaab1t has quit [Quit: Zaab1t]
FernandoBasso has joined #ruby
mupt has joined #ruby
cyberg has joined #ruby
mupt has quit [Ping timeout: 265 seconds]
graphene has quit [Remote host closed the connection]
karapetyan has joined #ruby
graphene has joined #ruby
blackmesa has joined #ruby
karapetyan has quit [Ping timeout: 265 seconds]
InfinityFye has left #ruby ["Leaving"]
zapata has quit [Read error: Connection reset by peer]
jrafanie has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
houhoulis has joined #ruby
zapata has joined #ruby
Mike11 has quit [Quit: Leaving.]
ellcs has quit [Ping timeout: 276 seconds]
r29v has joined #ruby
zleap has quit [Quit: WeeChat 2.1]
RealUnix28200 has joined #ruby
FernandoBasso has quit [Ping timeout: 240 seconds]
mtkd has quit []
FernandoBasso has joined #ruby
pauliesaint has joined #ruby
ellcs has joined #ruby
dgaff has quit [Quit: Lost terminal]
BloopMonster has quit [Ping timeout: 265 seconds]
biberu has quit []
pauliesaint has quit [Read error: Connection reset by peer]
desperek has quit [Quit: xoxo]
tty has joined #ruby
akaiiro has joined #ruby
za1b1tsu has quit [Quit: WeeChat 2.1]
alex`` has quit [Ping timeout: 260 seconds]
quobo has quit [Quit: Connection closed for inactivity]
jottr has quit [Ping timeout: 264 seconds]
mynameisdebian has quit [Remote host closed the connection]
konsolebox has quit [Quit: .]
blackmesa has quit [Ping timeout: 260 seconds]
ellcs has quit [Ping timeout: 276 seconds]
taylorzr has joined #ruby
lunarkitty7 has quit [Ping timeout: 256 seconds]
blackmesa has joined #ruby
bak1an has joined #ruby
ellcs has joined #ruby
bsamorim has joined #ruby
taylorzr has quit [Ping timeout: 245 seconds]
taylorzr has joined #ruby
Sembei has joined #ruby
d^sh has quit [Ping timeout: 248 seconds]
caleBOT has joined #ruby
d^sh has joined #ruby
Francisco has joined #ruby
Jushy has joined #ruby
blackmesa has quit [Ping timeout: 256 seconds]
Fr4n has quit [Read error: Connection reset by peer]
jottr has joined #ruby
rippa has quit [Quit: {#`%${%&`+'${`%&NO CARRIER]
caleBOT has quit [Ping timeout: 240 seconds]
lunarkitty7 has joined #ruby
jinie has quit [Ping timeout: 264 seconds]
jinie has joined #ruby
jottr has quit [Ping timeout: 268 seconds]
bonhoeffer has joined #ruby
<bonhoeffer> how do i convert "ab".bytesize to something like "\xD5\x88" which i see as the ruby byte notation
nightw0lf has joined #ruby
jamesaxl has quit [Quit: WeeChat 2.1]
Sembei has quit [Ping timeout: 268 seconds]
kobain has joined #ruby
NightMonkey has quit [Ping timeout: 264 seconds]
r29v has quit [Quit: r29v]
hfp_work has joined #ruby
bairyn has joined #ruby
jcarl43 has quit [Quit: WeeChat 2.1]
hfp_work has quit [Quit: bye]