Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Replace __FILE__ with __dir__ and other minor chefstyle fixes #61

Merged
merged 3 commits into from
Sep 9, 2020
Merged
Show file tree
Hide file tree
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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"))
tas50 marked this conversation as resolved.
Show resolved Hide resolved

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")
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lib/ is automatically added to the load path in rspec so this is likely unnecessary.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@phiggins can you make that a suggestion?

tas50 marked this conversation as resolved.
Show resolved Hide resolved

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