#ruby - 28 March 2018
« Back 1 day Forward 1 day »
[00:36:39] eam: zenspider: I use -c a lot for stuff like mssh -r %all:us-west 'md5 /etc/passwd' -c # bucket hosts by which ones have an identical passwd file
[00:37:30] eam: the bucketed ranges can then be fed back into mssh when drilling down across machines looking for differences
[04:45:41] b100s: Hey! What could be the reason of the next error in my simple sinatra app? https://gist.github.com/b10s/c3c5351854f866376461610d1d49463d
[05:07:03] b100s: havenwood, is there something what I could use instead puma ? something interchangable
[05:08:41] b100s: havenwood, taking in mind that I didn't mention puma in my snippet, how could I start use Unicorn ? : )
[05:09:18] havenwood: b100s: Remove `puma` from your Gemfile, if it's there, and add `unicorn` then `bundle`.
[05:14:37] b100s: Sinatra (v2.0.1) has taken the stage on 4567 for development with backup from Puma== Sinatra (v2.0.1)
[05:15:09] b100s: after cahnge 'puma' to 'unicorn' in Gemfile, remove Gemfile.lock and run `bundle` ^ ^
[08:09:19] kke: hmm. bundler fails to fetch gems due to timeout, the url it displays downloads just fine on the same machine using browser. anyone else having problems with it?
[08:09:57] kke: Retrying download gem from https://rubygems.org/ due to error (2/4): Gem::RemoteFetcher::UnknownHostError timed out (https://rubygems.org/gems/byebug-10.0.1.gem)
[08:12:43] MarcWeber: Do you have code which runs external command without timeout guard and returns exit code/ stdout as string?
[08:17:42] havenwood: MarcWeber: I thought you said stdout and exit status? Say more about what you're wanting to do?
[08:18:24] havenwood: MarcWeber: There are more options available with Open3: https://docs.ruby-lang.org/en/2.5.0/Open3.html
[08:19:47] MarcWeber: I know - but I don't want to spend 30min on writing trivial perfect code just to get some lines thniking about pipe cache sizes and all the stuff.
[08:20:54] havenwood: MarcWeber: Happy to help, but you'll have to say what you're trying to do. Do backticks suffice?
[11:02:32] marahin: I might be at a wrong place, but; with rspec's `double` is there a way to mimic hash method, so accessing values by key?
[11:04:08] phaul: something along the lines of allor to receive : with :test and return 1 should work
[11:07:26] marahin: phaul yes, so that's what I thought with trying to mock the `.` method. Thank you, I'll try that out
[13:29:48] tabakhase: uhm, i want to overwrite a single file inside a gem that i use with bundler - is there any easy way todo that other than a) forking and publish as own(gitref) or b) "just editing the gem and hoping noone runs "bundle update"?
[13:30:05] tabakhase: like, throwing it into some seperate overwrite filepath thingy is what im thinking :D
[13:40:19] phaul: what happens, here? I don't get it.. https://gist.github.com/phaul/ff094da9befde7580d873c565aac078c
[13:45:16] phaul: are the examples a separate instance from the one we mutate in the before block? must be..
[13:47:23] burgestrand: tabakhase absolutely, prepend your evil path of choice to $LOAD_PATH and whenever the file is required ruby will look in your evil path first
[13:48:48] phaul: I wanted to try rspecs bisect functionality but I guess it's not so easy to write leaky test :)
[13:50:53] burgestrand: phaul also, be wary of the order of your tests, I've a vague memory that rspec makes it random by default nowadays
[13:51:31] burgestrand: phaul the seed option is a way to ensure the order of tests is run the same between runs, too, even if they're normally ordered, same seed should result in same order
[13:52:52] phaul: ok thanks. I would have guessed that if you run with bisect it takes care of that stuff , but never tried, that's the point, Im just playing with this to see what it does
[13:53:23] tabakhase: and i assume i dont need the gem&ruby-version or so in those paths? (to overwrite gems/2.4.0/gems/the-name-0.1.0/lib/mo/me.rb i would assume my overwrite goes into "$LOAD_PATH_ADDITION/the-name/lib/mo/me.rb ?)
[13:56:22] burgestrand: tabakhase keep in mind that if your gem in mind uses e.g. `require_relative` or some other absolute path to its own files (which is bad practice, but that never stopped anybody) then your override might not work :)
[15:11:16] tabakhase: hm, im not getting that LOAD_PATH overwrite to grip...guess ill just leave the "edited gem" and hope for my pullrequest to be accepted quickly ;D
[15:12:09] tabakhase: still have not found the "loading line" of it (so it may be some broky relative load) - and ontop its "part of a gem thats in the gemspec of another gem that i call via bundler" - so i may be tossing a bunch of variables in there complicating that...
[15:22:58] bsamorim: Hi, guys! Could anyone tell me which unit is used in ObjectSpace.memsize_of(obj) 's return value?
[17:35:39] icarus: Hi all, I'm in a bit of a rut with some sinatra code: `get '/:action' do |a| \n response = exec ( "ssh ..." ) \n puts response \n end`
[17:36:56] icarus: Basically I'm running `exec ( "ssh ..." )` to issue a local ssh command which correctly responds with json in the backend debug, but it won't response to the `curl 127.0.0.1:8080/action` call
[17:41:23] isaiahnixon: I am trying out this gem: https://github.com/joeellis/remote-sass. I installed it globally and then I added the RemoteSass.location line from the usage section of the README to a SASS file. When I try to compile it I am getting a syntax error: https://hastebin.com/ejusucafir.vbs. Did I install it wrong, or is the gem not working?
[17:48:15] bsamorim: if you want to exec a bash statement and return to the caller program, yielding the command's output, your best choice would be using backticks
[17:48:43] bsamorim: so, your code would be `get '/:action' do |a| \n response = `ssh ...` \n puts response \n end`
[17:48:59] havenwood: icarus: For when you really do need a Rack timeout, there's a nice gem for it: https://github.com/heroku/rack-timeout
[17:56:11] icarus: Interesting, now its waiting for the response correctly, the backend is still showing the json response, but the `curl ...` outputs a blank response
[18:04:27] havenwood: al2o3-cr: "The result may be an Integer, a Float, a Rational, or a complex number."
[18:16:14] havenwood: the preview1 was out earlier this year than ever before, to get early testing on the JIT
[21:00:22] havenwood: I could use extra eyes if anyone wants to review commit for adding the new versions to RVM: https://github.com/rvm/rvm/pull/4340
[21:03:30] vdl: Is it possible to hook bundler to execute a command when one does `bundle exec asciidoctor-revealjs <args>`?
[21:05:43] apeiros: mr-robert: given that it was slated to arrive ~3y ago, it *is* vaporware. but that doesn't mean that nobody works on it.
[21:08:44] vdl: Also I would like bundle to be executed in a given directory. This equivalent of make -C dir. Is that possible as well ?
[21:14:58] havenwood: vdl: I don't know any ways to add a hook, other than aliasing or a shim or that sort of thing.
[21:17:24] vdl: havenwood: what I want to do is copy the reveal.js directory into the directory of the output file created by asciidoctor-revealjs.
[22:07:35] memo1: hi, i want to run a ruby program that exceute a ffmpeg commad and at the same time monitor the filessytem to avoid disk full. I need to record video from a camara, with ffmpeg, but i cant control yet the disk. Ffmpeg blocks the script, so i dont know to monitor the disk at the same time.
[22:24:19] memo1: mr-robert: thank you, just starting using ruby. A good reference or help to do it?
[22:29:26] havenwood: memo1: Are you familiar with Threads? Have you tried spinning up a simple Thread to monitor the disk?
[22:30:53] mr-robert: i would spawn two threads, one to run ffmpeg and the other to monitor the disk, with the main thread responsible for polling a queue and killing the ffmpeg thread.
[22:34:09] mr-robert: oh ok. i would still do that on the main thread. i don't know of any good tutorials.