Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP: Help with formulas testing #365

Draft
wants to merge 7 commits into
base: main
Choose a base branch
from
Draft

Conversation

alexeymorozov
Copy link
Contributor

See #364

def downloadable?(name)
retries ||= 0
retries += 1
Down.open("https://fonts.google.com/download?family=#{name}")
Down.open("https://fonts.google.com/download?family=#{ERB::Util.url_encode(name)}")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [93/80]

response = h.head("/download?family=#{ERB::Util.url_encode(name)}")
next unless response.is_a?(Net::HTTPOK)

header = response['content-length']
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

end

def download(name)
url = "https://fonts.google.com/download?family=#{ERB::Util.url_encode(name)}"
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [88/80]

Excavate::Archive.new(archive).files do |path|
next unless File.file?(path)

yield path if path.end_with?(".ttf") || path.end_with?(".otf")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use path.end_with?(".ttf", ".otf") instead of path.end_with?(".ttf") || path.end_with?(".otf").

end
end

def archive_fonts_up_to_date?(formula, metadata_name)
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Method has too many lines. [12/10]

@@ -34,6 +35,8 @@ def fetch_new_paths
new_paths = []

fetch_fonts_paths.each do |path|
# next unless path.end_with?("coveredbyyourgrace") || path.end_with?("anton")
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Line is too long. [89/80]

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant