Skip to content

Commit

Permalink
Fix-1038: Update for ruby 3.2
Browse files Browse the repository at this point in the history
  • Loading branch information
dburgess560 committed Nov 18, 2024
1 parent e0a1a15 commit d460eda
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 12 deletions.
3 changes: 3 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
## 2.3.0 (11/18/2024)
* Update to support [Ruby 3.2 removals](https://rubyreferences.github.io/rubychanges/3.2.html#removals)

## 2.2.0 (02/8/2023)
* Add check for call status to eotlite.py
* Update python default call to eotlitetool.py to python3
Expand Down
2 changes: 1 addition & 1 deletion lib/fontcustom/manifest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ class Manifest
def initialize(manifest, cli_options = {})
@manifest = manifest
@cli_options = symbolize_hash cli_options
if File.exists? @manifest
if File.exist? @manifest
reload
if ! @cli_options.empty? && get(:options) != @cli_options
set :options, @cli_options
Expand Down
16 changes: 8 additions & 8 deletions lib/fontcustom/options.rb
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,17 @@ def overwrite_examples
def set_config_path
@cli_options[:config] = if @cli_options[:config]
path = @cli_options[:config]
if File.exists?(path) && ! File.directory?(path)
if File.exist?(path) && ! File.directory?(path)
path
elsif File.exists? File.join(path, "fontcustom.yml")
elsif File.exist? File.join(path, "fontcustom.yml")
File.join path, "fontcustom.yml"
else
raise Fontcustom::Error, "No configuration file found at `#{path}`."
end
else
if File.exists? "fontcustom.yml"
if File.exist? "fontcustom.yml"
"fontcustom.yml"
elsif File.exists? File.join("config", "fontcustom.yml")
elsif File.exist? File.join("config", "fontcustom.yml")
File.join "config", "fontcustom.yml"
else
false
Expand Down Expand Up @@ -134,7 +134,7 @@ def set_output_paths

@options[:output].each do |key, val|
@options[:output][key] = val
if File.exists?(val) && ! File.directory?(val)
if File.exist?(val) && ! File.directory?(val)
raise Fontcustom::Error,
"Output `#{@options[:output][key]}` exists but isn't a directory. Check your options."
end
Expand All @@ -145,7 +145,7 @@ def set_output_paths
else
if @options[:output].is_a? String
output = @options[:output]
if File.exists?(output) && ! File.directory?(output)
if File.exist?(output) && ! File.directory?(output)
raise Fontcustom::Error,
"Output `#{output}` exists but isn't a directory. Check your options."
end
Expand All @@ -170,15 +170,15 @@ def check_template_paths
else
path = File.expand_path File.join(@options[:input][:templates], template)
end
unless File.exists? path
unless File.exist? path
raise Fontcustom::Error,
"Custom template `#{template}` wasn't found in `#{@options[:input][:templates]}/`. Check your options."
end
end
end

def check_input(dir)
if ! File.exists? dir
if ! File.exist? dir
raise Fontcustom::Error,
"Input `#{dir}` doesn't exist. Check your options."
elsif ! File.directory? dir
Expand Down
2 changes: 1 addition & 1 deletion spec/fontcustom/cli_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@

expect(Dir.glob(File.join(testdir, "fontcustom", "fontcustom_*\.{ttf,svg,woff,eot}")).length).to eq(4)
expect(File.read(manifest)).to match(/"fonts":.+fontcustom\/fontcustom_.+\.ttf"/m)
expect(File.exists?(preview)).to be_truthy
expect(File.exist?(preview)).to be_truthy
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/fontcustom/watcher_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ def watcher(options)
ensure
w.send :stop
new = fixture("shared/vectors/test.svg")
FileUtils.rm(new) if File.exists?(new)
FileUtils.rm(new) if File.exist?(new)
end
end
end
Expand Down Expand Up @@ -113,7 +113,7 @@ def watcher(options)
ensure
w.send :stop
new = fixture("shared/vectors/non-vector-file")
FileUtils.rm(new) if File.exists?(new)
FileUtils.rm(new) if File.exist?(new)
end
end
end
Expand Down

0 comments on commit d460eda

Please sign in to comment.