Skip to content

Instantly share code, notes, and snippets.

@theirix
Created May 25, 2014 09:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save theirix/adc67dc9d4d31abe3d31 to your computer and use it in GitHub Desktop.
Save theirix/adc67dc9d4d31abe3d31 to your computer and use it in GitHub Desktop.
Check latest hg version for OS X 10.9
require 'open-uri'
require 'rkelly'
ast = RKelly::Parser.new.parse(open('http://mercurial.selenic.com/sources.js').read)
ast.pointcut(RKelly::Nodes::ArrayNode).matches[1..-1].each do |node|
elements = node.pointcut(RKelly::Nodes::StringNode).matches
if elements.any? { |v| v.value =~ /Mercurial.*MacOS.*10\.9/ }
puts elements[0].value[1...-1] + ' at ' + elements[2].value[1...-1]
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment