<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]
<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]
<_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
<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…]
<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?
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.
<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
<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.
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>
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
<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