Skip to content

Commit

Permalink
Replace __FILE__ with __dir__ and other minor chefstyle fixes
Browse files Browse the repository at this point in the history
A few new chefstyle rules to improve readability here.

Signed-off-by: Tim Smith <[email protected]>
  • Loading branch information
tas50 committed Sep 9, 2020
1 parent 4a28820 commit 979a46f
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ group :docs do
end

group :test do
gem "activesupport", "< 6" # this dep can be removed when we drop Ruby 2.4 support
gem "chefstyle"
gem "cucumber", "< 5" # remove the version pin when we drop Ruby 2.4 support
gem "activesupport", "< 6" # this dep can be removed when we drop Ruby 2.4 support
gem "rake"
gem "rspec", "~> 3.7"
end
Expand Down
2 changes: 1 addition & 1 deletion lib/mixlib/log.rb
Original file line number Diff line number Diff line change
Expand Up @@ -118,7 +118,7 @@ def level(new_level = nil)
if new_level.nil?
LEVEL_NAMES[logger.level]
else
self.level = (new_level)
self.level = new_level
end
end

Expand Down
2 changes: 1 addition & 1 deletion mixlib-log.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$:.unshift File.expand_path("../lib", __FILE__)
$:.unshift File.expand_path("lib", __dir__)
require "mixlib/log/version"

Gem::Specification.new do |gem|
Expand Down
2 changes: 1 addition & 1 deletion spec/mixlib/log/formatter_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
#

require "time" unless defined?(Time.zone_offset)
require File.expand_path(File.join(File.dirname(__FILE__), "..", "..", "spec_helper"))
require File.expand_path(File.join(__dir__, "..", "..", "spec_helper"))

RSpec.describe Mixlib::Log::Formatter do
before(:each) do
Expand Down
2 changes: 1 addition & 1 deletion spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@
#

$TESTING = true
$:.push File.join(File.dirname(__FILE__), "..", "lib")
$:.push File.join(__dir__, "..", "lib")

require "rspec"
require "mixlib/log"
Expand Down

0 comments on commit 979a46f

Please sign in to comment.