Skip to content

Instantly share code, notes, and snippets.

@tobias
Created July 16, 2009 20:30
Show Gist options
  • Select an option

  • Save tobias/148669 to your computer and use it in GitHub Desktop.

Select an option

Save tobias/148669 to your computer and use it in GitHub Desktop.
#!/usr/bin/ruby
url = ARGV[0]
css_file = ARGV[1]
strip = ARGV[2]
File.open(css_file, 'r') do |f|
while line = f.gets do
match = line.match(/url\((.*?)\)/)
if match
file = match[1]
file = file[strip.size..-1] if !strip.nil? and file =~ /^#{strip}/
`wget #{url}/#{file}`
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment