chromedriver-binary 0.1.2 → 0.1.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a80df6f17eb9699166192891de6e2c525a92ab65db314e3d9bcd130264e25856
4
- data.tar.gz: 7ce57f7d1c04df3ecfb1c9f2ebf08a63c5c33eae3200ca78a24a09f1dd077301
3
+ metadata.gz: 330cf0e3e6c057941c47f7040eda5c8a28db0c8dd6403c9b1eca8f8966d08650
4
+ data.tar.gz: d08c0078dee006bfb43360da18eb7694fa862163a5077a7e5f966814a365c1c1
5
5
  SHA512:
6
- metadata.gz: f27e86b394b1b2aa6e13c2b145a58421b4ffc587ea7fd87d37c40d747d9c0f224f897129c1f273fec59c86e7b615895ebf27c6d5053f9f33e8f8488a48bcd5e1
7
- data.tar.gz: 9ac78636240e12fd31787d2b0e4f4b56849d777df2f220ec6e4e1940e539cee87598ea6ddeab7cff37725519cf9c90795f2c433994ff636de1cb2d2e89b51e59
6
+ metadata.gz: 47a5832bae1937d22078ef0e74c83f19556b63ff29ffb1df79b088f8ed4c46c4c29100cbe167166fbe4deb1ad5247f33f4858f77ae6cc4bd145a002dbf1f47bd
7
+ data.tar.gz: f57f53f1ac5e2959bd2314673d7560e11be01be6a0af3ccc66aa0168138a1f742d089ea7cc38ab506ed45150a5b45580cf878563c409581a33b30bc2c7d100a4
data/CHANGELOG.md CHANGED
@@ -1,5 +1,37 @@
1
+ <!-- generated by git-cliff start -->
2
+
3
+ # Changelog
4
+
5
+ All notable changes to this project will be documented in this file.
6
+
7
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
8
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
9
+
1
10
  ## [Unreleased]
2
11
 
12
+ [unreleased]: https://github.com/dieter-medium/chromedriver-binary/compare/v0.1.3..HEAD
13
+
14
+ <!-- generated by git-cliff end -->
15
+
16
+ ## [0.1.4] - 2026-09-20
17
+
18
+ ### 🐛 Fixed
19
+
20
+ - Automatically detect and link a system-installed `chromedriver` (e.g. Debian/Ubuntu's
21
+ `chromium-driver` package) on Linux ARM64 before falling back to the official download, which
22
+ Google does not publish for that platform. Checks `CHROMEDRIVER_PATH` first, then a list of
23
+ common install directories.
24
+ - Declared `logger` as an explicit dependency. Ruby 4.0 no longer ships it as a default gem, so
25
+ `require "logger"` previously raised `LoadError`.
26
+ - Widened the `rubyzip` dependency to `>= 2.4, < 4.0` and fixed extraction to work correctly under
27
+ rubyzip 3.x, whose `Entry#extract` changed how its destination argument is interpreted.
28
+
29
+ ## [0.1.3] - 2025-05-05
30
+
31
+ ### 🐛 Fixed
32
+
33
+ - Removen unnecessary Exception handling in the `Chromedriver::Binary::ChromedriverDownloader` class.
34
+
3
35
  ## [0.1.2] - 2025-04-11
4
36
 
5
37
  ### 🐛 Fixed
data/Rakefile CHANGED
@@ -15,6 +15,8 @@ require "chromedriver/binary"
15
15
 
16
16
  load "chromedriver/Rakefile"
17
17
 
18
+ Dir.glob("tasks/*.rake").each { |r| load r }
19
+
18
20
  desc "Run tests with coverage"
19
21
  task :coverage do
20
22
  ENV["COVERAGE"] = "true"
data/cliff.toml ADDED
@@ -0,0 +1,138 @@
1
+ # git-cliff ~ configuration file
2
+ # https://git-cliff.org/docs/configuration
3
+
4
+ [changelog]
5
+ # template for the changelog header
6
+ header = """
7
+ <!-- generated by git-cliff start -->
8
+ # Changelog\n
9
+ All notable changes to this project will be documented in this file.
10
+
11
+ The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
12
+ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).\n
13
+ """
14
+ # template for the changelog body
15
+ # https://keats.github.io/tera/docs/#introduction
16
+ body = """
17
+ {%- macro remote_url() -%}
18
+ https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
19
+ {%- endmacro -%}
20
+
21
+ {% if version -%}
22
+ ## [{{ version | trim_start_matches(pat="v") }}] - {{ timestamp | date(format="%Y-%m-%d") }}
23
+ {% else -%}
24
+ ## [Unreleased]
25
+ {% endif -%}
26
+
27
+ {% for group, commits in commits | group_by(attribute="group") %}
28
+ ### {{ group | upper_first }}
29
+ {%- for commit in commits %}
30
+ - {{ commit.message | split(pat="\n") | first | upper_first | trim }}\
31
+ {% if commit.remote.username %} by @{{ commit.remote.username }}{%- endif -%}
32
+ {% if commit.remote.pr_number %} in \
33
+ [#{{ commit.remote.pr_number }}]({{ self::remote_url() }}/pull/{{ commit.remote.pr_number }}) \
34
+ {%- endif -%}
35
+ {% endfor %}
36
+ {% endfor %}
37
+
38
+ {%- if github.contributors | filter(attribute="is_first_time", value=true) | length != 0 %}
39
+ ## New Contributors
40
+ {%- endif -%}
41
+
42
+ {% for contributor in github.contributors | filter(attribute="is_first_time", value=true) %}
43
+ * @{{ contributor.username }} made their first contribution
44
+ {%- if contributor.pr_number %} in \
45
+ [#{{ contributor.pr_number }}]({{ self::remote_url() }}/pull/{{ contributor.pr_number }}) \
46
+ {%- endif %}
47
+ {%- endfor %}\n
48
+ """
49
+ # template for the changelog footer
50
+ footer = """
51
+ {%- macro remote_url() -%}
52
+ https://github.com/{{ remote.github.owner }}/{{ remote.github.repo }}
53
+ {%- endmacro -%}
54
+
55
+ {% for release in releases -%}
56
+ {% if release.version -%}
57
+ {% if release.previous.version -%}
58
+ [{{ release.version | trim_start_matches(pat="v") }}]: \
59
+ {{ self::remote_url() }}/compare/{{ release.previous.version }}..{{ release.version }}
60
+ {% endif -%}
61
+ {% else -%}
62
+ [unreleased]: {{ self::remote_url() }}/compare/{{ release.previous.version }}..HEAD
63
+ {% endif -%}
64
+ {% endfor %}
65
+ <!-- generated by git-cliff end -->
66
+ """
67
+ # remove the leading and trailing whitespace from the templates
68
+ trim = true
69
+
70
+ [git]
71
+ # parse the commits based on https://www.conventionalcommits.org
72
+ conventional_commits = true
73
+ # filter out the commits that are not conventional
74
+ filter_unconventional = false
75
+ # regex for preprocessing the commit messages
76
+ commit_preprocessors = [
77
+ # remove issue numbers from commits
78
+ { pattern = '\((\w+\s)?#([0-9]+)\)', replace = "" },
79
+ ]
80
+ # regex for parsing and grouping commits
81
+ commit_parsers = [
82
+ # ✅ Features (additions)
83
+ { message = "^feat(?:\\([^)]+\\))?!?:", group = "🚀 Added" },
84
+ { message = "^[aA]dd", group = "🚀 Added" },
85
+ { message = "^[sS]upport", group = "🚀 Added" },
86
+
87
+ # ❌ Removals
88
+ { message = "^[rR]emove", group = "🗑️ Removed" },
89
+ { message = "^[dD]elete", group = "🗑️ Removed" },
90
+
91
+ # 🐛 Fixes
92
+ { message = "^fix(?:\\([^)]+\\))?!?:", group = "🐛 Fixed" },
93
+ { message = "^[tT]est", group = "🐛 Fixed" },
94
+ { message = "^[fF]ix", group = "🐛 Fixed" },
95
+
96
+ # 🎨 Refactors
97
+ { message = "^refactor(?:\\([^)]+\\))?!?:", group = "🎨 Refactored" },
98
+
99
+ # ⚡️ Performance
100
+ { message = "^perf(?:\\([^)]+\\))?!?:", group = "⚡️ Performance" },
101
+
102
+ # 📝 Docs
103
+ { message = "^docs(?:\\([^)]+\\))?!?:", group = "📝 Docs" },
104
+
105
+ # 💄 Style (formatting, whitespace, etc.)
106
+ { message = "^style(?:\\([^)]+\\))?!?:", group = "💄 Style" },
107
+
108
+ # 🧪 Tests
109
+ { message = "^test(?:\\([^)]+\\))?!?:", group = "🧪 Tests" },
110
+
111
+ # 🔧 Build
112
+ { message = "^build(?:\\([^)]+\\))?!?:", group = "🔧 Build" },
113
+
114
+ # 🛠️ CI
115
+ { message = "^ci(?:\\([^)]+\\))?!?:", skip = true },
116
+
117
+ # 🧹 Chores (skip)
118
+ { message = "^chore\\(release\\): prepare for", skip = true },
119
+ { message = "^chore\\(deps.*\\)", skip = true },
120
+ { message = "^chore\\(pr\\)", skip = true },
121
+ { message = "^chore\\(pull\\)", skip = true },
122
+ { message = "^chore(?:\\([^)]+\\))?!?:", skip = true },
123
+ { message = "^\\s*chore", skip = true },
124
+
125
+ # ⏪ Reverts
126
+ { message = "^revert(?:\\([^)]+\\))?!?:", group = "⏪ Reverted" },
127
+
128
+ # 🌀 Catch-all (only if nothing else matched)
129
+ { message = "^.*", group = "🔄 Changed" }
130
+ ]
131
+
132
+
133
+ # filter out the commits that are not matched by commit parsers
134
+ filter_commits = false
135
+ # sort the tags topologically
136
+ topo_order = false
137
+ # sort the commits inside sections by oldest/newest order
138
+ sort_commits = "newest"
@@ -5,6 +5,7 @@ require_relative "version_resolver"
5
5
  require_relative "platform"
6
6
  require_relative "downloader_helper"
7
7
  require_relative "system_helper"
8
+ require_relative "system_driver_locator"
8
9
 
9
10
  module Chromedriver
10
11
  module Binary
@@ -14,6 +15,7 @@ module Chromedriver
14
15
  include Platform
15
16
  include DownloaderHelper
16
17
  include SystemHelper
18
+ include SystemDriverLocator
17
19
 
18
20
  # Define where to install ChromeDriver.
19
21
  def install_dir
@@ -32,10 +34,14 @@ module Chromedriver
32
34
  def update(force: false)
33
35
  return driver_path if up_to_date_binary?(force)
34
36
 
37
+ return driver_path if linux_arm64? && link_system_driver?
38
+
35
39
  Chromedriver::Binary.logger.warn(<<-EOF_WARNING) if linux_arm64?
36
40
 
37
- WARNING: The Linux ARM64 version of ChromeDriver is not officially supported by Google.
38
- Please use the OS version of ChromeDriver instead.
41
+ WARNING: The Linux ARM64 version of ChromeDriver is not officially supported by Google,
42
+ and no working chromedriver was found automatically (checked CHROMEDRIVER_PATH and
43
+ #{SystemDriverLocator::SEARCH_DIRECTORIES.join(", ")}).
44
+ Please install the OS version of ChromeDriver instead.
39
45
  For instance on Ubuntu, use the `chromium-driver` package and link it to #{driver_path}.
40
46
  `apt-get update && apt-get install chromium-driver`
41
47
  `mkdir -p #{install_dir} && ln -s /usr/bin/chromedriver #{driver_path}`
@@ -63,12 +69,33 @@ module Chromedriver
63
69
 
64
70
  def correct_binary?
65
71
  current_installed_version == browser_version || current_installed_version == latest_patch_version_for_build
66
- rescue ConnectionError, VersionError
72
+ rescue VersionError
67
73
  false
68
74
  end
69
75
 
70
76
  private
71
77
 
78
+ # Symlinks a system-installed chromedriver into driver_path and verifies it actually
79
+ # matches the installed browser before trusting it - a found binary that's the wrong
80
+ # version is no better than none, so it's unlinked again rather than left in place for
81
+ # #update to fall through to the (still doomed, but at least unambiguous) download.
82
+ def link_system_driver?
83
+ source = system_driver_path
84
+ return false unless source
85
+
86
+ prepare_install_dir
87
+ FileUtils.ln_sf(source, driver_path)
88
+
89
+ if correct_binary?
90
+ Chromedriver::Binary.logger.info "Linked system chromedriver #{source} to #{driver_path} (Linux ARM64 has no official Google build)"
91
+ true
92
+ else
93
+ Chromedriver::Binary.logger.debug "#{source} exists but its version doesn't match the browser - removing the link and falling back to the official download"
94
+ FileUtils.rm_f(driver_path)
95
+ false
96
+ end
97
+ end
98
+
72
99
  def up_to_date_binary?(force)
73
100
  if correct_binary? && !force
74
101
  Chromedriver::Binary.logger.debug "A working webdriver version is already on the system"
@@ -36,9 +36,16 @@ module Chromedriver
36
36
  def extract_zip(zip_file, destination)
37
37
  Zip::File.open(zip_file) do |zip|
38
38
  zip.each do |entry|
39
- # Extract all files as top-level (ignoring any folder structure)
39
+ next unless entry.file?
40
+
41
+ # Extract all files as top-level (ignoring any folder structure). Writes the entry's
42
+ # bytes directly rather than calling Entry#extract - that method's own destination
43
+ # argument is not stable across rubyzip major versions: 2.x took a full destination
44
+ # path as its first positional arg, 3.x repurposed that arg as a path *relative to* a
45
+ # separate destination_directory: keyword, silently mangling an absolute path passed
46
+ # the old way (confirmed live: doubled into ".../chromedriver-binary/chromedriver-binary/...").
40
47
  destination_file = File.join(destination, File.basename(entry.name))
41
- entry.extract(destination_file) { true }
48
+ File.binwrite(destination_file, entry.get_input_stream.read)
42
49
  end
43
50
  end
44
51
  rescue StandardError => e
@@ -0,0 +1,42 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Chromedriver
4
+ module Binary
5
+ # Locates a chromedriver binary already installed on the system - used on Linux ARM64, where
6
+ # Google's own Chrome for Testing distribution has never published a chromedriver build at all
7
+ # (a long-standing upstream gap, not a bug in this gem - see ChromedriverDownloader#update's own
8
+ # comment). Debian/Ubuntu's `chromium-driver` package ships a matching native-arch binary
9
+ # instead; this lets it be found and linked automatically rather than only ever printing
10
+ # instructions for a human to run by hand.
11
+ module SystemDriverLocator
12
+ SEARCH_DIRECTORIES = %w[/usr/local/sbin /usr/local/bin /usr/sbin /usr/bin /sbin /bin /snap/bin].freeze
13
+ SEARCH_FILENAMES = %w[chromedriver].freeze
14
+
15
+ # @return [String, nil] path to an existing chromedriver binary, or nil if none was found.
16
+ def system_driver_path
17
+ driver_from_env || find_driver_on_disk
18
+ end
19
+
20
+ private
21
+
22
+ # Same override shape as Finder#chrome_bin_from_env's CHROMEDRIVER_CHROME_PATH, for the driver
23
+ # instead of the browser - an explicit escape hatch for a system driver outside
24
+ # SEARCH_DIRECTORIES.
25
+ def driver_from_env
26
+ path = ENV.fetch("CHROMEDRIVER_PATH", nil)
27
+ path if path && File.exist?(path)
28
+ end
29
+
30
+ def find_driver_on_disk
31
+ SEARCH_DIRECTORIES.each do |dir|
32
+ SEARCH_FILENAMES.each do |file|
33
+ path = File.join(dir, file)
34
+ return path if File.exist?(path)
35
+ end
36
+ end
37
+
38
+ nil
39
+ end
40
+ end
41
+ end
42
+ end
@@ -2,6 +2,6 @@
2
2
 
3
3
  module Chromedriver
4
4
  module Binary
5
- VERSION = "0.1.2"
5
+ VERSION = "0.1.4"
6
6
  end
7
7
  end
@@ -0,0 +1,29 @@
1
+ # frozen_string_literal: true
2
+
3
+ def cliff_installed?
4
+ system("which git-cliff > /dev/null 2>&1")
5
+ end
6
+
7
+ namespace :changelog do
8
+ desc "Generate unreleased section in CHANGELOG.md (requires git-cliff)"
9
+ task :update_unreleased do
10
+ unless cliff_installed?
11
+ puts "🚫 git-cliff is not installed!"
12
+ puts "👉 Install it here: https://git-cliff.org/docs/installation/"
13
+ exit 1
14
+ end
15
+
16
+ generated = `git cliff --unreleased`
17
+
18
+ changelog_path = "CHANGELOG.md"
19
+ changelog = File.read(changelog_path)
20
+
21
+ updated = changelog.sub(
22
+ /<!--.*generated\s+by\s+git-cliff\s+start\s+-->(.*?)<!--\s+generated\s+by\s+git-cliff\s+end\s+-->/m,
23
+ generated.strip
24
+ )
25
+
26
+ File.write(changelog_path, updated)
27
+ puts "✅ Replaced generated section in CHANGELOG.md"
28
+ end
29
+ end
metadata CHANGED
@@ -1,29 +1,48 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: chromedriver-binary
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.1.2
4
+ version: 0.1.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Dieter S.
8
- autorequire:
9
8
  bindir: exe
10
9
  cert_chain: []
11
- date: 2025-04-11 00:00:00.000000000 Z
10
+ date: 1980-01-02 00:00:00.000000000 Z
12
11
  dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: logger
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
13
26
  - !ruby/object:Gem::Dependency
14
27
  name: rubyzip
15
28
  requirement: !ruby/object:Gem::Requirement
16
29
  requirements:
17
- - - "~>"
30
+ - - ">="
18
31
  - !ruby/object:Gem::Version
19
32
  version: '2.4'
33
+ - - "<"
34
+ - !ruby/object:Gem::Version
35
+ version: '4.0'
20
36
  type: :runtime
21
37
  prerelease: false
22
38
  version_requirements: !ruby/object:Gem::Requirement
23
39
  requirements:
24
- - - "~>"
40
+ - - ">="
25
41
  - !ruby/object:Gem::Version
26
42
  version: '2.4'
43
+ - - "<"
44
+ - !ruby/object:Gem::Version
45
+ version: '4.0'
27
46
  - !ruby/object:Gem::Dependency
28
47
  name: rake
29
48
  requirement: !ruby/object:Gem::Requirement
@@ -142,6 +161,7 @@ files:
142
161
  - LICENSE.txt
143
162
  - README.md
144
163
  - Rakefile
164
+ - cliff.toml
145
165
  - lib/chromedriver/Rakefile
146
166
  - lib/chromedriver/binary.rb
147
167
  - lib/chromedriver/binary/chromedriver_downloader.rb
@@ -150,6 +170,7 @@ files:
150
170
  - lib/chromedriver/binary/finder.rb
151
171
  - lib/chromedriver/binary/platform.rb
152
172
  - lib/chromedriver/binary/railtie.rb
173
+ - lib/chromedriver/binary/system_driver_locator.rb
153
174
  - lib/chromedriver/binary/system_helper.rb
154
175
  - lib/chromedriver/binary/tasks/chromedriver.rake
155
176
  - lib/chromedriver/binary/version.rb
@@ -161,6 +182,7 @@ files:
161
182
  - sig/chromedriver/binary/platform.rbs
162
183
  - sig/chromedriver/binary/system_helper.rbs
163
184
  - sig/chromedriver/binary/version_resolver.rbs
185
+ - tasks/changelog.rake
164
186
  homepage: https://github.com/dieter-medium/chromedriver-binary
165
187
  licenses:
166
188
  - MIT
@@ -170,7 +192,6 @@ metadata:
170
192
  source_code_uri: https://github.com/dieter-medium/chromedriver-binary
171
193
  changelog_uri: https://github.com/dieter-medium/chromedriver-binary/blob/master/CHANGELOG.md
172
194
  rubygems_mfa_required: 'true'
173
- post_install_message:
174
195
  rdoc_options: []
175
196
  require_paths:
176
197
  - lib
@@ -185,8 +206,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
185
206
  - !ruby/object:Gem::Version
186
207
  version: '0'
187
208
  requirements: []
188
- rubygems_version: 3.5.11
189
- signing_key:
209
+ rubygems_version: 3.6.9
190
210
  specification_version: 4
191
211
  summary: Automatically downloads and installs ChromeDriver binaries.
192
212
  test_files: []