ffmpeg_core 0.4.0 → 0.4.1

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: afead7a6fce7f95748207153b521b35a223f2efd7add35664e12ba3e27f86b23
4
- data.tar.gz: 3052072fb4a3541518cc5d12bf333b58b77a77f2b3b4deec44d51b89ddbac678
3
+ metadata.gz: a3a1322c33ef390363223c0f3a307f269e84ed3484d2491e2d7340111d33d7a6
4
+ data.tar.gz: d98fcf0cf9881e837783cda58d1d43784c87310db8e22468e5b0623c9a8d6716
5
5
  SHA512:
6
- metadata.gz: d725d25a1d211186ede000ac81d58f20c57fc8f46ba5a3897b006a8e92e128b37f5f9cfb9295633bfe0a7dd878a0f99793329c388c1c2a920bc585256b4740db
7
- data.tar.gz: 5e683ec8fb39dc1e669abaeaa8e3f7254de8f92ef4593ed6869ba7a5a4c02dab2d6ee8005243dbf31e24be27b11a689c89de736c0eca69e93be38b7d9e5fc531
6
+ metadata.gz: 5e50f4fb86e61b7d7e858ed90a047f37fa92d7ec9c9216cf8238b7aaf7f48b7c78aa237c36a8c154e864976e8b65c0ac78a93697c1047342df113037fed6f035
7
+ data.tar.gz: 621b5d98bd486b260a4c208c091f18113484d29df66cb005f8e005204dedd324fc5d737e22d662bbf2dbda788f8cdba002a5a313ba18abcc28d926c948c2cf11
data/CHANGELOG.md CHANGED
@@ -5,6 +5,17 @@ All notable changes to this project will be documented in this file.
5
5
  The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.1.0/),
6
6
  and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
7
7
 
8
+ ## [0.4.1] - 2026-04-09
9
+
10
+ ### Fixed
11
+
12
+ - Binary detection on Windows: `where` fallback now correctly resolves ffmpeg/ffprobe when not on PATH
13
+
14
+ ### Changed
15
+
16
+ - Simplified binary detection: removed redundant Ruby PATH scan, extracted lookup steps into focused private methods
17
+ - Expanded `Configuration` spec: ENV override, `BinaryNotFoundError`, known-path fallback, `reset_configuration!`
18
+
8
19
  ## [0.4.0] - 2026-01-26
9
20
 
10
21
  ### Added
@@ -40,23 +40,54 @@ module FFmpegCore
40
40
  end
41
41
 
42
42
  def detect_binary(name)
43
- # Check common locations
44
- paths = ENV["PATH"].split(File::PATH_SEPARATOR)
45
- paths.each do |path|
46
- binary = File.join(path, name)
47
- return binary if File.executable?(binary)
48
- end
43
+ binary_from_env(name) ||
44
+ binary_from_system_lookup(name) ||
45
+ binary_from_known_paths(name) ||
46
+ raise(BinaryNotFoundError, <<~MSG)
47
+ #{name} not found.
48
+ Install FFmpeg and ensure it's in PATH.
49
+ macOS: brew install ffmpeg
50
+ Linux: apt install ffmpeg / yum install ffmpeg
51
+ Windows: choco install ffmpeg or scoop install ffmpeg
52
+ MSG
53
+ end
49
54
 
50
- # Homebrew locations (macOS)
51
- homebrew_paths = [
52
- "/opt/homebrew/bin/#{name}", # Apple Silicon
53
- "/usr/local/bin/#{name}" # Intel
54
- ]
55
- homebrew_paths.each do |path|
56
- return path if File.executable?(path)
57
- end
55
+ # Checks FFMPEGCORE_<NAME> env variable for an explicit binary override.
56
+ def binary_from_env(name)
57
+ path = ENV["FFMPEGCORE_#{name.upcase}"]
58
+ path if path && File.executable?(path)
59
+ end
60
+
61
+ # Uses the OS-native `which` (Unix) or `where` (Windows) command.
62
+ def binary_from_system_lookup(name)
63
+ cmd = Gem.win_platform? ? "where #{name}" : "which #{name}"
64
+ stdout, status = Open3.capture2(cmd)
65
+ return unless status.success?
58
66
 
59
- raise BinaryNotFoundError, "#{name} binary not found. Please install FFmpeg: brew install ffmpeg"
67
+ path = stdout.lines.first&.strip
68
+ path if path && File.executable?(path)
69
+ end
70
+
71
+ # Falls back to a list of well-known installation paths.
72
+ def binary_from_known_paths(name)
73
+ known_paths(name).find { |p| File.executable?(p) }
74
+ end
75
+
76
+ def known_paths(name)
77
+ if Gem.win_platform?
78
+ [
79
+ "C:/ffmpeg/bin/#{name}.exe",
80
+ "C:/ProgramData/chocolatey/bin/#{name}.exe",
81
+ "#{ENV["USERPROFILE"]}/scoop/apps/ffmpeg/current/bin/#{name}.exe"
82
+ ]
83
+ else
84
+ [
85
+ "/opt/homebrew/bin/#{name}", # macOS ARM
86
+ "/usr/local/bin/#{name}", # macOS Intel / Linux
87
+ "/usr/bin/#{name}",
88
+ "/snap/bin/#{name}"
89
+ ]
90
+ end
60
91
  end
61
92
  end
62
93
 
@@ -1,5 +1,5 @@
1
1
  # frozen_string_literal: true
2
2
 
3
3
  module FFmpegCore
4
- VERSION = "0.4.0"
4
+ VERSION = "0.4.1"
5
5
  end
metadata CHANGED
@@ -1,14 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ffmpeg_core
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.4.0
4
+ version: 0.4.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Alexey Poimtsev
8
8
  bindir: exe
9
9
  cert_chain: []
10
10
  date: 1980-01-02 00:00:00.000000000 Z
11
- dependencies: []
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: simplecov
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - ">="
17
+ - !ruby/object:Gem::Version
18
+ version: '0'
19
+ type: :development
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - ">="
24
+ - !ruby/object:Gem::Version
25
+ version: '0'
12
26
  description: A clean, well-tested FFmpeg wrapper with modern Ruby conventions, proper
13
27
  error handling, and zero dependencies.
14
28
  email:
@@ -53,7 +67,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
53
67
  - !ruby/object:Gem::Version
54
68
  version: '0'
55
69
  requirements: []
56
- rubygems_version: 4.0.4
70
+ rubygems_version: 4.0.6
57
71
  specification_version: 4
58
72
  summary: Modern Ruby wrapper for FFmpeg
59
73
  test_files: []