#ruby - 07 April 2018
« Back 1 day Forward 1 day »
[09:15:42] mynameisdebian: I have a VPS that I am logged into the desktop of, over RDP (like VNC). I also have an SSH window open to the same server. When I run export DISPLAY=10.0 ; firefox I see firefox launch as expected in the RDP window. However, when I run a Ruby script to open the browser it does not open. When I run "ps -ef" I see: ubuntu 4980 4978 5 09:06 pts/0 00:00:01 [firefox] <defunct> . Anyone have any idea how I can get
[09:20:47] mynameisdebian: darix: I'm using FF 47 with Selenium 2.53 after trying all that BS geckodriver and chromdriver crap. I spent a good 100 frustrating hours or so trying to find the right combination of Linux distr+version/Selenium/ChromeDriver/Firefox to no avail, trying every posted workaround I could find. What I gather is there are basically just a ton of bugs and nothing is working. I even tried the most recent official Selenium Docker
[09:20:47] mynameisdebian: Firefox container which also did not work out of the box. I decided on this solution because it is suitable for the purpose I have in mind, and because I can see my tests run in realtime.
[09:21:32] mynameisdebian: And because this combination has never had any real issues for me over several years. I prefer to use what works over what I cannot get working after 100 wasted hours.
[09:23:11] mynameisdebian: darix: I'm not sure, but I just use Selenium to automate business processes and I have yet to have a use case that this combo does not work with. I don't come from a QA background, but I could see how QA people would need to use the more current browsers
[09:26:13] mynameisdebian: darix: The project I'm working on involves interacting with about 30 different domain registrars. I originally started writing things in Mechanize but roughly half the sites required some JS to do what I needed to do, and I decided I could just get it all done quicker in Selenium on an actual FF window
[09:27:33] mynameisdebian: I want a cron job to run a ruby script that opens a FF window in an existing XFCE session
[09:30:20] mynameisdebian: First I tried running "export DISPLAY=10.0 ; firefox" in the shell and that worked
[09:30:42] mynameisdebian: then I wrote a Ruby script and had that spit out the DISPLAY variable, which was still "10.0"
[09:30:56] mynameisdebian: then I modified the script to launch FF with Selenium, and that did not work
[09:34:44] mynameisdebian: The Ruby script hangs and when I run "ps -ef" I see ubuntu 4980 4978 5 09:06 pts/0 00:00:01 [firefox] <defunct>
[13:39:41] leitz: Any idea why this rspec test shows failure, and not "pending"? Using rspec 3.7 and Ruby 2.6. https://github.com/makhidkarun/rb_tools/blob/master/spec/planet_spec.rb#L48-L50
[14:13:08] NorthLumberJack: hello masters, I am new to metaprgramming, I am trying to make a Predictable module, when I include this module into a class I want certain methods to raise NotImplimentedError if the methods are not overwritten in the including class...
[14:21:20] leitz: No worries. It's nice to the folks you're asking. Most won't yell at you but some might not answer that would otherwise.
[14:22:20] NorthLumberJack: @havewood https://gist.github.com/JerryArns/5d62f18a480017cfa6d9240055b93a8a
[14:22:25] havenwood: NorthLumberJack: Consider the following: https://gist.github.com/havenwood/2409d79d83dfb6a9e531094141a0d956
[14:46:54] hypercore: how would i implement a split function? e.g. split([1,2,3,4,5], 3) returns [[1,2,3], [4,5]]
[14:53:18] hypercore: havenwood: i guess i'm asking more about the logic of how it would be done, not the code specifically
[15:00:02] havenwood: hypercore: Here's a non-recursive implementation: https://gist.github.com/havenwood/6f5a65bbf5c6be4fc46441af126d1ea5
[15:01:37] havenwood: hypercore: Maybe try changing that implementation to work like you want it to, then modify it to be a recursive solution.
[15:05:31] hypercore: havenwood: trying to do it using only if statements, can't use slice_when or similar functions
[15:07:05] NorthLumberJack: @havenwood So Im trying your code from https://gist.github.com/havenwood/2409d79d83dfb6a9e531094141a0d956 and its thowing errors from other modules that their methods are not available, why would that be?
[15:07:54] havenwood: NorthLumberJack: Show us how you're using it? I may have misunderstood what you're trying to do.
[15:08:00] NorthLumberJack: im basically trying to make Rails model classes have a set of my Predicatble methods
[15:09:29] havenwood: NorthLumberJack: Should the methods all be defined at the time this module is included? Do you want only the first to raise, or should it say which all are missing? Do the arguments have to be right, or it just needs to respond to the method?
[15:10:52] havenwood: dminuoso: ^ this reminds me of... some crazy code you were working on: https://gist.github.com/havenwood/55a3399e62bc3f6ab8d27bc46d74ceb3
[15:16:31] NorthLumberJack: @havenwood here you go https://gist.github.com/JerryArns/3a40ac8f85a97f00f2c8a2a6a9abcf8f
[15:21:03] NorthLumberJack: havenwood: oh man that example code of the crazy project just blows my mind, would take me an hr to read through.
[15:24:59] NorthLumberJack: havenwood: The only thing that Predictable is doing so far is making sure the including class is implimenting certain methods, I guess i would check their returned data for uniformity in the future
[15:26:19] leitz: I've spent the morning refactoring and re-learning rspec basics. Time for a break.
[15:26:23] havenwood: NorthLumberJack: Ah, you're checking if instance methods exist, not class methods.
[15:33:03] desperek: uh, any of you sirs are into haml? any idea why form_for renders <form></form> and rest of fields outside?
[15:45:35] NorthLumberJack: havenwood: so i have to include the module after my method definitions, does that seem right?
[15:47:22] havenwood: NorthLumberJack: or reopen the class and do it (but either way, it does have to be after)
[16:01:10] NorthLumberJack: havenwood: this metaprogramming stuff is fantastic, i need to learn more
[17:44:45] NorthLumberJack: havewood: The code works greats just wanted to say thanks and had one question. When a method is not included the raise NotImplimentedError is called, why does the including class throw udefined method errors for existing class methods?
[17:53:42] desperek: heeeeelp, i need somebody, cause form_for in each loop doesnt render properly with haml
[17:54:31] ruby[bot]: desperek: Please join #RubyOnRails for Rails questions. You need to be identified with NickServ, see /msg NickServ HELP
[18:19:37] devilsadvocate: does anyone know if there's a gem that wraps http://curator.apache.org/getting-started.html