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

Google Artwork Crawler #297

Open
wants to merge 26 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
26 commits
Select commit Hold shift + click to select a range
4170f19
Add gem files
marina-ferreira Dec 26, 2024
d171aa7
Add nokogiri dependency to gemspec
marina-ferreira Dec 26, 2024
f21ed3c
Load rake tasks in Rakefile
marina-ferreira Dec 26, 2024
7edd138
Add search_artwork rake task
marina-ferreira Dec 26, 2024
f720d94
Add script to find artist html file for testing
marina-ferreira Dec 26, 2024
8dd927e
Add Google::Artwork::Crawler class
marina-ferreira Dec 26, 2024
22522e6
Add Google::Artwork::Crawler spec
marina-ferreira Dec 26, 2024
6fc95b3
Add app errors
marina-ferreira Dec 26, 2024
4a74474
Google::Artwork::Crawler non-existent file test case
marina-ferreira Dec 26, 2024
aecea0e
Google::Artwork::Crawler unreadable file test case
marina-ferreira Dec 26, 2024
f0c0a6f
Google::Artwork::Crawler artwork not found test case
marina-ferreira Dec 26, 2024
1513b92
Google::Artwork::Crawler artwork links not found test case
marina-ferreira Dec 26, 2024
f97d76f
Update Rubocop version
marina-ferreira Dec 26, 2024
70eafe2
Helpers::String sanitize
marina-ferreira Dec 26, 2024
f7148c0
Artwork Parser class and spec
marina-ferreira Dec 26, 2024
8b9236b
Google::Artwork::Crawler return artwork title, link and extensions
marina-ferreira Dec 26, 2024
e1dcb6d
Add ImageReplacerScriptParser class
marina-ferreira Dec 26, 2024
f2bc796
Rename string helpers
marina-ferreira Dec 26, 2024
4726bc5
Add image mapping to crawler
marina-ferreira Dec 26, 2024
8723151
Extract Helpers::Base64.sanitize
marina-ferreira Dec 26, 2024
4ce7527
Add Picasso paintings for testing
marina-ferreira Dec 26, 2024
9ba23ed
Add Leonardo da Vinci paintings for testing
marina-ferreira Dec 26, 2024
be673d7
Update rubocop rules
marina-ferreira Dec 26, 2024
3b17c66
Add documentation comments to classes
marina-ferreira Dec 26, 2024
0050d2d
Extract parameterize to Helpers::String
marina-ferreira Dec 26, 2024
f6487a2
Update ruby version on gemspec
marina-ferreira Dec 26, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions .rspec
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
--format documentation
--color
--require spec_helper
25 changes: 25 additions & 0 deletions .rubocop.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
AllCops:
TargetRubyVersion: 3.2

Style/StringLiterals:
Enabled: true
EnforcedStyle: double_quotes

Style/StringLiteralsInInterpolation:
Enabled: true
EnforcedStyle: double_quotes

Layout/LineLength:
Max: 120

Metrics/AbcSize:
Max: 30

Metrics/MethodLength:
Max: 20

Metrics/CyclomaticComplexity:
Enabled: false

Metrics/PerceivedComplexity:
Enabled: false
12 changes: 12 additions & 0 deletions Gemfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
# frozen_string_literal: true

source "https://rubygems.org"

# Specify your gem's dependencies in serpapi_challenge.gemspec
gemspec

gem "rake", "~> 13.0"

gem "rspec", "~> 3.0"

gem "rubocop", "~> 1.5"
64 changes: 64 additions & 0 deletions Gemfile.lock
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
PATH
remote: .
specs:
serpapi_challenge (0.1.0)
nokogiri (~> 1.18)

GEM
remote: https://rubygems.org/
specs:
ast (2.4.2)
diff-lcs (1.5.1)
json (2.9.1)
language_server-protocol (3.17.0.3)
nokogiri (1.18.0-arm64-darwin)
racc (~> 1.4)
parallel (1.26.3)
parser (3.3.6.0)
ast (~> 2.4.1)
racc
racc (1.8.1)
rainbow (3.1.1)
rake (13.2.1)
regexp_parser (2.10.0)
rspec (3.13.0)
rspec-core (~> 3.13.0)
rspec-expectations (~> 3.13.0)
rspec-mocks (~> 3.13.0)
rspec-core (3.13.2)
rspec-support (~> 3.13.0)
rspec-expectations (3.13.3)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-mocks (3.13.2)
diff-lcs (>= 1.2.0, < 2.0)
rspec-support (~> 3.13.0)
rspec-support (3.13.2)
rubocop (1.69.2)
json (~> 2.3)
language_server-protocol (>= 3.17.0)
parallel (~> 1.10)
parser (>= 3.3.0.2)
rainbow (>= 2.2.2, < 4.0)
regexp_parser (>= 2.9.3, < 3.0)
rubocop-ast (>= 1.36.2, < 2.0)
ruby-progressbar (~> 1.7)
unicode-display_width (>= 2.4.0, < 4.0)
rubocop-ast (1.37.0)
parser (>= 3.3.1.0)
ruby-progressbar (1.13.0)
unicode-display_width (3.1.2)
unicode-emoji (~> 4.0, >= 4.0.4)
unicode-emoji (4.0.4)

PLATFORMS
arm64-darwin-22

DEPENDENCIES
rake (~> 13.0)
rspec (~> 3.0)
rubocop (~> 1.5)
serpapi_challenge!

BUNDLED WITH
2.4.18
14 changes: 14 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
# frozen_string_literal: true

require "bundler/gem_tasks"
require "rspec/core/rake_task"

RSpec::Core::RakeTask.new(:spec)

require "rubocop/rake_task"

RuboCop::RakeTask.new

task default: %i[spec rubocop]

Dir["#{File.dirname(__FILE__)}/lib/tasks/*.rake"].each { |rake_file| load rake_file }
11 changes: 11 additions & 0 deletions bin/console
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "serpapi_challenge"

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

require "irb"
IRB.start(__FILE__)
8 changes: 8 additions & 0 deletions bin/setup
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
#!/usr/bin/env bash
set -euo pipefail
IFS=$'\n\t'
set -vx

bundle install

# Do any other automated setup that you need to do here
Loading