Skip to content

Commit cb8356e

Browse files
committed
Improve the way subject names are derived.
1 parent 7dd88c0 commit cb8356e

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

ecommerce/pricing/Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
2929
head -n 5 .node_files.tmp || echo "File .node_files.tmp is empty."; \
3030
echo "--- END DEBUG (awk) ---"; \
3131
echo "--- DEBUG: Attempting to derive subject names for this node... ---"; \
32-
@DERIVED_NAMES=$$(cat .node_files.tmp | perl -pe 's#^lib/##; s#\.rb$$##; s#_([a-z])#uc($$1)#eg; s#/#::#g; s#(?:^|::)(.)#\u$$1#g'); \
32+
DERIVED_NAMES=$$(cat .node_files.tmp | perl -pe 's#^lib/##; s#\.rb$$##; s#/(.)#"::" . ucfirst($$1)#eg; s#_([a-z])#uc($$1)#eg; s/(?:^|::)(.)/\u$$1/g'); \
3333
PERL_EXIT_CODE=$$?; \
3434
if [ $$PERL_EXIT_CODE -ne 0 ]; then \
3535
echo "ERROR: Perl command failed with exit code $$PERL_EXIT_CODE"; \

rails_application/Makefile

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,7 @@ ifeq ($(origin MUTANT_NODE_INDEX), environment)
4545
head -n 5 .node_files.tmp || echo "File .node_files.tmp is empty."; \
4646
echo "--- END DEBUG (awk) ---"; \
4747
echo "--- DEBUG: Attempting to derive subject names for this node... ---"; \
48-
@DERIVED_NAMES=$$(cat .node_files.tmp | perl -pe 's#^(app|lib)/##; s#\.rb$$##; s#_([a-z])#uc($$1)#eg; s#/#::#g; s#(?:^|::)(.)#\u$$1#g'); \
48+
DERIVED_NAMES=$$(cat .node_files.tmp | perl -pe 's#^(app/(controllers|models|helpers|jobs|mailers|channels|client_panel)|lib)/##; s#\.rb$$##; s#/(.)#"::" . ucfirst($$1)#eg; s#_([a-z])#uc($$1)#eg; s/(?:^|::)(.)/\u$$1/g'); \
4949
PERL_EXIT_CODE=$$?; \
5050
if [ $$PERL_EXIT_CODE -ne 0 ]; then \
5151
echo "ERROR: Perl command failed with exit code $$PERL_EXIT_CODE"; \
@@ -70,6 +70,7 @@ else
7070
@RAILS_ENV=test bundle exec mutant run
7171
endif
7272

73+
7374
.PHONY: help test db
7475
.DEFAULT_GOAL := help
7576

0 commit comments

Comments
 (0)