From bd9939a50bfab1d92fd75b0b4abf0e1ceb663f85 Mon Sep 17 00:00:00 2001 From: Albert Yi Date: Fri, 2 Dec 2016 15:51:08 -0800 Subject: [PATCH] some additional documentation about rewrite strategies --- app/logical/downloads/rewrite_strategies/base.rb | 4 ++++ app/logical/sources/strategies/base.rb | 8 ++++++++ 2 files changed, 12 insertions(+) diff --git a/app/logical/downloads/rewrite_strategies/base.rb b/app/logical/downloads/rewrite_strategies/base.rb index c2c7d3ff6..31e7906f0 100644 --- a/app/logical/downloads/rewrite_strategies/base.rb +++ b/app/logical/downloads/rewrite_strategies/base.rb @@ -1,3 +1,7 @@ +# This is a collection of strategies for normalizing URLs. Most strategies +# typically work by parsing and rewriting the URL itself, but some strategies +# may delegate to Sources::Strategies to obtain a more canonical URL. + module Downloads module RewriteStrategies class Base diff --git a/app/logical/sources/strategies/base.rb b/app/logical/sources/strategies/base.rb index 54a95a5cd..b0f6e0fc9 100644 --- a/app/logical/sources/strategies/base.rb +++ b/app/logical/sources/strategies/base.rb @@ -1,3 +1,11 @@ +# This is a collection of strategies for extracting information about a +# resource. At a minimum it tries to extract the artist name and a canonical +# URL to download the image from. But it can also be used to normalize a URL +# for use with the artist finder. It differs from Downloads::RewriteStrategies +# in that the latter is more for normalizing and rewriting a URL until it is +# suitable for downloading, whereas Sources::Strategies is more for meta-data +# that can only be obtained by downloading and parsing the resource. + module Sources module Strategies class Base