Skip to content

Commit

Permalink
remove the Coveralls gem (too old) + fix the tests/code for Ruby 3.2.x
Browse files Browse the repository at this point in the history
  • Loading branch information
did committed Jun 25, 2024
1 parent aeade67 commit eae314f
Show file tree
Hide file tree
Showing 8 changed files with 14 additions and 33 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,5 +32,5 @@ group :test do

gem 'rack-test', '~> 2.1.0'

gem 'coveralls', '~> 0.8.23', require: false
gem 'simplecov', '~> 0.22.0', require: false
end
23 changes: 6 additions & 17 deletions Gemfile.lock
Original file line number Diff line number Diff line change
Expand Up @@ -50,12 +50,6 @@ GEM
colorize (1.1.0)
concurrent-ruby (1.2.3)
connection_pool (2.4.1)
coveralls (0.8.23)
json (>= 1.8, < 3)
simplecov (~> 0.16.1)
term-ansicolor (~> 1.3)
thor (>= 0.19.4, < 2.0)
tins (~> 1.6)
crass (1.0.6)
date (3.3.4)
diff-lcs (1.5.1)
Expand All @@ -81,7 +75,6 @@ GEM
iso
iso (0.4.0)
i18n
json (2.7.1)
json_spec (1.1.5)
multi_json (~> 1.0)
rspec (>= 2.0, < 4.0)
Expand Down Expand Up @@ -165,23 +158,19 @@ GEM
sanitize (6.0.2)
crass (~> 1.0.2)
nokogiri (>= 1.12.0)
simplecov (0.16.1)
simplecov (0.22.0)
docile (~> 1.1)
json (>= 1.8, < 3)
simplecov-html (~> 0.10.0)
simplecov-html (0.10.2)
simplecov-html (~> 0.11)
simplecov_json_formatter (~> 0.1)
simplecov-html (0.12.3)
simplecov_json_formatter (0.1.4)
stackprof (0.2.26)
stringex (2.8.6)
sync (0.5.0)
temple (0.10.3)
term-ansicolor (1.7.2)
tins (~> 1.0)
thor (1.3.1)
tilt (2.3.0)
timecop (0.9.8)
timeout (0.4.1)
tins (1.32.1)
sync
tzinfo (2.0.6)
concurrent-ruby (~> 1.0)

Expand All @@ -190,7 +179,6 @@ PLATFORMS
x86_64-darwin-22

DEPENDENCIES
coveralls (~> 0.8.23)
flamegraph
haml (~> 6.2.3)
i18n-spec (~> 0.6.0)
Expand All @@ -205,6 +193,7 @@ DEPENDENCIES
rack-test (~> 2.1.0)
rake
rspec (~> 3.12.0)
simplecov (~> 0.22.0)
stackprof
timecop (~> 0.9.1)

Expand Down
4 changes: 2 additions & 2 deletions lib/locomotive/steam/adapters/filesystem/yaml_loader.rb
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ def load(scope = nil)
end

def _load(path, frontmatter = false, strict = false, &block)
if File.exists?(path)
if File.exist?(path)
yaml = File.open(path).read.force_encoding('utf-8')
template = nil

Expand Down Expand Up @@ -72,7 +72,7 @@ def safe_json_load(json, template, path, &block)
end

def safe_json_file_load(path)
return {} unless File.exists?(path)
return {} unless File.exist?(path)

json = File.read(path)

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ def file_size(path)

_path = File.join(site_path, 'public', path)

File.exists?(_path) ? File.size(_path) : nil
File.exist?(_path) ? File.size(_path) : nil
end

def modify_for_associations(attributes)
Expand Down Expand Up @@ -114,7 +114,7 @@ def path

path = File.join(site_path, 'data', env.to_s, 'content_entries')

@path = File.exists?(path) ? path : File.join(site_path, 'data') # allow the legacy folder
@path = File.exist?(path) ? path : File.join(site_path, 'data') # allow the legacy folder
end

def content_type
Expand Down
2 changes: 1 addition & 1 deletion lib/locomotive/steam/initializers/dragonfly.rb
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def find_imagemagick_commands
convert = ENV['IMAGE_MAGICK_CONVERT'] || `which convert`.strip.presence || '/usr/local/bin/convert'
identify = ENV['IMAGE_MAGICK_IDENTIFY'] || `which identify`.strip.presence || '/usr/local/bin/identify'

if File.exists?(convert)
if File.exist?(convert)
{ convert_command: convert, identify_command: identify }
else
missing_image_magick
Expand Down
2 changes: 1 addition & 1 deletion lib/locomotive/steam/liquid/tags/concerns/path.rb
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ def render_path(context, &block)
handle = @context[@handle] || @handle

# is external url?
if handle =~ Locomotive::Steam::IsHTTP
if handle.is_a?(String) && handle =~ Locomotive::Steam::IsHTTP
handle
elsif page = self.retrieve_page_drop_from_handle(handle) # return a drop or model?
# make sure we've got the page/content entry (if templatized)
Expand Down
8 changes: 0 additions & 8 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
@@ -1,12 +1,4 @@
# require 'simplecov'
# require 'codeclimate-test-reporter'
# require 'coveralls'
# require 'simplecov'
# require 'coveralls'

require 'simplecov'
require 'coveralls'


SimpleCov.start do
# formatter SimpleCov::Formatter::MultiFormatter.new([
Expand Down
2 changes: 1 addition & 1 deletion spec/unit/initializers/dragonfly_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@

before do
::Dragonfly::App.destroy_apps
expect(File).to receive(:exists?).and_return(false)
expect(File).to receive(:exist?).and_return(false)
initializer.run
end
it { is_expected.to eq nil }
Expand Down

0 comments on commit eae314f

Please sign in to comment.