Page 1 of 41 | Next »
[01:04:44] ivanskie: trying to write a script to download gist file. supply gist url (without the raw url).. it scans the page for raw url. then tries to download the raw file.
[01:08:30] ivanskie: i can already get the `raw_url` https://developer.github.com/v3/gists/#get-a-single-gist
[01:08:54] ivanskie: im using the download block from here https://github.com/piotrmurach/tty-file/blob/master/lib/tty/file/download_file.rb#L33-L53
[01:09:35] ivanskie: im writing this to include in my own gem.. i'm trying not to have too many pre-reqs.
[19:32:57] ivanskie: i have a rescue of entire app .. uhm. basically a catch all. and caller for that is obviously its own file / line / col. and not the actual caller way deeper in the app.
[19:33:45] ivanskie: so im scratching my head. how do I handle errors/exceptions nicely, and still be able to have --trace argv so i can print a nice backtrace
[19:47:12] ivanskie: if i raise TTY::CLI::Error from anywhere in the application... the trace will be exe/teletype:15
[19:49:26] ivanskie: but it's okay. I understand how this works now. i'll just have to put rescue block a lot close to raise
[21:33:20] ivanskie: if i start a spinner and then want to stop it After TTY::File stuff finished.. it no longer keeps track of that buffer and just prints new line after TTY::File finishes. :(
[23:39:38] ivanskie: He was just active on github. I have more questions about his other gems. not worth opening an issue
[00:57:55] ivanskie: if im making a gem... how do I specify to create a directory and copy certain files when gem is being installed? is that possible?
[21:16:43] ivanskie: i'm having an annoying issue of "WARN: Unresolved specs during Gem::Specification.reset"
[21:17:19] ivanskie: i've done `gem clean` and removed only the gems mentioned in the warning. and this is still popping up (standalone ruby project)
[21:17:50] ivanskie: maybe i should google some more. but the suggestions from what I have found, don't seem to help
[21:40:20] ivanskie: i'm putting together a TTY based gem (with thor).. and i thought i'd use awesome_print for easier to read output for logging.
[21:40:38] ivanskie: and then was refactoring Gemfile into gemspec for the gem. and since bundle clean --force.. it broke it somehow
[21:41:11] ivanskie: it adds .ap method to Logger class. and this used to work. and now it doesn't i don't get it.
[23:05:17] ivanskie: i hijacked the bin executable, and renamed the main one so that I can do stuff in parant shell in a certain situation.
[23:06:08] ivanskie: anyway now all help / error outputs the name of the renamed executable (i added '_'. in my case).
[23:40:56] ivanskie: my main executable lets say was exe/`command` i renamed it `_command` and added `command` which just has an if/else block in it. if second argumant matches it runs something else. otherwise it just starts `_command`.
[20:20:03] ivanskie: looking at a couple posts https://stackoverflow.com/questions/4103809/how-to-create-a-ssh-tunnel-in-ruby-and-then-connect-to-mysql-server-on-the-remot and https://stackoverflow.com/questions/37985266/create-a-background-ssh-tunnel-in-ruby and https://stackoverflow.com/questions/13998267/how-to-properly-implement-netssh-port-forwards
[20:21:19] ivanskie: something like that from within ruby. expose the port, print a postgresql::// url in cli to open in postico.. then if it doesn't shutdown on its own, have some other loop to shutdown the tunnel
[20:26:03] ivanskie: @params and params are indeed valid and separate things. so its not a typo in that regard.. uhm was looking at debugger output and it doesn't even try to send anything when i click the postgresql url then. for 127.0.0.1 etc etc
[20:30:39] ivanskie: our RDS (postgress database on amazon) isn't exposed to the public. But our bastion host has access to it. So I'm trying to open a tunnel to bastion with port forwarding to the RDS endpoint from bastion. if that makes sense?
[20:32:08] ivanskie: "ssh -f my_bastion_host -L $myport:$RDS_HOSTNAME:$RDS_PORT "sleep 10"" when the envars are filled... connects to bastion host, does local port forwarding to 65432 (in case one of us has local postgres server running). then I can just launch postico pointing to 127.0.0.1:56432 with credentials for RDS db. and get in there.
[20:32:36] ivanskie: the "sleep 10" command just executes on bastion, giving me time to open postico. then ssh tunnel doesn't close until i close postico or whatever.
[20:33:46] ivanskie: Im trying to do that now in ruby. because I need to dynamically lookup which bastion/jump box to connect to, and pull correct RDS endpoint and creds based on which app / environment is specified beforehand.
[20:36:17] ivanskie: i've tried building a system ssh command line string. and something isn't working right.
[20:37:39] ivanskie: oh actually i think i just need to keep track of the PID... then i can kill it in ruby afterwords.. hmmmmmmmmmm anyway im hoping i can do this with net::ssh or net::ssh::gateway gem
[20:46:33] ivanskie: cake time. unfortunately the one day i actually want to grab a beer. work fridge only has pop :( sad day
[20:47:17] ivanskie: for anyone interested... : https://www.madebylotus.com/blog/handling-port-forwarding-in-ruby/
[20:51:24] ivanskie: i wonder if there's a way I can have a loop in my code to monitor for that and just quit the app. for now i just have a 5 minute timer, or press any key to quit prompt
[20:53:27] ivanskie: hmm... anyway now im in bonus round. maybe time to code a way to run rake tasks on our apps, without sshing in, etc etc