From 09485ff907ea25514c97475063ca846f13ea2cf9 Mon Sep 17 00:00:00 2001 From: Marc-Andre Lafortune Date: Fri, 15 May 2020 01:06:36 -0400 Subject: [PATCH] [Fix #7] Move node_pattern.rb, processed_source_spec.rb and rubocop/token_spec.rb into ast/ Done in two operations to facilitate git-blame --- lib/rubocop/ast.rb | 8 +++----- lib/rubocop/{ => ast}/node_pattern.rb | 0 lib/rubocop/{ => ast}/processed_source.rb | 0 lib/rubocop/{ => ast}/token.rb | 0 spec/rubocop/{ => ast}/node_pattern_spec.rb | 0 spec/rubocop/{ => ast}/processed_source_spec.rb | 2 +- spec/rubocop/{ => ast}/token_spec.rb | 0 7 files changed, 4 insertions(+), 6 deletions(-) rename lib/rubocop/{ => ast}/node_pattern.rb (100%) rename lib/rubocop/{ => ast}/processed_source.rb (100%) rename lib/rubocop/{ => ast}/token.rb (100%) rename spec/rubocop/{ => ast}/node_pattern_spec.rb (100%) rename spec/rubocop/{ => ast}/processed_source_spec.rb (99%) rename spec/rubocop/{ => ast}/token_spec.rb (100%) diff --git a/lib/rubocop/ast.rb b/lib/rubocop/ast.rb index 7111dc74c..41eed81cf 100644 --- a/lib/rubocop/ast.rb +++ b/lib/rubocop/ast.rb @@ -3,8 +3,7 @@ require 'parser' require 'forwardable' -require_relative 'node_pattern' - +require_relative 'ast/node_pattern' require_relative 'ast/sexp' require_relative 'ast/node' require_relative 'ast/node/mixin/method_identifier_predicates' @@ -55,8 +54,7 @@ require_relative 'ast/node/while_node' require_relative 'ast/node/yield_node' require_relative 'ast/builder' +require_relative 'ast/processed_source' +require_relative 'ast/token' require_relative 'ast/traversal' require_relative 'ast/version' - -require_relative 'token' -require_relative 'processed_source' diff --git a/lib/rubocop/node_pattern.rb b/lib/rubocop/ast/node_pattern.rb similarity index 100% rename from lib/rubocop/node_pattern.rb rename to lib/rubocop/ast/node_pattern.rb diff --git a/lib/rubocop/processed_source.rb b/lib/rubocop/ast/processed_source.rb similarity index 100% rename from lib/rubocop/processed_source.rb rename to lib/rubocop/ast/processed_source.rb diff --git a/lib/rubocop/token.rb b/lib/rubocop/ast/token.rb similarity index 100% rename from lib/rubocop/token.rb rename to lib/rubocop/ast/token.rb diff --git a/spec/rubocop/node_pattern_spec.rb b/spec/rubocop/ast/node_pattern_spec.rb similarity index 100% rename from spec/rubocop/node_pattern_spec.rb rename to spec/rubocop/ast/node_pattern_spec.rb diff --git a/spec/rubocop/processed_source_spec.rb b/spec/rubocop/ast/processed_source_spec.rb similarity index 99% rename from spec/rubocop/processed_source_spec.rb rename to spec/rubocop/ast/processed_source_spec.rb index 8e36d6ddf..6c11d789a 100644 --- a/spec/rubocop/processed_source_spec.rb +++ b/spec/rubocop/ast/processed_source_spec.rb @@ -16,7 +16,7 @@ def some_method describe 'when the file exists' do around do |example| org_pwd = Dir.pwd - Dir.chdir(__dir__) + Dir.chdir("#{__dir__}/..") example.run Dir.chdir(org_pwd) end diff --git a/spec/rubocop/token_spec.rb b/spec/rubocop/ast/token_spec.rb similarity index 100% rename from spec/rubocop/token_spec.rb rename to spec/rubocop/ast/token_spec.rb