Skip to content

Instantly share code, notes, and snippets.

@hotchpotch
Created November 10, 2009 06:17
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 hotchpotch/223ce65ed51790de79eb to your computer and use it in GitHub Desktop.
Save hotchpotch/223ce65ed51790de79eb to your computer and use it in GitHub Desktop.
require 'rubygems'
require 'json'
require 'open-uri'
data = JSON.parse open('http://src.chromium.org/viewvc/chrome/trunk/src/chrome/common/extensions/api/extension_api.json').read
res = []
data.each do |d|
n = d['namespace']
if d['properties']
res << d['properties'].map {|key, value| "chrome.#{n}.#{key}" }
end
if d['functions']
res << d['functions'].map {|key, value| "chrome.#{n}.#{key['name']}()" }
end
if d['events']
res << d['events'].map {|key, value| "chrome.#{n}.#{key['name']} # event " }
end
end
puts res.flatten.sort.join("\n")
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment