search: refactor PostQueryBuilder class methods into instance methods.

* Make scan_query, parse_query, normalize_query into instance methods
  instead of class methods. This is to a) clean up the API and b)
  prepare for moving certain tag utility methods into PostQueryBuilder.

* Fix a few cases where a caller used scan_query when they should have
  used split_query or parse_tag_edit.
This commit is contained in:
evazion
2020-04-22 19:38:17 -05:00
parent d355c0e221
commit 3dab648d0e
10 changed files with 534 additions and 532 deletions

View File

@@ -88,8 +88,8 @@ class AliasAndImplicationImporter
all
when :mass_update
all += PostQueryBuilder.split_query(token[1])
all += PostQueryBuilder.split_query(token[2])
all += PostQueryBuilder.new(token[1]).split_query
all += PostQueryBuilder.new(token[2]).parse_tag_edit
all
when :change_category

File diff suppressed because it is too large Load Diff

View File

@@ -4,7 +4,7 @@ module PostSets
attr_reader :tag_array, :page, :raw, :random, :post_count, :format
def initialize(tags, page = 1, per_page = nil, raw: false, random: false, format: "html")
@tag_array = PostQueryBuilder.split_query(tags)
@tag_array = PostQueryBuilder.new(tags).split_query
@page = page
@per_page = per_page
@raw = raw.to_s.truthy?