Skip to content

Commit

Permalink
Merge pull request #93 from henrycatalinismith/ruby-3.2.0
Browse files Browse the repository at this point in the history
Ruby 3.2.0 compatibility
  • Loading branch information
henrycatalinismith authored Aug 8, 2024
2 parents fb489b1 + 16d89a6 commit 1170e7e
Show file tree
Hide file tree
Showing 10 changed files with 18 additions and 14 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ jobs:

- uses: ruby/setup-ruby@v1
with:
ruby-version: 3.0.0
ruby-version: 3.2.0

- uses: jwlawson/actions-setup-cmake@v1.8
with:
Expand Down
1 change: 1 addition & 0 deletions .ruby-version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
3.2.2
4 changes: 2 additions & 2 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ end
task :disable_config do
pplconfig = File.expand_path("~/.pplconfig")
bkpconfig = File.expand_path("~/.pplconfig.bkp")
if File.exists? pplconfig
if File.exist? pplconfig
FileUtils.mv pplconfig, bkpconfig
end
at_exit { Rake::Task["enable_config"].invoke }
Expand All @@ -18,7 +18,7 @@ end
task :enable_config do
pplconfig = File.expand_path("~/.pplconfig")
bkpconfig = File.expand_path("~/.pplconfig.bkp")
if File.exists? bkpconfig
if File.exist? bkpconfig
FileUtils.mv bkpconfig, pplconfig
end
end
Expand Down
4 changes: 2 additions & 2 deletions lib/ppl/adapter/storage/disk.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ class Ppl::Adapter::Storage::Disk < Ppl::Adapter::Storage
attr_accessor :vcard_adapter

def self.create_address_book(path)
if !Dir.exists? path
if !Dir.exist? path
FileUtils.mkdir_p(path)
end
storage = self.new(Dir.new(path))
Expand Down Expand Up @@ -41,7 +41,7 @@ def load_address_book
def load_contact(id)
filename = filename_for_contact_id(id)
contact = nil
if File.exists?(filename)
if File.exist?(filename)
vcard = File.read filename
contact = @vcard_adapter.decode(vcard)
if !contact.nil? && contact.is_a?(Ppl::Entity::Contact)
Expand Down
2 changes: 1 addition & 1 deletion lib/ppl/adapter/storage/factory.rb
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ def load_adapter(directory)

adapter = disk_adapter

if File.exists?(git_dir)
if File.exist?(git_dir)
git_adapter = Ppl::Adapter::Storage::Git.new(disk_adapter)
git_adapter.vcard_adapter = @vcard_adapter
adapter = git_adapter
Expand Down
4 changes: 2 additions & 2 deletions lib/ppl/application/configuration.rb
Original file line number Diff line number Diff line change
Expand Up @@ -64,9 +64,9 @@ def user_configuration
end
filename = File.expand_path(USER_CONFIG)
@user_config = {}
if File.exists?(filename)
if File.exist?(filename)
@user_config = IniFile::load(filename).to_h
elsif File.exists?(xdg_path)
elsif File.exist?(xdg_path)
@user_config = IniFile::load(xdg_path).to_h
end
return @user_config
Expand Down
2 changes: 1 addition & 1 deletion lib/ppl/command/completion.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ def require_shell_name(input)

def require_completion_existence(shell_name)
path = File.join(@completions_directory.path, shell_name)
if !File.exists? path
if !File.exist? path
raise Ppl::Error::CompletionNotFound, shell_name
end
path
Expand Down
5 changes: 4 additions & 1 deletion ppl.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,11 @@ Gem::Specification.new do |spec|
spec.add_dependency("colored", "1.2")
spec.add_dependency("inifile", "3.0.0")
spec.add_dependency("mail", "2.7.1")
spec.add_dependency("net-imap", "0.4.14")
spec.add_dependency("net-pop", "0.1.2")
spec.add_dependency("net-smtp", "0.5.0")
spec.add_dependency("morphine", "0.1.1")
spec.add_dependency("rugged", "1.1.0")
spec.add_dependency("rugged", "1.7.2")
spec.add_dependency("vpim", "13.11.11")

spec.add_development_dependency("cucumber")
Expand Down
4 changes: 2 additions & 2 deletions spec/ppl/adapter/storage/disk_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
describe "#create_address_book" do
it "should create the directory if it doesn't exist yet" do
Ppl::Adapter::Storage::Disk.create_address_book("/contacts")
expect(Dir.exists?("/contacts")).to eq true
expect(Dir.exist?("/contacts")).to eq true
FileUtils.rm_rf("/contacts")
end
it "should return a Ppl::Adapter::Storage::Disk" do
Expand Down Expand Up @@ -130,7 +130,7 @@
FileUtils.touch "/contacts/test.vcf"
@contact.id = "test"
@storage.delete_contact(@contact)
expect(File.exists?("/contacts/test.vcf")).to eq false
expect(File.exist?("/contacts/test.vcf")).to eq false
end
end

Expand Down
4 changes: 2 additions & 2 deletions spec/ppl/command/completion_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

before(:each) do
allow(@directory).to receive(:path).and_return("")
allow(File).to receive(:exists?).and_return(true)
allow(File).to receive(:exist?).and_return(true)
allow(File).to receive(:read)
end

Expand All @@ -29,7 +29,7 @@

it "should raise an error if the shell is not recognised" do
@input.arguments = ["invalidshell"]
expect(File).to receive(:exists?).with("/invalidshell").and_return(false)
expect(File).to receive(:exist?).with("/invalidshell").and_return(false)
expect{@command.execute(@input, @output)}.to raise_error(Ppl::Error::CompletionNotFound)
end

Expand Down

0 comments on commit 1170e7e

Please sign in to comment.