Skip to content

Commit

Permalink
fix: File.exists? to 3.3.0
Browse files Browse the repository at this point in the history
  • Loading branch information
djosino committed Mar 8, 2024
1 parent 3302216 commit f8679dc
Show file tree
Hide file tree
Showing 9 changed files with 20 additions and 20 deletions.
2 changes: 1 addition & 1 deletion lib/pki_express/authentication.rb
Original file line number Diff line number Diff line change
Expand Up @@ -152,7 +152,7 @@ def _set_certificate_path(path)
unless path
raise 'The provided "certificate_path" is not valid'
end
if File.exists?(path)
if File.exist?(path)
raise 'The provided "certificate_path" does not exist'
end

Expand Down
4 changes: 2 additions & 2 deletions lib/pki_express/cades_signature_starter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _set_file_to_sign_path(path)
unless path
raise 'The provided "file_to_sign_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "file_to_sign_path" does not exist'
end

Expand Down Expand Up @@ -185,7 +185,7 @@ def _set_data_file_path(path)
unless path
raise 'The provided "data_file_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "data_file_path" does not exist'
end

Expand Down
4 changes: 2 additions & 2 deletions lib/pki_express/pades_signature_starter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ def _set_pdf_to_sign_path(path)
unless path
raise 'The provided "pdf_to_sign_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "pdf_to_sign_path" does not exist'
end
@pdf_to_sign_path = path
Expand Down Expand Up @@ -152,7 +152,7 @@ def _set_visual_representation_path(path)
unless path
raise 'The provided "visual_representation_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "visual_representation_path" does not exist'
end
@vr_json_path = path
Expand Down
4 changes: 2 additions & 2 deletions lib/pki_express/pades_signer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ def _set_visual_representation_path(path)
unless path
raise 'The provided "visual_representation_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "visual_representation_path" does not exist'
end
@vr_json_path = path
Expand Down Expand Up @@ -185,7 +185,7 @@ def _set_pdf_to_sign_path(path)
unless path
raise 'The provided "pdf_to_sign_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "pdf_to_sign_path" does not exist'
end
@pdf_to_sign_path = path
Expand Down
16 changes: 8 additions & 8 deletions lib/pki_express/pki_express_operator.rb
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def add_file_reference(key, reference_path)
raise ArgumentError.new('The provided reference path is not valid')
end

unless File.exists?(reference_path)
unless File.exist?(reference_path)
raise ArgumentError.new('The provided reference file was not found')
end

Expand All @@ -55,7 +55,7 @@ def add_trusted_root(root_path)
raise ArgumentError.new('The provided trusted root path is not valid')
end

unless File.exists?(root_path)
unless File.exist?(root_path)
raise ArgumentError.new("The provided trusted root path doesn't exist: #{root_path}")
end

Expand Down Expand Up @@ -181,22 +181,22 @@ def get_pki_express_invocation
if not home.nil?

if system == :linux
unless File.exists?(File.expand_path('pkie.dll', home))
unless File.exist?(File.expand_path('pkie.dll', home))
raise InstallationNotFoundError.new("The file pkie.dll could not be found on directory #{home}")
end
elsif not File.exists?(File.expand_path('pkie.exe', home))
elsif not File.exist?(File.expand_path('pkie.exe', home))
raise InstallationNotFoundError.new("The file pkie.exe could not be found on directory #{home}")
end

elsif system == :win

if File.exists?(File.join(ENV['ProgramW6432'], 'Lacuna Software', 'PKI Express', 'pkie.exe'))
if File.exist?(File.join(ENV['ProgramW6432'], 'Lacuna Software', 'PKI Express', 'pkie.exe'))
home = File.join(ENV['ProgramW6432'], 'Lacuna Software', 'PKI Express')
elsif File.exists?(File.join(ENV['ProgramFiles(x86)'], 'Lacuna Software', 'PKI Express', 'pkie.exe'))
elsif File.exist?(File.join(ENV['ProgramFiles(x86)'], 'Lacuna Software', 'PKI Express', 'pkie.exe'))
home = File.join(ENV['ProgramFiles(x86)'], 'Lacuna Software', 'PKI Express')
elsif File.exists?(File.join(ENV['LOCALAPPDATA'], 'Lacuna Software', 'PKI Express', 'pkie.exe'))
elsif File.exist?(File.join(ENV['LOCALAPPDATA'], 'Lacuna Software', 'PKI Express', 'pkie.exe'))
home = File.join(ENV['LOCALAPPDATA'], 'Lacuna Software', 'PKI Express')
elsif File.exists?(File.join(ENV['LOCALAPPDATA'], 'Lacuna Software (x86)', 'PKI Express', 'pkie.exe'))
elsif File.exist?(File.join(ENV['LOCALAPPDATA'], 'Lacuna Software (x86)', 'PKI Express', 'pkie.exe'))
home = File.join(ENV['LOCALAPPDATA'], 'Lacuna Software (x86)', 'PKI Express')
end

Expand Down
2 changes: 1 addition & 1 deletion lib/pki_express/signature_explorer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ def _set_signature_file_path(path)
unless path
raise 'The provided "signature_file_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "signature_file_path" does not exist'
end
@signature_file_path = path
Expand Down
4 changes: 2 additions & 2 deletions lib/pki_express/signature_finisher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ def _set_file_to_sign_path(path)
unless path
raise 'The provided "file_to_sign_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "file_to_sign_path" does not exist'
end

Expand Down Expand Up @@ -185,7 +185,7 @@ def _set_data_file_path(path)
unless path
raise 'The provided "data_file_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "data_file_path" does not exist'
end

Expand Down
2 changes: 1 addition & 1 deletion lib/pki_express/signature_starter.rb
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ def _set_certificate_path(path)
unless path
raise 'The provided "certificate_path" is not valid'
end
unless File.exists?(path)
unless File.exist?(path)
raise 'The provided "certificate_path" does not exist'
end

Expand Down
2 changes: 1 addition & 1 deletion lib/pki_express/signer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ def _set_pkcs12_path(pkcs12_path)
unless pkcs12_path
raise 'The provided "pkcs12_path" is not valid'
end
unless File.exists?(pkcs12_path)
unless File.exist?(pkcs12_path)
raise 'The provided "pkcs12_path" does not exist'
end

Expand Down

0 comments on commit f8679dc

Please sign in to comment.