Skip to content

Commit 1170e7e

Browse files
Merge pull request #93 from henrycatalinismith/ruby-3.2.0
Ruby 3.2.0 compatibility
2 parents fb489b1 + 16d89a6 commit 1170e7e

File tree

10 files changed

+18
-14
lines changed

10 files changed

+18
-14
lines changed

.github/workflows/build.yml

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ jobs:
1919

2020
- uses: ruby/setup-ruby@v1
2121
with:
22-
ruby-version: 3.0.0
22+
ruby-version: 3.2.0
2323

2424
- uses: jwlawson/[email protected]
2525
with:

.ruby-version

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
3.2.2

Rakefile

+2-2
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ end
99
task :disable_config do
1010
pplconfig = File.expand_path("~/.pplconfig")
1111
bkpconfig = File.expand_path("~/.pplconfig.bkp")
12-
if File.exists? pplconfig
12+
if File.exist? pplconfig
1313
FileUtils.mv pplconfig, bkpconfig
1414
end
1515
at_exit { Rake::Task["enable_config"].invoke }
@@ -18,7 +18,7 @@ end
1818
task :enable_config do
1919
pplconfig = File.expand_path("~/.pplconfig")
2020
bkpconfig = File.expand_path("~/.pplconfig.bkp")
21-
if File.exists? bkpconfig
21+
if File.exist? bkpconfig
2222
FileUtils.mv bkpconfig, pplconfig
2323
end
2424
end

lib/ppl/adapter/storage/disk.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ class Ppl::Adapter::Storage::Disk < Ppl::Adapter::Storage
66
attr_accessor :vcard_adapter
77

88
def self.create_address_book(path)
9-
if !Dir.exists? path
9+
if !Dir.exist? path
1010
FileUtils.mkdir_p(path)
1111
end
1212
storage = self.new(Dir.new(path))
@@ -41,7 +41,7 @@ def load_address_book
4141
def load_contact(id)
4242
filename = filename_for_contact_id(id)
4343
contact = nil
44-
if File.exists?(filename)
44+
if File.exist?(filename)
4545
vcard = File.read filename
4646
contact = @vcard_adapter.decode(vcard)
4747
if !contact.nil? && contact.is_a?(Ppl::Entity::Contact)

lib/ppl/adapter/storage/factory.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ def load_adapter(directory)
1212

1313
adapter = disk_adapter
1414

15-
if File.exists?(git_dir)
15+
if File.exist?(git_dir)
1616
git_adapter = Ppl::Adapter::Storage::Git.new(disk_adapter)
1717
git_adapter.vcard_adapter = @vcard_adapter
1818
adapter = git_adapter

lib/ppl/application/configuration.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -64,9 +64,9 @@ def user_configuration
6464
end
6565
filename = File.expand_path(USER_CONFIG)
6666
@user_config = {}
67-
if File.exists?(filename)
67+
if File.exist?(filename)
6868
@user_config = IniFile::load(filename).to_h
69-
elsif File.exists?(xdg_path)
69+
elsif File.exist?(xdg_path)
7070
@user_config = IniFile::load(xdg_path).to_h
7171
end
7272
return @user_config

lib/ppl/command/completion.rb

+1-1
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ def require_shell_name(input)
2626

2727
def require_completion_existence(shell_name)
2828
path = File.join(@completions_directory.path, shell_name)
29-
if !File.exists? path
29+
if !File.exist? path
3030
raise Ppl::Error::CompletionNotFound, shell_name
3131
end
3232
path

ppl.gemspec

+4-1
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,11 @@ Gem::Specification.new do |spec|
1717
spec.add_dependency("colored", "1.2")
1818
spec.add_dependency("inifile", "3.0.0")
1919
spec.add_dependency("mail", "2.7.1")
20+
spec.add_dependency("net-imap", "0.4.14")
21+
spec.add_dependency("net-pop", "0.1.2")
22+
spec.add_dependency("net-smtp", "0.5.0")
2023
spec.add_dependency("morphine", "0.1.1")
21-
spec.add_dependency("rugged", "1.1.0")
24+
spec.add_dependency("rugged", "1.7.2")
2225
spec.add_dependency("vpim", "13.11.11")
2326

2427
spec.add_development_dependency("cucumber")

spec/ppl/adapter/storage/disk_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
describe "#create_address_book" do
1212
it "should create the directory if it doesn't exist yet" do
1313
Ppl::Adapter::Storage::Disk.create_address_book("/contacts")
14-
expect(Dir.exists?("/contacts")).to eq true
14+
expect(Dir.exist?("/contacts")).to eq true
1515
FileUtils.rm_rf("/contacts")
1616
end
1717
it "should return a Ppl::Adapter::Storage::Disk" do
@@ -130,7 +130,7 @@
130130
FileUtils.touch "/contacts/test.vcf"
131131
@contact.id = "test"
132132
@storage.delete_contact(@contact)
133-
expect(File.exists?("/contacts/test.vcf")).to eq false
133+
expect(File.exist?("/contacts/test.vcf")).to eq false
134134
end
135135
end
136136

spec/ppl/command/completion_spec.rb

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818

1919
before(:each) do
2020
allow(@directory).to receive(:path).and_return("")
21-
allow(File).to receive(:exists?).and_return(true)
21+
allow(File).to receive(:exist?).and_return(true)
2222
allow(File).to receive(:read)
2323
end
2424

@@ -29,7 +29,7 @@
2929

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

0 commit comments

Comments
 (0)