by

Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Repo info
Activity
Mike Dalessio
@flavorjones
(sorry for the delayed reply)
Mike Dalessio
@flavorjones
@/all deploying updates to concourse, expect a minute or two of downtime.
Ivan Kelly
@ivankelly
when is the next release of nokogiri slated for?
Mike Dalessio
@flavorjones
@ivankelly thanks for asking. I'm curious if there's a particular fix or feature you're interested in? There's nothing stopping us from releasing now, really. I'll try to do it this week
Christian Nguyen
@cuongaconda_twitter
I'm using an older version of libxml and can't upgrade to 2.9.4. What's the best way of making sure it changes something like i <3 you to i &lt; you rather than removing anything after the < completely. Currently, it returns thisi
Mike Dalessio
@flavorjones
@cuongaconda_twitter unfortunately nokogiri can't control how invalid markup is "fixed" by the underlying parsing libraries. In this case it is likely seeing an unclosed tag -- if you look at the document's errors you may get a better understanding of what's going on.
Joni Orponen
@Rotonen
pkg-config does not find libxml from the macos 10.14 sdk with nokogiri 1.8.4 - i can manage with a homebrew provided libxml and making a nokogiri specific bundle config, but FYI as a heads up - probably going to be a deluge of people in a few weeks
joaquindiaz01
@joaquindiaz01
Hello, i have a doubt about generating a xml file with nokogiri. This builder = Nokogiri::XML::Builder.new do |xml| ... must be executed in a initializer in rails?
which is the best practice?
Mike Dalessio
@flavorjones
@joaquindiaz01 can you explain a bit more about what you're trying to do?
For what purpose are you using the generated XML document?
Mike Dalessio
@flavorjones
@here v1.10.0.rc1 is up on rubygems
kapilpipaliya
@kapilpipaliya
I have scrolling webpage. when i goes to end of page, it loads more data. how can i parse it with nokogiri?
i want to load all the data in in.
Mike Dalessio
@flavorjones
@kapilpipaliya Answering this question will involve networking and hitting API calls involving several gems; Nokogiri is simply a wrapper for a parsing library. You may want to ask on a more general forum.
kapilpipaliya
@kapilpipaliya
thanks
Mike Dalessio
@flavorjones
@/all ci.nokogiri.org will be unavailable briefly while we upgrade to concourse 5.0.0
Mike Dalessio
@flavorjones
downtime starts now
Mike Dalessio
@flavorjones
there may be brief ci.nokogiri.org outages again today
Mike Dalessio
@flavorjones
@/all nokogiri v1.10.2 is out, see https://nokogiri.org/CHANGELOG.html for details
Mike Dalessio
@flavorjones
ci.nokogiri.org will be going down briefly for a version upgrade to concourse 5.1.0.
Mike Dalessio
@flavorjones
CI is back up
Mike Dalessio
@flavorjones
@/all ci.nokogiri.org will be going down briefly for a version upgrade to concourse v5.2.0
Mike Dalessio
@flavorjones
ci is back up
MSP-Greg
@MSP-Greg
Nokogiri API docs, wiki pages, & tutorials available at https://msp-greg.github.io/nokogiri/. API docs based on master... JFYI
Ian Kottman
@ikottman

Hello everyone. What system dependencies does nokogiri have at runtime? For example, I know it needs libxml2/libxslt to compile native extensions, but do those libraries still need to be available at runtime?

Context: I'm making a bare-bones docker image for running a rails app, and I'm scrutinizing every system dependency to determine if it's really necessary at runtime.

Mike Dalessio
@flavorjones
@ikottman Apologies for my slow response, I've been AFK for a few days. There are a few options here, including static compilation (which should be the default) so you shouldn't need libxml2/libxslt shared libraries hanging around.
@ikottman Maybe we could figure out a time to talk synchronously, either here or on a zoom/hangout about how to approach this?
Ian Kottman
@ikottman
Sure! I'll DM you to setup a time to chat
William Entriken
@fulldecent
Hello room.
This is a simple PR which allows Nokogiri to be used with HTML5 validators. // sparklemotion/nokogiri#1918
Requesting review please.
Mike Dalessio
@flavorjones
@fulldecent ACK. Just commented on the PR and will review ASAP
Qqwy / Wiebe-Marten
@Qqwy
Hi!

When doing the following:

Nokogiri::HTML.fragment("<a href='https://foo.com?a=1&b=2").to_s                                                    
# => "<a href=\"https://foo.com?a=1&amp;b=2\"></a>"

in the output, the ampersand is escaped

Am I doing something wrong here?
(My real use-case is iterating over all a[href]s in the document and altering the URLS)
Nokogiri::HTML("<a href='https://foo.com'>foo</a>").search("//a").each do |n| n.attributes["href"].value = "https://foo.com?q=a&x=y" end.to_s
Qqwy / Wiebe-Marten
@Qqwy
Hmm, I learned something new today!
Turns out that ampersands should always be escaped inside URLs.
I only hope that no double escaping will happen, where &amp; is expanded into &amp;amp; in this example
Shlomi Fish
@shlomif
hi all! The "tutorials" link here is broken - https://nokogiri.org/
Mike Dalessio
@flavorjones
expect a few minutes of CI downtime, updating to https://github.com/concourse/concourse/releases/tag/v6.0.0
guillermo haas-thompson
@memoht
I am strugglebussing to parse an XML feed with Nokogiri to create records in a Rails database. I've tried multiple times over the years to get an XML feed to parse and managed to avoid it by going other routes (CSV import, JSON files, hitting API). I have a new task for a side project that is forcing me to revisit XML parsing. I think my example is straightforward enough, and wondering if anyone has a few to help me through this. [Simplified example: https://gist.github.com/memoht/1dc78f0f005abbb8d01267519ce386f1]
Mike Dalessio
@flavorjones
@memoht Hi there! Sorry for the slow response, have been moving onto a new laptop and missed the notifications. I'm happy to try to help! FWIW I can parse the XML in your gist just fine using Nokogiri::XML(xml) ... can you be more specific about what you're trying to do?
guillermo haas-thompson
@memoht
My end goal is to parse the feed via. rake task a couple times a day, and either create or update records in the Rails app by the referencenumber field in the XML. That is in the 2nd file of the gist.
guillermo haas-thompson
@memoht
Current state > Now able to create new Job records and skip if record exists (searching by referencenumber in XML field) but still unable to update existing records. So, progress-ish.
guillermo haas-thompson
@memoht
@flavorjones Gist updated with current state of affairs (the horror, look away) https://gist.github.com/memoht/e693d8bffc433e8d63d8cbc8d2ceebe0
guillermo haas-thompson
@memoht
Current state > Got it working via some assist, but not the most efficient. Taking advantage of first_or_initialize >> would still love to see a cleaner way of achieving this.
Mike Dalessio
@flavorjones
@memoht I'm still not sure what you need help with? The code you're using to parse each job record seems fine and similar to how I would approach the problem. Can you be more specific about what you're looking for help with?
guillermo haas-thompson
@memoht
@flavorjones TBH, I didn't know if my code was the cleanest. The section where it tries to create a new record, or update if record already exists (searching by ref_no field) felt like I didn't do it so well. It works, but I was wondering if there was a more efficient approach.
I spent a lot of effort trying to convert the data to a Hash first because I was more familiar with that. The experience has helped me understand Nokogiri a bit better.