From 27381e22a92453b23f1ed75406970b37d926f1ec Mon Sep 17 00:00:00 2001 From: Stan Hu Date: Tue, 21 May 2019 19:49:14 -0700 Subject: [PATCH] Move files from lib/haml_lint to haml_lint Files in lib will be eager loaded and hence will require haml_lint to be loaded. Since this is only a development dependency, we can't assume this gem will be available in production, so it should never be loaded in production. --- .haml-lint.yml | 2 +- {lib/haml_lint => haml_lint}/inline_javascript.rb | 0 {lib/haml_lint => haml_lint}/linter/no_plain_nodes.rb | 0 lib/tasks/haml-lint.rake | 2 +- spec/{lib => }/haml_lint/linter/no_plain_nodes_spec.rb | 1 + 5 files changed, 3 insertions(+), 2 deletions(-) rename {lib/haml_lint => haml_lint}/inline_javascript.rb (100%) rename {lib/haml_lint => haml_lint}/linter/no_plain_nodes.rb (100%) rename spec/{lib => }/haml_lint/linter/no_plain_nodes_spec.rb (95%) diff --git a/.haml-lint.yml b/.haml-lint.yml index 9f3676fa080..0412b24a48c 100644 --- a/.haml-lint.yml +++ b/.haml-lint.yml @@ -7,7 +7,7 @@ exclude: - 'vendor/**/*' - 'spec/**/*' require: - - './lib/haml_lint/linter/no_plain_nodes.rb' + - './haml_lint/linter/no_plain_nodes.rb' linters: AltText: diff --git a/lib/haml_lint/inline_javascript.rb b/haml_lint/inline_javascript.rb similarity index 100% rename from lib/haml_lint/inline_javascript.rb rename to haml_lint/inline_javascript.rb diff --git a/lib/haml_lint/linter/no_plain_nodes.rb b/haml_lint/linter/no_plain_nodes.rb similarity index 100% rename from lib/haml_lint/linter/no_plain_nodes.rb rename to haml_lint/linter/no_plain_nodes.rb diff --git a/lib/tasks/haml-lint.rake b/lib/tasks/haml-lint.rake index 786efd14b1a..305e15d69d5 100644 --- a/lib/tasks/haml-lint.rake +++ b/lib/tasks/haml-lint.rake @@ -1,6 +1,6 @@ unless Rails.env.production? require 'haml_lint/rake_task' - require 'haml_lint/inline_javascript' + require Rails.root.join('haml_lint/inline_javascript') # Workaround for warnings from parser/current # Keep it even if it no longer emits any warnings, diff --git a/spec/lib/haml_lint/linter/no_plain_nodes_spec.rb b/spec/haml_lint/linter/no_plain_nodes_spec.rb similarity index 95% rename from spec/lib/haml_lint/linter/no_plain_nodes_spec.rb rename to spec/haml_lint/linter/no_plain_nodes_spec.rb index 99cc9b9bc8d..08deb5a4e9e 100644 --- a/spec/lib/haml_lint/linter/no_plain_nodes_spec.rb +++ b/spec/haml_lint/linter/no_plain_nodes_spec.rb @@ -3,6 +3,7 @@ require 'spec_helper' require 'haml_lint' require 'haml_lint/spec' +require Rails.root.join('haml_lint/linter/no_plain_nodes') describe HamlLint::Linter::NoPlainNodes do include_context 'linter'