Skip to content

Commit

Permalink
Merge pull request #1 from nicolaa/spike
Browse files Browse the repository at this point in the history
Support for Ruby 3.2
  • Loading branch information
nicolaa authored Jan 13, 2023
2 parents d3892cc + f9e78b5 commit 269213b
Show file tree
Hide file tree
Showing 10 changed files with 10 additions and 9 deletions.
1 change: 1 addition & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ rvm:
- 2.4.9
- 2.5.8
- 2.6.6
- 3.2.0
gemfile:
- Gemfile
script:
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/writers/append_json_writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ module Writers
class AppendJsonWriter < JsonWriter
def write
index_file = docs_dir.join("index.json")
if File.exists?(index_file) && (output = File.read(index_file)).length >= 2
if File.exist?(index_file) && (output = File.read(index_file)).length >= 2
existing_index_hash = JSON.parse(output)
end
File.open(index_file, "w+") do |f|
Expand Down
2 changes: 1 addition & 1 deletion lib/rspec_api_documentation/writers/writer.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ def self.write(index, configuration)
end

def self.clear_docs(docs_dir)
if File.exists?(docs_dir)
if File.exist?(docs_dir)
FileUtils.rm_rf(docs_dir, :secure => true)
end
FileUtils.mkdir_p(docs_dir)
Expand Down
2 changes: 1 addition & 1 deletion spec/api_documentation_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
subject.clear_docs

expect(File.directory?(configuration.docs_dir)).to be_truthy
expect(File.exists?(test_file)).to be_falsey
expect(File.exist?(test_file)).to be_falsey
end
end

Expand Down
2 changes: 1 addition & 1 deletion spec/writers/html_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.html")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/json_iodocs_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
it "should write the index" do
writer.write
index_file = File.join(configuration.docs_dir, "apiconfig.json")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
2 changes: 1 addition & 1 deletion spec/writers/json_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@
it "should write the index" do
writer.write
index_file = File.join(configuration.docs_dir, "index.json")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
2 changes: 1 addition & 1 deletion spec/writers/markdown_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.md")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/slate_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.html.md")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down
2 changes: 1 addition & 1 deletion spec/writers/textile_writer_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@

writer.write
index_file = File.join(configuration.docs_dir, "index.textile")
expect(File.exists?(index_file)).to be_truthy
expect(File.exist?(index_file)).to be_truthy
end
end
end
Expand Down

0 comments on commit 269213b

Please sign in to comment.