Skip to content

Commit

Permalink
Autocorrect all rubocop offenses
Browse files Browse the repository at this point in the history
  • Loading branch information
jcouball committed May 29, 2024
1 parent c151f47 commit aa171ea
Show file tree
Hide file tree
Showing 8 changed files with 39 additions and 38 deletions.
2 changes: 1 addition & 1 deletion Gemfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

source "https://rubygems.org"
source 'https://rubygems.org'

# Specify your gem's dependencies in command_line_boss.gemspec
gemspec
8 changes: 4 additions & 4 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,11 @@ require 'bundler'
require 'bundler/gem_tasks'

begin
Bundler.setup(:default, :development)
Bundler.setup(:default, :development)
rescue Bundler::BundlerError => e
warn e.message
warn 'Run `bundle install` to install missing gems'
exit e.status_code
warn e.message
warn 'Run `bundle install` to install missing gems'
exit e.status_code
end

CLEAN << 'pkg'
Expand Down
6 changes: 3 additions & 3 deletions bin/console
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
#!/usr/bin/env ruby
# frozen_string_literal: true

require "bundler/setup"
require "command_line_boss"
require 'bundler/setup'
require 'command_line_boss'

# You can add fixtures and/or initialization code here to make experimenting
# with your gem easier. You can also use a different console, if you like.

require "irb"
require 'irb'
IRB.start(__FILE__)
37 changes: 19 additions & 18 deletions command_line_boss.gemspec
Original file line number Diff line number Diff line change
@@ -1,28 +1,28 @@
# frozen_string_literal: true

require_relative "lib/command_line_boss/version"
require_relative 'lib/command_line_boss/version'

Gem::Specification.new do |spec|
spec.name = "command_line_boss"
spec.name = 'command_line_boss'
spec.version = CommandLineBoss::VERSION
spec.authors = ["James Couball"]
spec.email = ["[email protected]"]
spec.authors = ['James Couball']
spec.email = ['[email protected]']

spec.summary = "Command Line Boss is a convenience layer over OptionsParser"
spec.summary = 'Command Line Boss is a convenience layer over OptionsParser'
spec.description = <<~DESCRIPTION
Command Line Boss is a convenience layer over OptionsParser. It provides a simple
way to define command line options and arguments, and then parse them into an options
object.
DESCRIPTION
spec.license = "MIT"
spec.required_ruby_version = ">= 3.1.0"
spec.license = 'MIT'
spec.required_ruby_version = '>= 3.1.0'

spec.metadata["allowed_push_host"] = "https://rubygems.org"
spec.metadata['allowed_push_host'] = 'https://rubygems.org'

spec.homepage = "https://github.com/main-branch/command_line_boss"
spec.homepage = 'https://github.com/main-branch/command_line_boss'

spec.metadata["homepage_uri"] = spec.homepage
spec.metadata["source_code_uri"] = "https://github.com/main-branch/command_line_boss"
spec.metadata['homepage_uri'] = spec.homepage
spec.metadata['source_code_uri'] = 'https://github.com/main-branch/command_line_boss'
spec.metadata['changelog_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}/file/CHANGELOG.md"
spec.metadata['documentation_uri'] = "https://rubydoc.info/gems/#{spec.name}/#{spec.version}"

Expand All @@ -35,21 +35,22 @@ Gem::Specification.new do |spec|
f.start_with?(*%w[bin/ test/ spec/ features/ .git .github appveyor Gemfile])
end
end
spec.bindir = "exe"
spec.bindir = 'exe'
spec.executables = spec.files.grep(%r{\Aexe/}) { |f| File.basename(f) }
spec.require_paths = ["lib"]
spec.require_paths = ['lib']

# Uncomment to register a new dependency of your gem
# spec.add_dependency "example-gem", "~> 1.0"

spec.add_development_dependency 'bundler-audit', '~> 0.9'
spec.add_development_dependency 'fuubar', '~> 2.5'
spec.add_development_dependency "rake", "~> 13.2"
spec.add_development_dependency "rspec", "~> 3.13"
spec.add_development_dependency "rubocop", "~> 1.64"
spec.add_development_dependency "simplecov", "~> 0.22"
spec.add_development_dependency "simplecov-lcov", "~> 0.8"
spec.add_development_dependency 'rake', '~> 13.2'
spec.add_development_dependency 'rspec', '~> 3.13'
spec.add_development_dependency 'rubocop', '~> 1.64'
spec.add_development_dependency 'simplecov', '~> 0.22'
spec.add_development_dependency 'simplecov-lcov', '~> 0.8'

# For more information and examples about making a new gem, check out our
# guide at: https://bundler.io/guides/creating_gem.html
spec.metadata['rubygems_mfa_required'] = 'true'
end
2 changes: 1 addition & 1 deletion lib/command_line_boss.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# frozen_string_literal: true

require_relative "command_line_boss/version"
require_relative 'command_line_boss/version'

module CommandLineBoss
class Error < StandardError; end
Expand Down
2 changes: 1 addition & 1 deletion lib/command_line_boss/version.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# frozen_string_literal: true

module CommandLineBoss
VERSION = "0.1.0"
VERSION = '0.1.0'
end
2 changes: 1 addition & 1 deletion spec/command_line_boss_spec.rb
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# frozen_string_literal: true

RSpec.describe CommandLineBoss do
it "has a version number" do
it 'has a version number' do
expect(CommandLineBoss::VERSION).not_to be nil
end
end
18 changes: 9 additions & 9 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

RSpec.configure do |config|
# Enable flags like --only-failures and --next-failure
config.example_status_persistence_file_path = ".rspec_status"
config.example_status_persistence_file_path = '.rspec_status'

# Disable RSpec exposing methods globally on `Module` and `main`
config.disable_monkey_patching!
Expand All @@ -14,9 +14,9 @@

# Setup simplecov

require "simplecov"
require "simplecov-lcov"
require "json"
require 'simplecov'
require 'simplecov-lcov'
require 'json'

SimpleCov.formatters = [SimpleCov::Formatter::HTMLFormatter, SimpleCov::Formatter::LcovFormatter]

Expand All @@ -29,7 +29,7 @@
# @return [Boolean]
#
def env_true?(name)
value = ENV.fetch(name, "").downcase
value = ENV.fetch(name, '').downcase
%w[yes on true 1].include?(value)
end

Expand All @@ -50,15 +50,15 @@ def env_false?(name)
# @return [Boolean]
#
def fail_on_low_coverage?
!(RSpec.configuration.dry_run? || env_true?("COV_NO_FAIL"))
!(RSpec.configuration.dry_run? || env_true?('COV_NO_FAIL'))
end

# Return `true` if the the test run should show the lines not covered by tests
#
# @return [Boolean]
#
def show_lines_not_covered?
env_true?("COV_SHOW_UNCOVERED")
env_true?('COV_SHOW_UNCOVERED')
end

# Report if the test coverage was below the configured threshold
Expand Down Expand Up @@ -99,7 +99,7 @@ def show_lines_not_covered?
# rubocop:disable Style/StderrPuts
if SimpleCov.result.covered_percent < test_coverage_threshold
$stderr.puts
$stderr.print "FAIL: " if fail_on_low_coverage?
$stderr.print 'FAIL: ' if fail_on_low_coverage?
$stderr.puts "RSpec Test coverage fell below #{test_coverage_threshold}%"

if show_lines_not_covered?
Expand All @@ -122,4 +122,4 @@ def show_lines_not_covered?

# Make sure to require your project AFTER SimpleCov.start
#
require "command_line_boss"
require 'command_line_boss'

0 comments on commit aa171ea

Please sign in to comment.