Skip to content

Commit

Permalink
Style/ExpandPathArguments-20220907233817 (#780)
Browse files Browse the repository at this point in the history
* 🚓 regenerate rubocop todo

* 🚓 Style/ExpandPathArguments

* 🚓 regenerate rubocop todo

Co-authored-by: Rubocop Challenger <rubocop@payrollhero.com>
  • Loading branch information
github-actions[bot] and Rubocop Challenger authored Sep 17, 2022
1 parent fbf935e commit 79dca11
Show file tree
Hide file tree
Showing 14 changed files with 23 additions and 41 deletions.
24 changes: 3 additions & 21 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
# This configuration was generated by
# `rubocop --auto-gen-config`
# on 2022-09-05 23:37:11 UTC using RuboCop version 1.36.0.
# on 2022-09-07 23:38:49 UTC using RuboCop version 1.36.0.
# The point is for the user to remove these configuration records
# one by one as the offenses are removed from the code base.
# Note that changes in the inspected code, or installation of new
Expand All @@ -14,7 +14,7 @@ Gemspec/DeprecatedAttributeAssignment:
Exclude:
- 'apipie-rails.gemspec'

# Offense count: 4
# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: TreatCommentsAsGroupSeparators, ConsiderPunctuation, Include.
# Include: **/*.gemspec
Expand Down Expand Up @@ -1447,24 +1447,6 @@ Style/Encoding:
- 'lib/apipie/validator.rb'
- 'lib/tasks/apipie.rake'

# Offense count: 20
# This cop supports safe autocorrection (--autocorrect).
Style/ExpandPathArguments:
Exclude:
- 'apipie-rails.gemspec'
- 'lib/generators/apipie/install/install_generator.rb'
- 'lib/generators/apipie/views_generator.rb'
- 'lib/tasks/apipie.rake'
- 'spec/dummy/Rakefile'
- 'spec/dummy/components/test_engine/test_engine.gemspec'
- 'spec/dummy/config.ru'
- 'spec/dummy/config/application.rb'
- 'spec/dummy/config/boot.rb'
- 'spec/dummy/config/environment.rb'
- 'spec/dummy/script/rails'
- 'spec/lib/swagger/rake_swagger_spec.rb'
- 'spec/spec_helper.rb'

# Offense count: 1
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: AllowedVars.
Expand Down Expand Up @@ -1924,7 +1906,7 @@ Style/StringConcatenation:
- 'lib/apipie/extractor/writer.rb'
- 'lib/apipie/swagger_generator.rb'

# Offense count: 1314
# Offense count: 1301
# This cop supports safe autocorrection (--autocorrect).
# Configuration parameters: EnforcedStyle, ConsistentQuotesInMultiline.
# SupportedStyles: single_quotes, double_quotes
Expand Down
2 changes: 1 addition & 1 deletion apipie-rails.gemspec
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# -*- encoding: utf-8 -*-
$:.push File.expand_path("../lib", __FILE__)
$:.push File.expand_path('lib', __dir__)
require "apipie/version"

Gem::Specification.new do |s|
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/apipie/install/install_generator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Apipie
class InstallGenerator < ::Rails::Generators::Base
source_root File.expand_path("../templates", __FILE__)
source_root File.expand_path('templates', __dir__)

class_option(:route,
:aliases => "-r",
Expand Down
2 changes: 1 addition & 1 deletion lib/generators/apipie/views_generator.rb
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
module Apipie
class ViewsGenerator < ::Rails::Generators::Base
source_root File.expand_path("../../../../app/views", __FILE__)
source_root File.expand_path('../../../app/views', __dir__)
desc 'Copy Apipie views to your application'

def copy_views
Expand Down
4 changes: 2 additions & 2 deletions lib/tasks/apipie.rake
Original file line number Diff line number Diff line change
Expand Up @@ -166,10 +166,10 @@ namespace :apipie do
def renderer
return @apipie_renderer if @apipie_renderer

base_paths = [File.expand_path("../../../app/views/apipie/apipies", __FILE__)]
base_paths = [File.expand_path('../../app/views/apipie/apipies', __dir__)]
base_paths.unshift("#{Rails.root}/app/views/apipie/apipies") if File.directory?("#{Rails.root}/app/views/apipie/apipies")

layouts_paths = [File.expand_path("../../../app/views/layouts", __FILE__)]
layouts_paths = [File.expand_path('../../app/views/layouts', __dir__)]
layouts_paths.unshift("#{Rails.root}/app/views/layouts") if File.directory?("#{Rails.root}/app/views/layouts/apipie")

if ActionView::Base.respond_to?(:with_empty_template_cache) && ActionView::Base.respond_to?(:with_view_paths)
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/Rakefile
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# Add your own tasks in files placed in lib/tasks ending in .rake,
# for example lib/tasks/capistrano.rake, and they will automatically be available to Rake.

require File.expand_path('../config/application', __FILE__)
require File.expand_path('config/application', __dir__)
require 'rake'

Dummy::Application.load_tasks
2 changes: 1 addition & 1 deletion spec/dummy/components/test_engine/test_engine.gemspec
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
$:.push File.expand_path('../lib', __FILE__)
$:.push File.expand_path('lib', __dir__)

# Describe your gem and declare its dependencies:
Gem::Specification.new do |s|
Expand Down
2 changes: 1 addition & 1 deletion spec/dummy/config.ru
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# This file is used by Rack-based servers to start the application.

require ::File.expand_path('../config/environment', __FILE__)
require ::File.expand_path('config/environment', __dir__)
run Dummy::Application
2 changes: 1 addition & 1 deletion spec/dummy/config/application.rb
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
require File.expand_path('../boot', __FILE__)
require File.expand_path('boot', __dir__)

require "action_controller/railtie"
require "action_view/railtie"
Expand Down
4 changes: 2 additions & 2 deletions spec/dummy/config/boot.rb
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
require 'rubygems'
gemfile = File.expand_path('../../../../Gemfile', __FILE__)
gemfile = File.expand_path('../../../Gemfile', __dir__)

if File.exist?(gemfile)
ENV['BUNDLE_GEMFILE'] = gemfile
require 'bundler'
Bundler.setup
end

$:.unshift File.expand_path('../../../../lib', __FILE__)
$:.unshift File.expand_path('../../../lib', __dir__)
2 changes: 1 addition & 1 deletion spec/dummy/config/environment.rb
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# ENV['RAILS_RELATIVE_URL_ROOT'] = '/relative/path'

# Load the rails application
require File.expand_path('../application', __FILE__)
require File.expand_path('application', __dir__)

# Initialize the rails application
Dummy::Application.initialize!
4 changes: 2 additions & 2 deletions spec/dummy/script/rails
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
#!/usr/bin/env ruby
# This command will automatically be run when you run "rails" with Rails 3 gems installed from the root of your application.

APP_PATH = File.expand_path('../../config/application', __FILE__)
require File.expand_path('../../config/boot', __FILE__)
APP_PATH = File.expand_path('../config/application', __dir__)
require File.expand_path('../config/boot', __dir__)
require 'rails/commands'
6 changes: 3 additions & 3 deletions spec/lib/swagger/rake_swagger_spec.rb
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
require 'spec_helper'
require "json-schema"

require File.expand_path("../../../dummy/app/controllers/twitter_example_controller.rb", __FILE__)
require File.expand_path("../../../dummy/app/controllers/users_controller.rb", __FILE__)
require File.expand_path("../../../dummy/app/controllers/pets_controller.rb", __FILE__)
require File.expand_path('../../dummy/app/controllers/twitter_example_controller.rb', __dir__)
require File.expand_path('../../dummy/app/controllers/users_controller.rb', __dir__)
require File.expand_path('../../dummy/app/controllers/pets_controller.rb', __dir__)

describe 'rake tasks' do
include_context "rake"
Expand Down
6 changes: 3 additions & 3 deletions spec/spec_helper.rb
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,8 @@
SimpleCov.start

ENV["RAILS_ENV"] ||= 'test'
APIPIE_ROOT = File.expand_path('../..', __FILE__)
require File.expand_path("../dummy/config/environment", __FILE__)
APIPIE_ROOT = File.expand_path('..', __dir__)
require File.expand_path('dummy/config/environment', __dir__)

require 'rspec/rails'

Expand Down Expand Up @@ -55,7 +55,7 @@ def fail(msg)

# Requires supporting ruby files with custom matchers and macros, etc,
# in spec/support/ and its subdirectories.
Dir[File.expand_path("../support/**/*.rb", __FILE__)].each {|f| require f}
Dir[File.expand_path('support/**/*.rb', __dir__)].each {|f| require f}

RSpec.configure do |config|

Expand Down

0 comments on commit 79dca11

Please sign in to comment.