<matthewd>
def foo(&b); b ||= lambda { true }; ..; end
<matthewd>
^ I think that's what you want
dcunit3d has quit [Ping timeout: 260 seconds]
robouk has quit [Quit: Konversation terminated!]
<arahael>
matthewd: Close - turns out there's something funky with the {}'s. (I think it's just syntatic sugar?) Anyway, I've got it going with: def foo(b = lambda {true})
<matthewd>
Depends how you want to call it when you do pass a block
<arahael>
matthewd: If I do provide the block, I've specified the argument, surely?
Rodya_ has quit [Ping timeout: 246 seconds]
robouk has joined #ruby
<Radar>
arahael: some Real Code™ might be helpful here... something around an actual rather than theoretical problem. We might come up with a different solution altogether.
robouk has quit [Ping timeout: 255 seconds]
ecuanaso has joined #ruby
<arahael>
Radar: I wrote to a logfile (using log4r), and have launched another application; I want to read those log entries written to by that application.
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
xathereal has joined #ruby
<arahael>
Radar: I'd use it's stdout, if I had access to it. :(
robouk has joined #ruby
Ropeney has joined #ruby
<arahael>
Radar: I'm not sure you *want* the Real CodeTM (involving ShellExecute). ;)
<xathereal>
Heya :D Could someone point me to the documentation for the functions on files are? i.e. The docs on the return type of `File.open(filename)`? Thank you in advance!
<arahael>
Hmm, seems that is_done = lambda {true} does not mean that is_done is a block
amclain has quit [Quit: Leaving]
xathereal has quit [Ping timeout: 260 seconds]
gusrub has joined #ruby
gusrub has quit [Remote host closed the connection]
rundor has quit [Remote host closed the connection]
tacoboy has quit [Remote host closed the connection]
jameser has joined #ruby
ElFerna has quit [Ping timeout: 255 seconds]
cdg has quit [Remote host closed the connection]
bronson has joined #ruby
<arahael>
In ruby on windows, how do I capture *all* stdout?
<arahael>
Even those from sub processes.
smulverine has joined #ruby
jameser_ has quit [Ping timeout: 248 seconds]
ElFerna has joined #ruby
bronson has quit [Ping timeout: 240 seconds]
__Yiota has joined #ruby
charliesome has joined #ruby
charliesome has quit [Client Quit]
mim1k has joined #ruby
ecuanaso has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<arahael>
I need the output from a system(cmd) call, if I use Peopen, I need to provide an array as imput which worries me (as that will change the arguments)
mim1k has quit [Ping timeout: 248 seconds]
<arahael>
Oh, popen does allow just a string, neat.
dcunit3d has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
hutch34_ has joined #ruby
__Yiota has joined #ruby
hutch34_ has quit [Ping timeout: 246 seconds]
emers2n has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
TvL2386_ has joined #ruby
__Yiota has joined #ruby
TvL2386 has quit [Ping timeout: 255 seconds]
petto has joined #ruby
<arahael>
How do I ensure that IO.popen results in the process's stderr and stdout to be readable?
<arahael>
They don't seem to be redirected.
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<arahael>
The docs say that they can be read using the io object that's returned, but the io docs don't seem tod istinguish between regular read, and reading error streams.
<arahael>
It's only input, and output.
phinxy has quit [Quit: Leaving]
jenrzzz has joined #ruby
ElFerna has quit [Ping timeout: 260 seconds]
<arahael>
Ah, documented in Kernel#spawn
__DonaldTrump__ has quit [Ping timeout: 260 seconds]
<arahael>
But it's not correctly getting the output.
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
milardovich has quit [Remote host closed the connection]
theunraveler has joined #ruby
theunraveler has quit [Client Quit]
milardovich has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
pwned has joined #ruby
dcunit3d has quit [Ping timeout: 260 seconds]
dcunit3d has joined #ruby
duderonomy has joined #ruby
gix has quit [Ping timeout: 255 seconds]
<arahael>
Hmm, not a ruby issue, as it turns out - the command I'm running seems to have it's own, entirely distinct, idea of stdout and stderr.
gix has joined #ruby
Ropeney has joined #ruby
ecuanaso has joined #ruby
minimalism has quit [Quit: minimalism]
rundor has joined #ruby
minimalism has joined #ruby
bronson has joined #ruby
jackjackdripper has joined #ruby
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
Moosashi has joined #ruby
Ropeney has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
Moosashi has quit [Client Quit]
bronson has quit [Ping timeout: 248 seconds]
Ropeney has joined #ruby
mim1k has joined #ruby
enterprisey has quit [Remote host closed the connection]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
rundor has quit [Remote host closed the connection]
mim1k has quit [Ping timeout: 268 seconds]
TinkerTyper has quit [Ping timeout: 240 seconds]
bambanx has joined #ruby
minimalism has quit [Ping timeout: 255 seconds]
milardovich has quit [Remote host closed the connection]
gulp-gulp has joined #ruby
<gulp-gulp>
.
<baweaver>
gulp-gulp: .: not enough arguments
renchan has joined #ruby
Rodya_ has joined #ruby
TinkerTyper has joined #ruby
milardovich has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
gothicsouth has joined #ruby
Ropeney has quit [Read error: Connection reset by peer]
uZiel has joined #ruby
sarbs has quit [Ping timeout: 255 seconds]
renchan_ has joined #ruby
jackjackdripper has quit [Read error: Connection reset by peer]
jackjackdripper has joined #ruby
renchan__ has joined #ruby
renchan__ has quit [Read error: Connection reset by peer]
renchan__ has joined #ruby
renchan has quit [Ping timeout: 255 seconds]
cherry-pick-2 has quit [Ping timeout: 240 seconds]
renchan_ has quit [Ping timeout: 255 seconds]
renchan has joined #ruby
cherry-pick-2 has joined #ruby
renchan__ has quit [Ping timeout: 268 seconds]
rundor has joined #ruby
milardovich has quit []
kies has joined #ruby
djbkd has joined #ruby
growp has joined #ruby
growp has left #ruby [#ruby]
mjolnird has quit [Ping timeout: 246 seconds]
<arahael>
I want to change the console output color fairly explicitly, but the 'ansi' gem seems out of date.
growp has joined #ruby
growp has left #ruby [#ruby]
<arahael>
Is the 'ansi' gem still the best gem?
<matthewd>
arahael: I don't know anything about it, but what makes you think it's out of date?
<arahael>
matthewd: Whenever I use it, it tells me to 'gem install win32console', though it still works regardless, despite that somewhat irritating message.
<arahael>
win32console, incidentially, is obsolete, as I understand it.
uZiel has quit [Ping timeout: 248 seconds]
bambanx has quit [Quit: Leaving]
rundor has quit [Remote host closed the connection]
<Radar>
It helps indicate that the code is inside of a block.
hutch34_ has joined #ruby
<kaizoku>
hmm, right, I'm used to writing C or python, where if there are so many levels of indentation, it indicates an issue with my program structure
minimalism has joined #ruby
<cam27>
anyone know if doing brew upgrade in two seperate sessions will create duplicate files? cuase that’s what’s up right now...
<elomatreb>
kaizoku: That many nested blocks like that probably are a codesmell, but in this specific circumstance there's probably little you can do about it
<matthewd>
kaizoku: Deeply nested conditionals would still likely be worth closer investigation.. but ruby uses blocks for other things too (though there's still a point where you probably want to introduce a new method, say)
<elomatreb>
Often you can extract stuff into methods, to avoid the indentation
<kaizoku>
right matthewd , usually with C or python I end up adding more methods to alleviate excessive indentation, but in this case the blocks are so small that doesn't really make sense
<elomatreb>
Another thing are module/class definitions, if you follow some styleguides that recommend not using the compact module/class style you can easily end up with a mess of indentation
<kaizoku>
but I have to add custom headers to my requests in this case, so i need to use HTTP.start and Net::HTTP::Get objects
anisha has joined #ruby
<kaizoku>
hmm, okay. thanks all
<elomatreb>
You could have a write_file(response) method for example, to handle the open ... block
<Radar>
kaizoku: You might want to look at using another gem for that, in particular rest-client and typhoeus are my two favourites
<kaizoku>
Ah, thanks Radar
jameser has quit [Ping timeout: 240 seconds]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
enterprisey has quit [Remote host closed the connection]
jameser_ has joined #ruby
dcunit3d has quit [Ping timeout: 248 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
SuperL4g has joined #ruby
Administrator has joined #ruby
Administrator is now known as Guest25955
SuperLag has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Guest25955 is now known as gulp-gulp
Rodya_ has joined #ruby
dcunit3d has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
dcunit3d has quit [Client Quit]
claw has quit [Ping timeout: 255 seconds]
KeyJoo has joined #ruby
nowhere_man has quit [Ping timeout: 255 seconds]
claw has joined #ruby
kculpis has quit [Quit: Leaving]
djbkd has quit []
gulp-gulp has quit [Read error: Connection reset by peer]
gulp-gulp has joined #ruby
sarmiena_ has quit [Quit: sarmiena_]
ramfjord has joined #ruby
rahult has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
digitalnomad has joined #ruby
BTRE has quit [Quit: Leaving]
charliesome has joined #ruby
anisha has quit [Read error: Connection reset by peer]
anisha has joined #ruby
high_fiver has joined #ruby
bronson has joined #ruby
TomyWork has joined #ruby
rahult has joined #ruby
bronson has quit [Ping timeout: 260 seconds]
charliesome has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
rahult has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
sysvalve has joined #ruby
simmaniac has joined #ruby
SeepingN has quit [Quit: The system is going down for reboot NOW!]
ramfjord has quit [Ping timeout: 240 seconds]
hahuang61 has joined #ruby
sysvalve has quit [Ping timeout: 255 seconds]
hahuang65 has quit [Ping timeout: 260 seconds]
<arahael>
Where's rubyforge?
<arahael>
Trying to find the docs for log4r. :(
<matthewd>
The great big bit bucket in the sky
<arahael>
matthewd: The empty one?
<matthewd>
Yup
<arahael>
There must be a lot of broken links, then. :(
<matthewd>
Also yes
<arahael>
Ok, I'm going to keep looking at the code then - somehow, my logs are being written to the file *twice*.
<arahael>
(And I have only the one logger)
<arahael>
Two outputters, but only one outputter thta goes to the actual log file (the other outputter goes to the console)
andikr has quit [Remote host closed the connection]
guardianxx has quit []
Rodya_ has joined #ruby
loveablelobster has joined #ruby
emers2n has quit [Ping timeout: 260 seconds]
netglider has joined #ruby
loveablelobster has quit [Client Quit]
mark_66 has joined #ruby
yogg-saron has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
Silthias1 has joined #ruby
<arahael>
Hmm... So pry is broken in msysgit.
Silthias has quit [Ping timeout: 260 seconds]
aclark has quit [Quit: Ping timeout (120 seconds)]
gulp-gulp has quit [Read error: Connection reset by peer]
gulp-gulp has joined #ruby
sunya7a_ has quit [Ping timeout: 240 seconds]
BTRE has joined #ruby
dminuoso has joined #ruby
<arahael>
How do I single-step using pry?
<arahael>
(Seems to work much better in cmd.exe, but even so)
<arahael>
I mean, if I type "step", I Just get a NameError
jenrzzz has quit [Ping timeout: 260 seconds]
<zenspider>
arahael: pry doesn't single-step. it isn't a debugger.
<zenspider>
there are pry addons that do some things like that tho
<arahael>
That'll teach me to trust stackoverflow. What's a good debugger for ruby?
<zenspider>
you can use pry to figure out what you need... you just need the plugins
<zenspider>
there's a straight up debugger that ships with ruby that works fine too... not all the bells and whistles that pry has
<zenspider>
`ruby -rdebug -e 0`
<zenspider>
hah. it warns that you're using callcc... that's funny
<zenspider>
(and sad)
<arahael>
And apparently is "rubish" and "unmaintained" (according to stackoverflow)
<zenspider>
fuck stackoverflow
charliesome has joined #ruby
<arahael>
Indeed, but ruby isn't my best language, yet I must struggle to determine why my logger is logging twice.
aclark has joined #ruby
<zenspider>
might have 2 of them. might be calling it twice. should be pretty easy to figure out which is which
antgel has joined #ruby
<arahael>
Thought it'd be easy: STick a breakpoint in, and observe it getting hit.
<arahael>
As best as I can tell, Pry's merely telling me that it's indeed hitting it many times.
<zenspider>
def logger.some_logging_method_you_use(*args); p :bang! => args; super; end
<zenspider>
sorry... after bang... add `p caller.first(5)`
<zenspider>
that way you can see where from
<zenspider>
then aggregate and look at the different entrypoints
<arahael>
Entry points are identical. :/
<zenspider>
that's fine. identical but multiple.
<arahael>
I suspect pry itself is getting in the way, though - the stack backtrace otherwise looks identical.
<zenspider>
so you need to figure out if there are multiple or not.
<arahael>
Well, the log file has double the lines.
<arahael>
(Each line is doubled)
<zenspider>
good
<zenspider>
class File; alias oldwrite write; def write(*args); p :bang! => args; p caller.first 5; oldwrite(*args); end
<zenspider>
or something...
<zenspider>
it might not be write. go look at the logger to see
andikr has joined #ruby
<arahael>
So far I've determined that log4r/outputter/outputter.rb:111 is being hit many, many times.
ltem has joined #ruby
ahrs has quit [Remote host closed the connection]
mim1k has joined #ruby
ahrs has joined #ruby
bronson has joined #ruby
<arahael>
Well, that was stupid - found the issue, but used ordinary printf-style debugging.
mikecmpbll has joined #ruby
<dminuoso>
arahael: pry-byebug
<arahael>
dminuoso: Where do you hear about that?
<dminuoso>
arahael: I use it every day.
<arahael>
dminuoso: That's great, but in the spirit of teaching a man to fish... How do I fish for this info? :)
bronson has quit [Ping timeout: 248 seconds]
Silthias has joined #ruby
<dminuoso>
arahael: You just asked for single-stepping using pry, just thought I'd toss the obvious approach into the bowl.
<dminuoso>
It's basically byebug rigged into pry.
Silthias1 has quit [Ping timeout: 276 seconds]
<arahael>
dminuoso: Well, here's my thinking process. "My logging system is stuffed." - "google 'how do I debug in ruby'" --> stackoverflow --> -rdebug is rubbish --> pry --> irc --> pry is apparently not a debugger.
<arahael>
dminuoso: I'm not a ruby developer. (C++, sure. Python? Sure. Swift? Sure. C#? Sure... Delphi? Sure... But Ruby is weird to me.
roshanavand has joined #ruby
<dminuoso>
arahael: `byebug` is the popular debugger in the Ruby world. pry is just a better irb.
charliesome has quit [Read error: Connection reset by peer]
<dminuoso>
Often you can debug issues with `pry` if all you just want to examine the environment and try out methods or inspect objects interactively. So I guess you could view it as a tool suitable for `some debugging`
<arahael>
I guess what I'm trying to say is, "How should I be learning ruby?"
<arahael>
I don't really want to beg on #ruby for every little issue.
<arahael>
So it's like C++ in that sense, in that books are the best way to discover it?
someuser has joined #ruby
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<dminuoso>
arahael: I found most Ruby books to be very lacking when compared to the quality C++ books.
<arahael>
That's my worry - I'm worried that if I get a book, it'll just try to teach me some bits of the standard library and the syntax.
<arahael>
The syntax is the _easy_ bit. :(
<arahael>
I do have the O'reilly book "Ruby Best Practices", but the only thing that it mentions about debuggers is that they aren't needed.
<dminuoso>
arahael: The two top book recommendations in here are `The Well Grounded Rubyist` and `Eloquent Ruby`, the latter of which being the advancd book focusing mostly on idiomatic ruby style
<dminuoso>
Though both dont really cover debugging...
<arahael>
Yeah, again - "idiomatic" is a syntx thing.
<dminuoso>
But then again, I don't remember reading any books about valgrind, lldb or gdb either...
<dminuoso>
arahael: No it's more. It's about patterns.
<arahael>
Right, and patterns, sure.
<arahael>
I'm trying to get insight into it's _ecosystem_.
quaristice has joined #ruby
<dminuoso>
arahael: Normally ruby-toolbox is the best resource to get in touch with that, but they got hit by a meteor.
<arahael>
I think int he past I saw rubyforge, but I'm irritated with the broken links to it I have today. :(
hutch34_ has joined #ruby
antgel has quit [Ping timeout: 268 seconds]
jaruga has joined #ruby
cam27 has quit [Quit: cam27]
Rodya_ has joined #ruby
<arahael>
Anyway, thanks for your patience - I'm a difficult dev. (The sort who writes something, and then expects it to continue working as-is and with new changes _years_ later)
<zenspider>
that said... pry + thinking can solve most bugs. if you want a quick and dirty debugger. `-rdebug` works fine. if you need more sophistication? ... you're gonna have to study the ecosystem and choose one that works for you
<arahael>
zenspider: That looks like a fairly simple minilanguage. Have you tried Haskell?
<zenspider>
thus far my experiments with haskell have been unsuccessful and unrewarding so I haven't had much reason to continue further
<zenspider>
I am not a fan of typing. I prefer scheme
petto has joined #ruby
<arahael>
That's fine, my point is that the _syntax_ - the mere syntax - is generally teh simplest big.
<arahael>
*simplest bit.
<zenspider>
sure... if you're coming from the ML family, it really is. compare ML/Haskell/Scheme to ruby's grammar and you'll soon learn there is a very wide spectrum of grammar complexity
<arahael>
You seem to have a bigger issue with the typing system, which isn't a syntax issue.
<arahael>
Well, yes.
<arahael>
But consider this, do you consider yourself an expert rubist?
<zenspider>
yes
<arahael>
Assuming you say yes... Would you be able to swap to a different implementation of ruby - with the same syntax (say, macruby), and agree that it's an identical language?
yeticry has quit [Quit: leaving]
<zenspider>
no, because none of them are. :)
lxsameer has joined #ruby
<arahael>
zenspider: Right - there are difficulties that lie beyond the mere sytnax!
<zenspider>
arahael: you fail to make your point time and again and just seem to want to say "Mere syntax" for fun. I don't see the point you're trying to make. Diversions to haskell and whatever don't seem to have any relevance. sooooo... I'm done here.
<zenspider>
I'm glad you got your logger bug fixed up. Even without a proper debugger.
<arahael>
zenspider: I trued to use the difference between cruby and macruby as an example.
<arahael>
But I'm tired, and there's a chance we're talking at cross purposes anyway - if you're heading off, heave a great night. :)
<arahael>
*ave
<arahael>
*have.
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
pandaant has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
aupadhye has joined #ruby
gulp-gulp has quit [Quit: Leaving]
bigkevmcd has quit [Quit: Outta here...]
aupadhye has quit [Ping timeout: 240 seconds]
uZiel has quit [Ping timeout: 248 seconds]
bronson has joined #ruby
tvw has joined #ruby
bronson has quit [Ping timeout: 258 seconds]
aupadhye has joined #ruby
brent__ has joined #ruby
brent__ has quit [Ping timeout: 260 seconds]
mtkd has quit [Ping timeout: 260 seconds]
alex`` has quit [Quit: WeeChat 1.9]
mtkd has joined #ruby
stoffus_ has joined #ruby
umaaji has quit [Quit: Leaving...]
ferr has joined #ruby
stoffus has quit [Ping timeout: 260 seconds]
Rodya_ has joined #ruby
ur5us_ has joined #ruby
ur5us has quit [Read error: No route to host]
bigkevmcd has joined #ruby
ur5us has joined #ruby
Rodya_ has quit [Ping timeout: 246 seconds]
my123 has quit [Read error: Connection reset by peer]
my123 has joined #ruby
my123 has joined #ruby
ur5us_ has quit [Ping timeout: 246 seconds]
bkxd has joined #ruby
bkxd_ has joined #ruby
anuxivm has joined #ruby
anuxivm has left #ruby [#ruby]
ayonkhan has joined #ruby
<zenspider>
Finished in 0.029733s, 9215.3500 runs/s, 16849.9647 assertions/s.
<zenspider>
damn I love that
<darix>
moin zenspider. more releases incoming?
<zenspider>
none planned. I just fired off ruby_parser and minitest
<zenspider>
but... I'm trying to improve backtrace filtering w/ custom assertions in minitest to be more useful
<zenspider>
need to isolate a good example first so I can make a test from it
renchan_ has joined #ruby
renchan has quit [Read error: Connection reset by peer]
rahult has joined #ruby
workmad3 has joined #ruby
nowhere_man has joined #ruby
rahult has quit [Ping timeout: 260 seconds]
ur5us_ has joined #ruby
ur5us_ has quit [Remote host closed the connection]
<zenspider>
I'm trying to improve the backtrace filter when you have an error AND a custom assertion... it needs to not just stop at the assertion and instead go back to the test body involved.
<zenspider>
I might need more/better tests around errors in teardown... I have one but I'm not sure I agree with it
<zenspider>
also I prefer the dynamic class versions of the tests but they're so much harder to write / maintain
<zenspider>
so just filtering backtraces can be nice
rgtk has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
bigkevmcd has joined #ruby
jameser_ has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
im0nde has joined #ruby
stoffus has joined #ruby
uZiel has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Ping timeout: 260 seconds]
ramadoka has joined #ruby
mim1k has quit [Ping timeout: 258 seconds]
<ramadoka>
hi guys, is it a bad idea to create a class for each endpoint on your API?
rgtk has quit [Ping timeout: 248 seconds]
<ramadoka>
like for example /user/register is handled by UserRegister.new(request: self).run!
mim1k has joined #ruby
<arahael>
Not if they're unique and distinct - ie, you can't easily share the implementaiton.
<ramadoka>
not a bad idea?
<arahael>
Well, not sure of the idiomatic ruby appraoch, but I'd probably use a function/method for each endpoint, not a whole class.
<ramadoka>
yeah, most implementation seems to prefer a function approach.
ur5us has joined #ruby
<arahael>
You could even have an EndPoint class that's used for all the methods. (With different instnatiations for each one)
Mark-6ma has joined #ruby
bronson has joined #ruby
romankapitonov has joined #ruby
someuser_ has joined #ruby
uZiel has quit [Ping timeout: 248 seconds]
im0nde has quit [Quit: im0nde]
bronson has quit [Ping timeout: 276 seconds]
someuser has quit [Ping timeout: 260 seconds]
ramadoka has quit [Read error: No route to host]
ur5us has quit [Read error: Connection reset by peer]
frmendes has quit [Ping timeout: 246 seconds]
ur5us has joined #ruby
uZiel has joined #ruby
mesamoo has quit [Excess Flood]
nfsnobody has quit [Ping timeout: 255 seconds]
mesamoo has joined #ruby
frmendes has joined #ruby
ramadoka has joined #ruby
anisha_ has joined #ruby
nowhere_man has quit [Read error: Connection reset by peer]
nowhereman has joined #ruby
nfsnobody has joined #ruby
anisha has quit [Ping timeout: 255 seconds]
cadillac_ has quit [Read error: Connection reset by peer]
cadillac_ has joined #ruby
milardovich has joined #ruby
<dminuoso>
arahael: This outside the scope of idiomatic Ruby.
bkxd has joined #ruby
<dminuoso>
arahael: Web development is domain specific, as such the question of idiomacy depends on the framework you are employing.
<dminuoso>
Or what pattern you are using.
bkxd_ has joined #ruby
someuser_ is now known as someuser
mim1k has quit [Disconnected by services]
mim1k_ has joined #ruby
__Yiota has joined #ruby
shiranuidong has joined #ruby
shiranuidong has quit [Max SendQ exceeded]
shiranuidong has joined #ruby
troulouliou_dev has joined #ruby
pandaant has quit [Remote host closed the connection]
jameser has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
ramadoka has quit [Quit: leaving]
troulouliou_dev has joined #ruby
ldnunes has joined #ruby
bronson has joined #ruby
synthroid has joined #ruby
hutch34_ has joined #ruby
bronson has quit [Ping timeout: 255 seconds]
brent__ has joined #ruby
hutch34_ has quit [Ping timeout: 255 seconds]
mim1k_ has quit [Ping timeout: 240 seconds]
synthroi_ has joined #ruby
kith has quit [Quit: kith]
brent__ has quit [Ping timeout: 260 seconds]
ElFerna has joined #ruby
__Yiota has joined #ruby
synthroid has quit [Ping timeout: 240 seconds]
netglider has quit [Quit: Konversation terminated!]
bkxd__ has joined #ruby
netglider has joined #ruby
bkxd___ has joined #ruby
netglider has quit [Client Quit]
__Yiota has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
GodFather has joined #ruby
Mark-6ma has quit [Quit: My Mac has gone to sleep. ZZZzzz…]
netglider has joined #ruby
bkxd_ has quit [Ping timeout: 246 seconds]
bkxd has quit [Ping timeout: 246 seconds]
pandaant has joined #ruby
netglider has quit [Client Quit]
ledestin has joined #ruby
flyhigh has joined #ruby
apparition has quit [Quit: Bye]
aupadhye has quit [Ping timeout: 240 seconds]
milardovich has quit []
apparition has joined #ruby
stoffus_ has joined #ruby
anisha_ has quit [Ping timeout: 255 seconds]
mark_66 has quit [Remote host closed the connection]
mark_66 has joined #ruby
troulouliou_dev has quit [Remote host closed the connection]
uZiel has quit [Ping timeout: 248 seconds]
stoffus has quit [Ping timeout: 240 seconds]
flyhigh has quit [Quit: Konversation terminated!]
flyhigh has joined #ruby
sepp2k has joined #ruby
flyhigh has quit [Client Quit]
flyhigh has joined #ruby
flyhigh has quit [Client Quit]
flyhigh has joined #ruby
cagomez has joined #ruby
anisha has joined #ruby
flyhigh has quit [Client Quit]
monument has joined #ruby
flyhigh has joined #ruby
rgtk has joined #ruby
flyhigh has quit [Client Quit]
FastJack has quit [Read error: Connection reset by peer]
hogetaro has joined #ruby
flyhigh has joined #ruby
cagomez has quit [Ping timeout: 260 seconds]
FastJack has joined #ruby
flyhigh has quit [Client Quit]
cgfbee has quit [Ping timeout: 240 seconds]
flyhigh has joined #ruby
postmodern has quit [Quit: Leaving]
dviola has joined #ruby
flyhigh has quit [Client Quit]
jenrzzz has joined #ruby
anisha has quit [Ping timeout: 240 seconds]
high_fiver has quit [Ping timeout: 240 seconds]
oleo has joined #ruby
tacoboy has joined #ruby
ElFerna has quit [Ping timeout: 260 seconds]
anisha has joined #ruby
jenrzzz has quit [Ping timeout: 255 seconds]
uZiel has joined #ruby
mim1k has joined #ruby
uZiel has quit [Remote host closed the connection]
pandaant has quit [Remote host closed the connection]
sekmo has joined #ruby
ur5us has quit [Remote host closed the connection]
sekmo has quit [Client Quit]
bronson has joined #ruby
frmendes is now known as fribmendes
bkxd has joined #ruby
fribmendes is now known as frm
frm is now known as fribmendes
bkxd__ has quit [Ping timeout: 248 seconds]
ayonkhan has quit [Ping timeout: 248 seconds]
bkxd___ has quit [Ping timeout: 268 seconds]
bronson has quit [Ping timeout: 268 seconds]
ayonkhan_ has joined #ruby
InfinityFye has joined #ruby
bkxd_ has joined #ruby
fribmendes has quit [Quit: leaving]
frmendes has joined #ruby
<mikecmpbll>
this is probably going to be a dumb question, but what's the possible range of Digest::SHA1 hashes?
<pabs>
mikecmpbll: that's the output size, not the amout of data that can be hashed
<mikecmpbll>
pabs : ya i know
<pabs>
mikecmpbll: then i guess i don't understand your question, what do you mean by range?
<mikecmpbll>
i mean, the range of possible values
jphase has joined #ruby
<Papierkorb>
mikecmpbll: Without using the whole range, its effective range would be smaller, hence, its range wouldn't be 20 Bytes.
<mikecmpbll>
some hashes range into negative
<Papierkorb>
For most hashes, not really. Hashes have no sign - Or none that I know of. You can interpret the highest bit as sign bit, but that's representation, but not the correct data interpretation.
apparition47 has joined #ruby
<pabs>
the "output range" if you want to call it that, is 0 to 2^20 - 1
<Papierkorb>
2^(8*20) *
<pabs>
yeah, than kyou
stoffus_ has quit [Quit: leaving]
<pabs>
0 to 2^160 - 1
alexday has joined #ruby
psychicist__ has quit [Ping timeout: 255 seconds]
anisha has quit [Quit: Leaving]
anisha has joined #ruby
frmendes has quit [Quit: leaving]
frmendes has joined #ruby
rahult has joined #ruby
frmendes has quit [Client Quit]
frmendes has joined #ruby
roshanavand has quit [Quit: roshanavand]
<alexday>
is it possible to create a blank Net::HTTPResponse.new object. what I am trying is, I have this http_req = Net::Http::Get.new(url), http_req.start do |h| h.request(req) end; but if there is a trouble connecting I want to rescue the exception, so that application doesn't exit. but in doing that the other code that uses it will do a response.code == "403", so I was thinking if I can create a response object with
<alexday>
no code
ledestin has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
<alexday>
is that approach ok
<dminuoso>
alexday: ?xy
<dminuoso>
?xy alexday
<ruby[bot]>
alexday: it seems like you are asking for a specific solution to a problem, instead of asking about your problem. This often leads to bad solutions and increases frustration for you and those trying to help you. More: http://meta.stackexchange.com/a/66378
<dminuoso>
alexday: Don't rescue in a spot when you cant completely handle the error.
<alexday>
the problem is what do I do when I get a connection timeout exception
rgtk has quit [Ping timeout: 255 seconds]
<dminuoso>
alexday: catching an exception means being able to recover. returning a fake object is essentially ying.
<dminuoso>
let the exception propagate and catch it at some higher layer
rahult has quit [Ping timeout: 240 seconds]
<alexday>
ok, and after catching it returning a 500 was, what I was thinking
t-recx has joined #ruby
yqt has joined #ruby
<alexday>
like return Net::HTTPResponse.new('1.1', '500', 'Connection Error')
<dminuoso>
alexday: No that would be another lie.
uZiel has joined #ruby
<dminuoso>
alexday: 500 implies internal server error.
<dminuoso>
alexday: just let the exception propagate.
<alexday>
but after catching the exception, for the api to work I have to return something, right?
ElFerna has joined #ruby
Mon_Ouie has quit [Ping timeout: 240 seconds]
<dminuoso>
alexday: That depends on whether you can recover sensibly or not. If not, just let the exception propagate further.
<alexday>
ok
milardovich has joined #ruby
vee_ has joined #ruby
DLSteve has joined #ruby
nacsurte has joined #ruby
__Yiota has joined #ruby
Rodya_ has joined #ruby
enodata has joined #ruby
high_fiver has joined #ruby
milardovich has quit []
nacsurte has quit [Ping timeout: 240 seconds]
guidos has left #ruby [#ruby]
nowhereman has quit [Ping timeout: 240 seconds]
chouhoulis has quit [Remote host closed the connection]
<mikecmpbll>
phone call, but thanks pabs & Papierkorb ;) that's what I was after.
bkxd__ has joined #ruby
bkxd___ has joined #ruby
bkxd has quit [Ping timeout: 240 seconds]
bkxd_ has quit [Ping timeout: 246 seconds]
rundor has joined #ruby
ElFerna has quit [Ping timeout: 258 seconds]
Emmanuel_Chanel has quit [Ping timeout: 248 seconds]
KeyJoo has quit [Ping timeout: 246 seconds]
rundor has quit [Ping timeout: 260 seconds]
smulverine has quit [Remote host closed the connection]
<dbugger>
I am trying to install json 1.8.3, but I get this error output when i do (https://hastebin.com/kemiqutaju.sql). Does anyone know what is it that I could be missing?
anisha has quit [Ping timeout: 240 seconds]
bruno- has joined #ruby
bruno- is now known as Guest79907
Mark-6ma has joined #ruby
bkxd___ has quit [Read error: Connection reset by peer]
bkxd__ has quit [Ping timeout: 240 seconds]
troulouliou_dev has joined #ruby
<dminuoso>
dbugger: Ruby 2.4 has received some internal changes with the unification of Fixnum and Bignum under Integer. That JSON gem version is not compatible with the newer Ruby.
<dminuoso>
dbugger: Note that Ruby comes with json out of the box, you should not need to install this in the first place.
<dbugger>
dminuoso, oh ok... thanks
sleepee has quit [Ping timeout: 240 seconds]
marr has quit [Ping timeout: 240 seconds]
<dbugger>
another question then... when I try to use "rbenv local "2.3.4", I get this: "/home/dbugger/.rbenv/libexec/rbenv-version-file-write: line 19: .ruby-version: Permission denied"
<dbugger>
What is going on here?? I dont have permissions now??
dionysus69 has joined #ruby
<__RonaldMcDonald>
dbugger: you don't have permission to write to the current working directory in order to create a .ruby-version file.
<dbugger>
__RonaldMcDonald, yeah, but how could that happen...? Or more important, how can I fix it?
<__RonaldMcDonald>
don't know. try `pwd` to see what current working directory is.
troulouliou_dev has quit [Remote host closed the connection]
<dbugger>
pwd? Doesnt that show me the current directory where I am located now?
<__RonaldMcDonald>
if you're somewhere like /etc or /root then there's nothing to fix. change directory. otherwise, check permissions.
<dbugger>
I am in my project's directory
<__RonaldMcDonald>
yes.
<__RonaldMcDonald>
but rbenv cannot write to that directory.
<dbugger>
I am in "/home/dbugger/projects/myproject"
Lockpick has joined #ruby
<dbugger>
but what are the right permissions then?
<__RonaldMcDonald>
can you do `touch .ruby-version` from the same shell?
<dbugger>
let me try
Lockpick has quit [Quit: Leaving]
<dbugger>
__RonaldMcDonald, I did a chmod 777 (I know... a little brute) and now I can touch .ruby-version
eljimmy has quit [Quit: Leaving]
<__RonaldMcDonald>
ok, then that's the issue, and yes 777 is prob not what you want.
<dbugger>
hehehe, thanks mate!
bkxd has joined #ruby
<__RonaldMcDonald>
np
chouhoulis has joined #ruby
brent__ has joined #ruby
brent__ has quit [Remote host closed the connection]
bkxd_ has joined #ruby
Jalinaee has joined #ruby
Jalinaee has quit [Client Quit]
bkxd__ has joined #ruby
bkxd has quit [Ping timeout: 260 seconds]
renchan_ has quit [Quit: Leaving...]
olivi____ has joined #ruby
chouhoulis has quit [Remote host closed the connection]
chouhoulis has joined #ruby
high_fiver has quit [Remote host closed the connection]
high_fiver has joined #ruby
rgtk has joined #ruby
high_fiver has quit [Max SendQ exceeded]
high_fiver has joined #ruby
ElFerna has quit [Ping timeout: 240 seconds]
gizmore|2 is now known as gizmore
bronson has joined #ruby
SuperL4g is now known as SuperLag
high_fiver has quit [Max SendQ exceeded]
high_fiver has joined #ruby
bronson has quit [Ping timeout: 268 seconds]
polishdub has joined #ruby
haylon has joined #ruby
mark_66 has quit [Remote host closed the connection]
nankyokusei has joined #ruby
high_fiver has quit [Max SendQ exceeded]
high_fiver has joined #ruby
high_fiver has quit [Read error: Connection reset by peer]
high_fiver has joined #ruby
nankyokusei has quit [Ping timeout: 240 seconds]
high_fiver has quit [Read error: Connection reset by peer]
Guest79907 has quit [Ping timeout: 246 seconds]
aufi has quit [Remote host closed the connection]
high_fiver has joined #ruby
nankyokusei has joined #ruby
TomyWork has quit [Remote host closed the connection]
D9 has quit [Quit: Quit]
high_fiver has quit [Read error: Connection reset by peer]
high_fiver has joined #ruby
imtar has joined #ruby
troulouliou_dev has joined #ruby
olivi____ has quit [Remote host closed the connection]
oliv_____ has joined #ruby
enterprisey has joined #ruby
bkxd has joined #ruby
high_fiver has quit [Max SendQ exceeded]
brent__ has joined #ruby
high_fiver has joined #ruby
imtar has quit [Remote host closed the connection]
imtar has joined #ruby
bkxd__ has quit [Ping timeout: 260 seconds]
oliv_____ has quit [Ping timeout: 246 seconds]
brent__ has quit [Remote host closed the connection]
brent__ has joined #ruby
torQue_ has joined #ruby
bkxd_ has quit [Ping timeout: 248 seconds]
bkxd_ has joined #ruby
bruno- has joined #ruby
high_fiver has quit [Max SendQ exceeded]
andikr has quit [Remote host closed the connection]
high_fiver has joined #ruby
kobain has joined #ruby
high_fiver has quit [Remote host closed the connection]
jenrzzz has joined #ruby
bruno- has quit [Ping timeout: 260 seconds]
cagomez has joined #ruby
ar1a_ has joined #ruby
cam27 has joined #ruby
ar1a has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 268 seconds]
Mark-6ma has quit [Quit: -]
bkxd_ has quit [Ping timeout: 255 seconds]
bkxd has quit [Ping timeout: 240 seconds]
rgtk has quit [Ping timeout: 255 seconds]
TomyLobo2 has joined #ruby
bruno- has joined #ruby
AnoHito has quit [Ping timeout: 255 seconds]
imtar has quit [Quit: WeeChat 1.9]
imtar has joined #ruby
imtar has quit [Client Quit]
imtar has joined #ruby
dionysus69 has quit [Ping timeout: 276 seconds]
anisha_ has quit [Read error: Connection reset by peer]
alan_w has quit [Quit: WeeChat 1.4]
anisha_ has joined #ruby
knight33 has joined #ruby
imtar has quit [Client Quit]
imtar has joined #ruby
dionysus69 has joined #ruby
Serpent7776 has quit [Quit: Leaving]
cdg has joined #ruby
digitalnomad has joined #ruby
runescape07rsps has quit [Quit: Leaving]
blackwind_123 has joined #ruby
cdg_ has joined #ruby
amclain has joined #ruby
cdg has quit [Ping timeout: 260 seconds]
charliesome has joined #ruby
bronson has joined #ruby
psychicist__ has joined #ruby
mikecmpbll has quit [Ping timeout: 240 seconds]
banisterfiend has quit [Quit: My MacBook Pro has gone to sleep. ZZZzzz…]
charliesome has quit [Client Quit]
bronson has quit [Ping timeout: 260 seconds]
AX31_A13X has quit [Ping timeout: 268 seconds]
ElFerna has joined #ruby
gusrub has joined #ruby
duderonomy has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
anisha_ has quit [Quit: This computer has gone to sleep]
torQue_ has quit [Quit: ChatZilla 0.9.93 [Firefox 54.0.1/20170628075643]]
tvw has quit [Ping timeout: 258 seconds]
troulouliou_dev has quit [Remote host closed the connection]
rdsome has joined #ruby
bigkevmcd has quit [Quit: Outta here...]
psychicist__ has quit [Read error: Connection reset by peer]
olivi____ has joined #ruby
psychicist__ has joined #ruby
npgm has joined #ruby
nacsurte has joined #ruby
simmaniac has quit [Quit: Leaving]
mikecmpbll has joined #ruby
herbmillerjr has quit [Quit: Konversation terminated!]
rgtk has joined #ruby
psychicist__ has quit [Read error: Connection reset by peer]
olivi____ has quit [Ping timeout: 255 seconds]
mikecmpbll has quit [Ping timeout: 240 seconds]
jenrzzz has joined #ruby
jenrzzz has joined #ruby
jenrzzz has quit [Changing host]
Beams has quit [Quit: .]
rundor has joined #ruby
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
jenrzzz has quit [Ping timeout: 240 seconds]
jackjackdripper has joined #ruby
ColeHub has joined #ruby
psychicist__ has joined #ruby
jameser has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
t-recx has quit [Quit: t-recx]
mim1k has quit [Ping timeout: 240 seconds]
rundor has quit [Remote host closed the connection]
t-recx has joined #ruby
kies has quit [Ping timeout: 240 seconds]
nankyokusei has quit [Remote host closed the connection]
<Norm>
I love Grape for writing REST APIs, but am looking to write a server that handles requests coming in over WebSocket instead of HTTP
<Norm>
Anyone know if Grape can be adapted to accept requests from something other than HTTP?
<Norm>
Or is there a good framework for RPC-over-WebSocket? I haven’t found one
ramfjord has joined #ruby
ozcanesen has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
AxelAlex has quit [Ping timeout: 260 seconds]
Rodya_ has quit [Remote host closed the connection]
sarmiena_ has quit [Quit: sarmiena_]
milardovich has joined #ruby
lxsameer has joined #ruby
antgel has joined #ruby
t-recx has quit [Quit: t-recx]
xuanrui has quit [Ping timeout: 268 seconds]
mtkd has quit [Ping timeout: 240 seconds]
eckhardt has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
postmodern has joined #ruby
digitalnomad has quit [Quit: My MacBook has gone to sleep. ZZZzzz…]
gothicsouth has quit [Quit: My iMac has gone to sleep. ZZZzzz…]
digitalnomad has joined #ruby
growp has joined #ruby
<growp>
how do you load files from a path
mtkd has joined #ruby
compost_ has quit [Ping timeout: 260 seconds]
jenrzzz has quit [Ping timeout: 260 seconds]
dviola has quit [Quit: WeeChat 1.9]
ElFerna has joined #ruby
joast has quit [Ping timeout: 246 seconds]
roshanavand has quit [Ping timeout: 240 seconds]
gheegh has joined #ruby
enodata has joined #ruby
<gheegh>
Anyone familiar with concurrent-ruby? I used a Promise to do some parallel URL retrieval.. and it seems that it just does them 1 after the other, not saving any time.. i'm trying to retrieve in parallel. Should I switch to a threadpool, or have I done something wrong?
antgel has quit [Ping timeout: 255 seconds]
rdsome has quit [Read error: Connection reset by peer]
milardovich has quit [Ping timeout: 240 seconds]
TomyLobo2 has quit [Ping timeout: 255 seconds]
ElFerna has quit [Quit: WeeChat 1.9]
<havenwood>
gheegh: Which Ruby engine are you using, CRuby?
<gheegh>
havenwood: yes, cruby
milardovich has joined #ruby
<havenwood>
gheegh: CRuby threads currently acquire the Global VM Lock (GVL, also called GIL) for a bunch of stuff. So they often don't run in parallel for stuff like computation. They do run in parallel with IO or other stuff that doesn't get GVLed.
ResidentBiscuit has quit [Read error: Connection reset by peer]
<gheegh>
yea, this is maily to handle IO stuff
<gheegh>
mainly*
<havenwood>
gheegh: I'd suggest using an HTTP gem that has a solid parallelism strategy, like Typhoeus.
<gheegh>
so in theory they should retrieve in parallel.. but it doesn't seem to be doing that.. it seems to be running them serially...
<gheegh>
yeah, we use Typhoeus other places, but his is a gem that we're trying to wrap its calls to speed up its performance