method

scrape

Importance_0
v1.1.6 - Show latest stable - 0 notes - Class: Commands::Discover
scrape(uri) public

No documentation

This method has no description. You can help the Ruby on Rails community by adding new notes.

Hide source
# File railties/lib/commands/plugin.rb, line 655
    def scrape(uri)
      require 'open-uri'
      puts "Scraping #{uri}" if $verbose
      dupes = []
      content = open(uri).each do |line|
        if line =~ /<a[^>]*href=['"]([^'"]*)['"]/ or line =~ /(svn:\/\/[^<|\n]*)/
          uri = $1
          if uri =~ /\/plugins\// and uri !~ /\/browser\//
            uri = extract_repository_uri(uri)
            yield uri unless dupes.include?(uri) or Repositories.instance.exist?(uri)
            dupes << uri
          end
        end
      end
    end
Register or log in to add new notes.