Page 1 of 1
[15:33:11] blood: How do I prevent ruby from resolving environment variables passed to shell execute? If I run my script manually, everything works as expected
[17:14:56] blood: I can't get my ruby program to execute a command file properly : https://gist.github.com/bloodmc/965be762adf4f36072f14252e5a23c4e Any ideas?
[17:32:34] blood: NL3limin4t0r: good point it does not. However, the cmd is never being executed as it should be writing to another log file indicating it is running. If i execute the cmd manually, the log is updated as expected.
[17:45:58] blood: N3limin4t0r: same issue happens. Any debugging I can turn on to see what is happening?
[14:17:26] blood: https://dpaste.de/GcCV ruby's win32 service keeps complaining that the service i'm trying to configure doesn't exist but it does... any ideas?
[15:41:07] blood: https://dpaste.de/GcCV anyone know why this service can't be found? is it the spaces?
[05:03:32] blood: Anyway to copy xml namespaces -> remove namespaces -> do some xpath queries -> copy back namespaces?
[13:22:55] blood: Is there a way to ignore namespaces while querying xpath using Nokogiri? I cannot remove all namespaces from the document as it breaks the application that I am using.
[14:06:19] blood: darix: yea I tried storing all namespace definitions then resetting them before write and nokogiri crashes =)
[14:14:27] blood: nokogiri really needs an option to disable namespace requirements assuming you have xml with namespace only in root
[14:17:37] blood: I can do the following if i remove namespaces /weblogic-web-app/session-descriptor/cookie-name
[14:19:12] blood: so with namespaces it would be //xmlns:cookie-name and //xmlns:filter[filter-name='psfilter'] ? I leave out the root?
[14:20:53] blood: Problem is, im working on a puppet module for this and handling namespaces is annoying
[14:22:29] blood: no idea what binding.pry is, I've literally only worked on ruby for a few days. I'm a java dev =)
[14:25:54] blood: Error: /Stage[main]/Main/Xml_fragment[remove_psfilter]: Could not evaluate: ERROR: Invalid expression: //xmlns:[filter-name='psfilter']
[14:29:08] blood: darix: https://github.com/bloodmc/xml_fragment/blob/master/lib/puppet/util/xml_file.rb#L14
[00:36:11] blood: given the following XML using Nokogiri: https://gist.github.com/bloodmc/ea92142b8b0f83f3ef15a1915cb7aee6 , @document.xpath(xpath) finds nothing. Any idea?
[02:01:33] blood: Radar: https://github.com/Areson/xml_fragment/blob/master/lib/puppet/provider/xml_fragment/xml_fragment.rb#L54 https://github.com/Areson/xml_fragment/blob/master/lib/puppet/util/xml_file.rb#L89
[02:03:02] blood: @document.root.elements.delete_all("session-descriptor/cookie-name/*[not(@Puppet::Util::XmlFile.Managed)]")
[02:03:49] blood: I know I can just loop through each node and handle it but wondering if there was a shorter way like it is done in this repo
[03:45:57] blood: @document = Nokogiri::XML::Builder.new(:encoding => 'UTF-8').to_xml , shouldn't this work for an empty xml document
[14:17:09] blood: https://dpaste.de/o7bO I'm trying to have each node be a child of previous in xml but not sure how to do this when I use `xml.send`.
[14:17:42] blood: Ideally i would like to just pass an xpath that is created in XML without having to iterate through each node
[14:21:42] blood: I'm using recurse within the root block but not sure how to create a block as I go through
[14:23:02] blood: Only other thing I can think of to make this easier is to just generate an XML with root node then use xpath to insert everything else
[23:19:11] blood: given the following xml using Nokogiri : https://gist.github.com/bloodmc/ecc618f9b047162c4c21c3ed5cc8daf8, Why wouldn't the following code return any results ? https://dpaste.de/wLg1
[23:33:25] blood: ok great, I'm currently migrating xml_fragment puppet module to Nokogiri so I can also use it for HTML. Just making sure I chose right =)
[00:11:54] blood: Is there no way to remove a parent element after matching a specific element by value using REXML?
[00:15:48] blood: Currently with xml_fragment, it will call the remove_tag method which calls the REXML code as you see in gist. This only removes the element matched but will leave the parent empty
[00:16:07] blood: I tried to review the ruby docs but couldn't find anything on how to remove a parent element
[00:24:23] blood: So when using REXML, it will remove the matched element from xml properly but it doesn't handle the parent (assuming the parent isn't root)
[00:25:07] blood: I'm trying to match an element based on a value and have it remove all elements including children up to root
[00:27:31] blood: Because I only want to delete an element if a child element contains a value I specify. So when a child element is matched, I want to delete it as well as any parents it has up to root
[00:28:21] blood: I assume I should just check children on each element as I traverse then delete if it contains my criteria
[00:32:54] blood: http://www.rubyinside.com/ruby-xml-performance-benchmarks-1641.html According to this, REXML is painfully slow
[02:29:40] blood: https://dpaste.de/YnGt So I'm currently traversing nodes to find a specific match and delete the parent node if found. The issue is, I'm trying to traverse children within children until a match is found or there is no more children. I can't seem to find out how to do this with REXML. Any ideas?
[03:08:16] blood: Is there a better way to handle this https://dpaste.de/Y1J2 ? This runs pretty slow
[06:33:19] blood: Using Nokogiri, the following doesn't find a match even though my xpath query is correct @document.xpath("/weblogic-web-app/session-descriptor/cookie-name").each do |el| el.content=value["value"] end
[06:37:33] blood: @document.css("/weblogic-web-app/session-descriptor/cookie-name").each but xpath does not
[23:22:17] blood: I'm using puppet's xml_fragment module which uses REXML and i'm trying to add support to remove a tag along with its parent assuming parent isn't root. Any idea how I can accomplish this?