From 8bd7e3b3941eef6e95b1995eb8d5c75454e99ef8 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Wed, 5 Feb 2025 16:08:08 -0800 Subject: [PATCH 01/17] rename annotate_rb --- .github/ISSUE_TEMPLATE.md | 2 +- CHANGELOG.md | 374 +++++++++--------- DEVELOPMENT.md | 2 +- README.md | 24 +- VERSION | 2 +- annotaterb.gemspec => annotate_rb.gemspec | 10 +- exe/{annotaterb => annotate_rb} | 2 +- lib/annotate_rb.rb | 30 +- lib/annotate_rb/config_finder.rb | 4 +- .../model_annotator/model_files_getter.rb | 4 +- .../model_annotator/single_file_annotator.rb | 2 +- lib/annotate_rb/options.rb | 2 +- lib/annotate_rb/parser.rb | 6 +- lib/annotaterb.rb | 4 - lib/generators/annotate_rb/config/USAGE | 2 +- .../annotate_rb/update_config/USAGE | 2 +- spec/dummyapp/Gemfile | 2 +- spec/dummyapp/config/database.yml | 4 +- .../annotate_after_migration_spec.rb | 2 +- .../annotate_collapsed_models_spec.rb | 2 +- ...ate_file_with_existing_annotations_spec.rb | 2 +- .../annotate_model_with_foreign_key_spec.rb | 2 +- spec/integration/annotate_routes_spec.rb | 2 +- spec/integration/annotate_single_file_spec.rb | 2 +- spec/integration/cli_spec.rb | 10 +- .../rails_generator_install_spec.rb | 2 +- .../rails_generator_update_config_spec.rb | 2 +- ...te_models_annotating_a_file_frozen_spec.rb | 4 +- .../annotating_a_file_with_comments_spec.rb | 2 +- .../single_file_annotation_remover_spec.rb | 2 +- .../single_file_annotator_spec.rb | 16 +- spec/spec_helper.rb | 4 +- 32 files changed, 252 insertions(+), 280 deletions(-) rename annotaterb.gemspec => annotate_rb.gemspec (86%) rename exe/{annotaterb => annotate_rb} (83%) delete mode 100644 lib/annotaterb.rb diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 02f86bc4..5967d224 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -8,7 +8,7 @@ $ show your commands here. ## Version -- annotaterb version +- annotate_rb version - rails version - ruby version - database version diff --git a/CHANGELOG.md b/CHANGELOG.md index 734a52de..e694fdad 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,320 +1,320 @@ # Changelog -## [v4.13.0](https://github.com/drwl/annotaterb/tree/v4.13.0) (2024-10-21) +## [v4.13.0](https://github.com/drwl/annotate_rb/tree/v4.13.0) (2024-10-21) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.12.0...v4.13.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.12.0...v4.13.0) **Closed issues:** -- Bug: Bigint are reported as integer [\#157](https://github.com/drwl/annotaterb/issues/157) -- Bug \(apparently\): :ignore\_columns does not work \(with any syntax I've tried\) [\#154](https://github.com/drwl/annotaterb/issues/154) +- Bug: Bigint are reported as integer [\#157](https://github.com/drwl/annotate_rb/issues/157) +- Bug \(apparently\): :ignore\_columns does not work \(with any syntax I've tried\) [\#154](https://github.com/drwl/annotate_rb/issues/154) **Merged pull requests:** -- Bump version to v4.13.0 [\#159](https://github.com/drwl/annotaterb/pull/159) ([drwl](https://github.com/drwl)) -- Support parsing of dynamic fixture erb yml files [\#158](https://github.com/drwl/annotaterb/pull/158) ([drwl](https://github.com/drwl)) -- Fix updating of indexes containing escaped characters [\#156](https://github.com/drwl/annotaterb/pull/156) ([antonivanopoulos](https://github.com/antonivanopoulos)) -- Add model with association and foreign key to dummyapp [\#153](https://github.com/drwl/annotaterb/pull/153) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.12.0 [\#152](https://github.com/drwl/annotaterb/pull/152) ([drwl](https://github.com/drwl)) +- Bump version to v4.13.0 [\#159](https://github.com/drwl/annotate_rb/pull/159) ([drwl](https://github.com/drwl)) +- Support parsing of dynamic fixture erb yml files [\#158](https://github.com/drwl/annotate_rb/pull/158) ([drwl](https://github.com/drwl)) +- Fix updating of indexes containing escaped characters [\#156](https://github.com/drwl/annotate_rb/pull/156) ([antonivanopoulos](https://github.com/antonivanopoulos)) +- Add model with association and foreign key to dummyapp [\#153](https://github.com/drwl/annotate_rb/pull/153) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.12.0 [\#152](https://github.com/drwl/annotate_rb/pull/152) ([drwl](https://github.com/drwl)) -## [v4.12.0](https://github.com/drwl/annotaterb/tree/v4.12.0) (2024-09-15) +## [v4.12.0](https://github.com/drwl/annotate_rb/tree/v4.12.0) (2024-09-15) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.11.0...v4.12.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.11.0...v4.12.0) **Merged pull requests:** -- Bump version to v4.12.0 [\#151](https://github.com/drwl/annotaterb/pull/151) ([drwl](https://github.com/drwl)) -- Support postgres NULLS NOT DISTINCT clause in unique index [\#148](https://github.com/drwl/annotaterb/pull/148) ([ENewmeration](https://github.com/ENewmeration)) -- Generate changelog for v4.11.0 [\#147](https://github.com/drwl/annotaterb/pull/147) ([drwl](https://github.com/drwl)) +- Bump version to v4.12.0 [\#151](https://github.com/drwl/annotate_rb/pull/151) ([drwl](https://github.com/drwl)) +- Support postgres NULLS NOT DISTINCT clause in unique index [\#148](https://github.com/drwl/annotate_rb/pull/148) ([ENewmeration](https://github.com/ENewmeration)) +- Generate changelog for v4.11.0 [\#147](https://github.com/drwl/annotate_rb/pull/147) ([drwl](https://github.com/drwl)) -## [v4.11.0](https://github.com/drwl/annotaterb/tree/v4.11.0) (2024-08-16) +## [v4.11.0](https://github.com/drwl/annotate_rb/tree/v4.11.0) (2024-08-16) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.2...v4.11.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.10.2...v4.11.0) **Closed issues:** -- Include the length of comments in max\_schema\_info\_width only when the with\_column\_comments option is true. [\#144](https://github.com/drwl/annotaterb/issues/144) -- Rakefile seems to be loaded twice [\#130](https://github.com/drwl/annotaterb/issues/130) +- Include the length of comments in max\_schema\_info\_width only when the with\_column\_comments option is true. [\#144](https://github.com/drwl/annotate_rb/issues/144) +- Rakefile seems to be loaded twice [\#130](https://github.com/drwl/annotate_rb/issues/130) **Merged pull requests:** -- Bump version to v4.11.0 [\#146](https://github.com/drwl/annotaterb/pull/146) ([drwl](https://github.com/drwl)) -- Include the length of comments in max\_schema\_info\_width only when the with\_comment and with\_column\_comments option is true. [\#145](https://github.com/drwl/annotaterb/pull/145) ([shibaaaa](https://github.com/shibaaaa)) -- Add Ruby 3.3 to CI [\#143](https://github.com/drwl/annotaterb/pull/143) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.10.2 [\#142](https://github.com/drwl/annotaterb/pull/142) ([drwl](https://github.com/drwl)) +- Bump version to v4.11.0 [\#146](https://github.com/drwl/annotate_rb/pull/146) ([drwl](https://github.com/drwl)) +- Include the length of comments in max\_schema\_info\_width only when the with\_comment and with\_column\_comments option is true. [\#145](https://github.com/drwl/annotate_rb/pull/145) ([shibaaaa](https://github.com/shibaaaa)) +- Add Ruby 3.3 to CI [\#143](https://github.com/drwl/annotate_rb/pull/143) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.10.2 [\#142](https://github.com/drwl/annotate_rb/pull/142) ([drwl](https://github.com/drwl)) -## [v4.10.2](https://github.com/drwl/annotaterb/tree/v4.10.2) (2024-07-23) +## [v4.10.2](https://github.com/drwl/annotate_rb/tree/v4.10.2) (2024-07-23) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.1...v4.10.2) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.10.1...v4.10.2) **Closed issues:** -- Composite primary keys are unsupported [\#138](https://github.com/drwl/annotaterb/issues/138) +- Composite primary keys are unsupported [\#138](https://github.com/drwl/annotate_rb/issues/138) **Merged pull requests:** -- Bump version to v4.10.2 [\#141](https://github.com/drwl/annotaterb/pull/141) ([drwl](https://github.com/drwl)) -- Fix double-loading of Rakefile [\#140](https://github.com/drwl/annotaterb/pull/140) ([dmke](https://github.com/dmke)) -- Change structure of model annotation builder [\#136](https://github.com/drwl/annotaterb/pull/136) ([drwl](https://github.com/drwl)) -- Refactor model annotation components [\#134](https://github.com/drwl/annotaterb/pull/134) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.10.1 [\#133](https://github.com/drwl/annotaterb/pull/133) ([drwl](https://github.com/drwl)) +- Bump version to v4.10.2 [\#141](https://github.com/drwl/annotate_rb/pull/141) ([drwl](https://github.com/drwl)) +- Fix double-loading of Rakefile [\#140](https://github.com/drwl/annotate_rb/pull/140) ([dmke](https://github.com/dmke)) +- Change structure of model annotation builder [\#136](https://github.com/drwl/annotate_rb/pull/136) ([drwl](https://github.com/drwl)) +- Refactor model annotation components [\#134](https://github.com/drwl/annotate_rb/pull/134) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.10.1 [\#133](https://github.com/drwl/annotate_rb/pull/133) ([drwl](https://github.com/drwl)) -## [v4.10.1](https://github.com/drwl/annotaterb/tree/v4.10.1) (2024-07-07) +## [v4.10.1](https://github.com/drwl/annotate_rb/tree/v4.10.1) (2024-07-07) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.0...v4.10.1) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.10.0...v4.10.1) **Merged pull requests:** -- Bump version to v4.10.1 [\#132](https://github.com/drwl/annotaterb/pull/132) ([drwl](https://github.com/drwl)) -- Correct uses of `respond_to` in AnnotationDecider [\#131](https://github.com/drwl/annotaterb/pull/131) ([andreccosta](https://github.com/andreccosta)) -- Generate changelog for v4.10.0 [\#129](https://github.com/drwl/annotaterb/pull/129) ([drwl](https://github.com/drwl)) +- Bump version to v4.10.1 [\#132](https://github.com/drwl/annotate_rb/pull/132) ([drwl](https://github.com/drwl)) +- Correct uses of `respond_to` in AnnotationDecider [\#131](https://github.com/drwl/annotate_rb/pull/131) ([andreccosta](https://github.com/andreccosta)) +- Generate changelog for v4.10.0 [\#129](https://github.com/drwl/annotate_rb/pull/129) ([drwl](https://github.com/drwl)) -## [v4.10.0](https://github.com/drwl/annotaterb/tree/v4.10.0) (2024-06-28) +## [v4.10.0](https://github.com/drwl/annotate_rb/tree/v4.10.0) (2024-06-28) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.9.0...v4.10.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.9.0...v4.10.0) **Closed issues:** -- Feature Request: add support for arrays when using StoreModel [\#125](https://github.com/drwl/annotaterb/issues/125) -- Error on composite foreign key constraints [\#121](https://github.com/drwl/annotaterb/issues/121) +- Feature Request: add support for arrays when using StoreModel [\#125](https://github.com/drwl/annotate_rb/issues/125) +- Error on composite foreign key constraints [\#121](https://github.com/drwl/annotate_rb/issues/121) **Merged pull requests:** -- Bump version to v4.10.0 [\#128](https://github.com/drwl/annotaterb/pull/128) ([drwl](https://github.com/drwl)) -- Support composite foreign keys [\#126](https://github.com/drwl/annotaterb/pull/126) ([drwl](https://github.com/drwl)) -- Add files to improve other's ability to help the project [\#123](https://github.com/drwl/annotaterb/pull/123) ([drwl](https://github.com/drwl)) -- Add database and adapter to issue template [\#122](https://github.com/drwl/annotaterb/pull/122) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.9.0 [\#120](https://github.com/drwl/annotaterb/pull/120) ([drwl](https://github.com/drwl)) +- Bump version to v4.10.0 [\#128](https://github.com/drwl/annotate_rb/pull/128) ([drwl](https://github.com/drwl)) +- Support composite foreign keys [\#126](https://github.com/drwl/annotate_rb/pull/126) ([drwl](https://github.com/drwl)) +- Add files to improve other's ability to help the project [\#123](https://github.com/drwl/annotate_rb/pull/123) ([drwl](https://github.com/drwl)) +- Add database and adapter to issue template [\#122](https://github.com/drwl/annotate_rb/pull/122) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.9.0 [\#120](https://github.com/drwl/annotate_rb/pull/120) ([drwl](https://github.com/drwl)) -## [v4.9.0](https://github.com/drwl/annotaterb/tree/v4.9.0) (2024-05-29) +## [v4.9.0](https://github.com/drwl/annotate_rb/tree/v4.9.0) (2024-05-29) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.8.0...v4.9.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.8.0...v4.9.0) **Closed issues:** -- Duplicate content in fixtures when annotating models [\#108](https://github.com/drwl/annotaterb/issues/108) -- Cannot exclude annotations from serializer specs [\#103](https://github.com/drwl/annotaterb/issues/103) +- Duplicate content in fixtures when annotating models [\#108](https://github.com/drwl/annotate_rb/issues/108) +- Cannot exclude annotations from serializer specs [\#103](https://github.com/drwl/annotate_rb/issues/103) **Merged pull requests:** -- Bump version to v4.9.0 [\#119](https://github.com/drwl/annotaterb/pull/119) ([drwl](https://github.com/drwl)) -- Add support for `NOT VALID` constraints [\#118](https://github.com/drwl/annotaterb/pull/118) ([gmcabrita](https://github.com/gmcabrita)) -- Generate changelog for v4.8.0 [\#116](https://github.com/drwl/annotaterb/pull/116) ([drwl](https://github.com/drwl)) +- Bump version to v4.9.0 [\#119](https://github.com/drwl/annotate_rb/pull/119) ([drwl](https://github.com/drwl)) +- Add support for `NOT VALID` constraints [\#118](https://github.com/drwl/annotate_rb/pull/118) ([gmcabrita](https://github.com/gmcabrita)) +- Generate changelog for v4.8.0 [\#116](https://github.com/drwl/annotate_rb/pull/116) ([drwl](https://github.com/drwl)) -## [v4.8.0](https://github.com/drwl/annotaterb/tree/v4.8.0) (2024-05-14) +## [v4.8.0](https://github.com/drwl/annotate_rb/tree/v4.8.0) (2024-05-14) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.7.1...v4.8.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.7.1...v4.8.0) **Closed issues:** -- Nested module models and unexpected annotations [\#106](https://github.com/drwl/annotaterb/issues/106) +- Nested module models and unexpected annotations [\#106](https://github.com/drwl/annotate_rb/issues/106) **Merged pull requests:** -- Bump version to v4.8.0 [\#115](https://github.com/drwl/annotaterb/pull/115) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.7.1 [\#114](https://github.com/drwl/annotaterb/pull/114) ([drwl](https://github.com/drwl)) -- Support annotating model fixture files [\#110](https://github.com/drwl/annotaterb/pull/110) ([drwl](https://github.com/drwl)) -- Make `exclude_tests` option able to override other exclude options [\#107](https://github.com/drwl/annotaterb/pull/107) ([drwl](https://github.com/drwl)) +- Bump version to v4.8.0 [\#115](https://github.com/drwl/annotate_rb/pull/115) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.7.1 [\#114](https://github.com/drwl/annotate_rb/pull/114) ([drwl](https://github.com/drwl)) +- Support annotating model fixture files [\#110](https://github.com/drwl/annotate_rb/pull/110) ([drwl](https://github.com/drwl)) +- Make `exclude_tests` option able to override other exclude options [\#107](https://github.com/drwl/annotate_rb/pull/107) ([drwl](https://github.com/drwl)) -## [v4.7.1](https://github.com/drwl/annotaterb/tree/v4.7.1) (2024-05-09) +## [v4.7.1](https://github.com/drwl/annotate_rb/tree/v4.7.1) (2024-05-09) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.7.0...v4.7.1) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.7.0...v4.7.1) **Closed issues:** -- Check constraint support [\#104](https://github.com/drwl/annotaterb/issues/104) +- Check constraint support [\#104](https://github.com/drwl/annotate_rb/issues/104) **Merged pull requests:** -- Bump version to v4.7.1 [\#113](https://github.com/drwl/annotaterb/pull/113) ([drwl](https://github.com/drwl)) -- Change AnnotationDecider to return false early [\#112](https://github.com/drwl/annotaterb/pull/112) ([drwl](https://github.com/drwl)) -- Memoize ActiveRecord migrator version calls [\#111](https://github.com/drwl/annotaterb/pull/111) ([drwl](https://github.com/drwl)) -- Fix misspelling in migration guide [\#109](https://github.com/drwl/annotaterb/pull/109) ([RobinDaugherty](https://github.com/RobinDaugherty)) -- Annotate model check constraints [\#105](https://github.com/drwl/annotaterb/pull/105) ([drwl](https://github.com/drwl)) -- Fix CHANGELOG.md [\#102](https://github.com/drwl/annotaterb/pull/102) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.7.0 [\#101](https://github.com/drwl/annotaterb/pull/101) ([drwl](https://github.com/drwl)) +- Bump version to v4.7.1 [\#113](https://github.com/drwl/annotate_rb/pull/113) ([drwl](https://github.com/drwl)) +- Change AnnotationDecider to return false early [\#112](https://github.com/drwl/annotate_rb/pull/112) ([drwl](https://github.com/drwl)) +- Memoize ActiveRecord migrator version calls [\#111](https://github.com/drwl/annotate_rb/pull/111) ([drwl](https://github.com/drwl)) +- Fix misspelling in migration guide [\#109](https://github.com/drwl/annotate_rb/pull/109) ([RobinDaugherty](https://github.com/RobinDaugherty)) +- Annotate model check constraints [\#105](https://github.com/drwl/annotate_rb/pull/105) ([drwl](https://github.com/drwl)) +- Fix CHANGELOG.md [\#102](https://github.com/drwl/annotate_rb/pull/102) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.7.0 [\#101](https://github.com/drwl/annotate_rb/pull/101) ([drwl](https://github.com/drwl)) -## [v4.7.0](https://github.com/drwl/annotaterb/tree/v4.7.0) (2024-03-27) +## [v4.7.0](https://github.com/drwl/annotate_rb/tree/v4.7.0) (2024-03-27) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.6.0...v4.7.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.6.0...v4.7.0) **Closed issues:** -- Feature request: better custom type representation [\#97](https://github.com/drwl/annotaterb/issues/97) +- Feature request: better custom type representation [\#97](https://github.com/drwl/annotate_rb/issues/97) **Merged pull requests:** -- Bump version to v4.7.0 [\#100](https://github.com/drwl/annotaterb/pull/100) ([drwl](https://github.com/drwl)) -- Add configurable classes list with `to_s` representation [\#98](https://github.com/drwl/annotaterb/pull/98) ([viralpraxis](https://github.com/viralpraxis)) -- Generate changelog for v4.6.0 [\#96](https://github.com/drwl/annotaterb/pull/96) ([drwl](https://github.com/drwl)) +- Bump version to v4.7.0 [\#100](https://github.com/drwl/annotate_rb/pull/100) ([drwl](https://github.com/drwl)) +- Add configurable classes list with `to_s` representation [\#98](https://github.com/drwl/annotate_rb/pull/98) ([viralpraxis](https://github.com/viralpraxis)) +- Generate changelog for v4.6.0 [\#96](https://github.com/drwl/annotate_rb/pull/96) ([drwl](https://github.com/drwl)) -## [v4.6.0](https://github.com/drwl/annotaterb/tree/v4.6.0) (2024-02-27) +## [v4.6.0](https://github.com/drwl/annotate_rb/tree/v4.6.0) (2024-02-27) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.5.0...v4.6.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.5.0...v4.6.0) **Closed issues:** -- Add support for `data_migrate` gem [\#89](https://github.com/drwl/annotaterb/issues/89) +- Add support for `data_migrate` gem [\#89](https://github.com/drwl/annotate_rb/issues/89) **Merged pull requests:** -- Bump version to v4.6.0 [\#95](https://github.com/drwl/annotaterb/pull/95) ([drwl](https://github.com/drwl)) -- Add support for parsing RSpec files [\#94](https://github.com/drwl/annotaterb/pull/94) ([drwl](https://github.com/drwl)) -- Add support for model name without namespace in resolver [\#93](https://github.com/drwl/annotaterb/pull/93) ([drwl](https://github.com/drwl)) -- Fixes for `RelatedFilesListBuilder` [\#92](https://github.com/drwl/annotaterb/pull/92) ([drwl](https://github.com/drwl)) -- Refactor `AnnotatedFile` classes [\#91](https://github.com/drwl/annotaterb/pull/91) ([drwl](https://github.com/drwl)) -- Add support for data\_migrate gem [\#90](https://github.com/drwl/annotaterb/pull/90) ([cmer](https://github.com/cmer)) -- Support non-model files in `CustomParser` [\#88](https://github.com/drwl/annotaterb/pull/88) ([drwl](https://github.com/drwl)) -- Fix flakey integration test [\#87](https://github.com/drwl/annotaterb/pull/87) ([drwl](https://github.com/drwl)) -- Improve integration tests [\#86](https://github.com/drwl/annotaterb/pull/86) ([drwl](https://github.com/drwl)) -- Add Zeitwerk support [\#85](https://github.com/drwl/annotaterb/pull/85) ([drwl](https://github.com/drwl)) -- Improve annotate after adding new migration integration test [\#84](https://github.com/drwl/annotaterb/pull/84) ([drwl](https://github.com/drwl)) -- Add integration test using force [\#81](https://github.com/drwl/annotaterb/pull/81) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.5.0 [\#80](https://github.com/drwl/annotaterb/pull/80) ([drwl](https://github.com/drwl)) -- Fix annotations swallowing comments [\#72](https://github.com/drwl/annotaterb/pull/72) ([drwl](https://github.com/drwl)) - -## [v4.5.0](https://github.com/drwl/annotaterb/tree/v4.5.0) (2024-02-08) - -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.4.1...v4.5.0) +- Bump version to v4.6.0 [\#95](https://github.com/drwl/annotate_rb/pull/95) ([drwl](https://github.com/drwl)) +- Add support for parsing RSpec files [\#94](https://github.com/drwl/annotate_rb/pull/94) ([drwl](https://github.com/drwl)) +- Add support for model name without namespace in resolver [\#93](https://github.com/drwl/annotate_rb/pull/93) ([drwl](https://github.com/drwl)) +- Fixes for `RelatedFilesListBuilder` [\#92](https://github.com/drwl/annotate_rb/pull/92) ([drwl](https://github.com/drwl)) +- Refactor `AnnotatedFile` classes [\#91](https://github.com/drwl/annotate_rb/pull/91) ([drwl](https://github.com/drwl)) +- Add support for data\_migrate gem [\#90](https://github.com/drwl/annotate_rb/pull/90) ([cmer](https://github.com/cmer)) +- Support non-model files in `CustomParser` [\#88](https://github.com/drwl/annotate_rb/pull/88) ([drwl](https://github.com/drwl)) +- Fix flakey integration test [\#87](https://github.com/drwl/annotate_rb/pull/87) ([drwl](https://github.com/drwl)) +- Improve integration tests [\#86](https://github.com/drwl/annotate_rb/pull/86) ([drwl](https://github.com/drwl)) +- Add Zeitwerk support [\#85](https://github.com/drwl/annotate_rb/pull/85) ([drwl](https://github.com/drwl)) +- Improve annotate after adding new migration integration test [\#84](https://github.com/drwl/annotate_rb/pull/84) ([drwl](https://github.com/drwl)) +- Add integration test using force [\#81](https://github.com/drwl/annotate_rb/pull/81) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.5.0 [\#80](https://github.com/drwl/annotate_rb/pull/80) ([drwl](https://github.com/drwl)) +- Fix annotations swallowing comments [\#72](https://github.com/drwl/annotate_rb/pull/72) ([drwl](https://github.com/drwl)) + +## [v4.5.0](https://github.com/drwl/annotate_rb/tree/v4.5.0) (2024-02-08) + +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.4.1...v4.5.0) **Closed issues:** -- Add an automated way to migrate from the old annotate gem [\#73](https://github.com/drwl/annotaterb/issues/73) -- Default array value is double-quoted/escaped [\#57](https://github.com/drwl/annotaterb/issues/57) +- Add an automated way to migrate from the old annotate gem [\#73](https://github.com/drwl/annotate_rb/issues/73) +- Default array value is double-quoted/escaped [\#57](https://github.com/drwl/annotate_rb/issues/57) **Merged pull requests:** -- Bump version to v4.5.0 [\#79](https://github.com/drwl/annotaterb/pull/79) ([drwl](https://github.com/drwl)) -- Update README on the new Rails generator commands [\#78](https://github.com/drwl/annotaterb/pull/78) ([drwl](https://github.com/drwl)) -- Bump github/codeql-action from 2 to 3 [\#77](https://github.com/drwl/annotaterb/pull/77) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Add command to generate a configuration file [\#76](https://github.com/drwl/annotaterb/pull/76) ([drwl](https://github.com/drwl)) -- Bump actions/checkout from 3 to 4 [\#75](https://github.com/drwl/annotaterb/pull/75) ([dependabot[bot]](https://github.com/apps/dependabot)) -- CI: Configure dependabot to update GH Actions [\#74](https://github.com/drwl/annotaterb/pull/74) ([olleolleolle](https://github.com/olleolleolle)) -- Refactor `FileBuilder` and `MagicCommentParser` [\#71](https://github.com/drwl/annotaterb/pull/71) ([drwl](https://github.com/drwl)) -- Test running annotations after a migration [\#70](https://github.com/drwl/annotaterb/pull/70) ([drwl](https://github.com/drwl)) -- Add integration test for rake task installer [\#69](https://github.com/drwl/annotaterb/pull/69) ([drwl](https://github.com/drwl)) -- Add integration test for annotating routes [\#68](https://github.com/drwl/annotaterb/pull/68) ([drwl](https://github.com/drwl)) -- Remove optional args [\#67](https://github.com/drwl/annotaterb/pull/67) ([drwl](https://github.com/drwl)) -- Remove optional arg from `AnnotationPatternGenerator` [\#66](https://github.com/drwl/annotaterb/pull/66) ([drwl](https://github.com/drwl)) -- Remove `ARGV` use during runtime [\#65](https://github.com/drwl/annotaterb/pull/65) ([drwl](https://github.com/drwl)) -- Add integration test for annotating a singular file [\#64](https://github.com/drwl/annotaterb/pull/64) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.4.1 [\#63](https://github.com/drwl/annotaterb/pull/63) ([drwl](https://github.com/drwl)) -- Add support for factory\_bot's default suffixed pattern [\#59](https://github.com/drwl/annotaterb/pull/59) ([drwl](https://github.com/drwl)) - -## [v4.4.1](https://github.com/drwl/annotaterb/tree/v4.4.1) (2023-09-11) - -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.4.0...v4.4.1) +- Bump version to v4.5.0 [\#79](https://github.com/drwl/annotate_rb/pull/79) ([drwl](https://github.com/drwl)) +- Update README on the new Rails generator commands [\#78](https://github.com/drwl/annotate_rb/pull/78) ([drwl](https://github.com/drwl)) +- Bump github/codeql-action from 2 to 3 [\#77](https://github.com/drwl/annotate_rb/pull/77) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Add command to generate a configuration file [\#76](https://github.com/drwl/annotate_rb/pull/76) ([drwl](https://github.com/drwl)) +- Bump actions/checkout from 3 to 4 [\#75](https://github.com/drwl/annotate_rb/pull/75) ([dependabot[bot]](https://github.com/apps/dependabot)) +- CI: Configure dependabot to update GH Actions [\#74](https://github.com/drwl/annotate_rb/pull/74) ([olleolleolle](https://github.com/olleolleolle)) +- Refactor `FileBuilder` and `MagicCommentParser` [\#71](https://github.com/drwl/annotate_rb/pull/71) ([drwl](https://github.com/drwl)) +- Test running annotations after a migration [\#70](https://github.com/drwl/annotate_rb/pull/70) ([drwl](https://github.com/drwl)) +- Add integration test for rake task installer [\#69](https://github.com/drwl/annotate_rb/pull/69) ([drwl](https://github.com/drwl)) +- Add integration test for annotating routes [\#68](https://github.com/drwl/annotate_rb/pull/68) ([drwl](https://github.com/drwl)) +- Remove optional args [\#67](https://github.com/drwl/annotate_rb/pull/67) ([drwl](https://github.com/drwl)) +- Remove optional arg from `AnnotationPatternGenerator` [\#66](https://github.com/drwl/annotate_rb/pull/66) ([drwl](https://github.com/drwl)) +- Remove `ARGV` use during runtime [\#65](https://github.com/drwl/annotate_rb/pull/65) ([drwl](https://github.com/drwl)) +- Add integration test for annotating a singular file [\#64](https://github.com/drwl/annotate_rb/pull/64) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.4.1 [\#63](https://github.com/drwl/annotate_rb/pull/63) ([drwl](https://github.com/drwl)) +- Add support for factory\_bot's default suffixed pattern [\#59](https://github.com/drwl/annotate_rb/pull/59) ([drwl](https://github.com/drwl)) + +## [v4.4.1](https://github.com/drwl/annotate_rb/tree/v4.4.1) (2023-09-11) + +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.4.0...v4.4.1) **Merged pull requests:** -- Bump version to v4.4.1 [\#62](https://github.com/drwl/annotaterb/pull/62) ([drwl](https://github.com/drwl)) -- Fix annotation for columns with `Date` and `DateTime` default values [\#61](https://github.com/drwl/annotaterb/pull/61) ([drwl](https://github.com/drwl)) -- Add integration tests [\#60](https://github.com/drwl/annotaterb/pull/60) ([drwl](https://github.com/drwl)) -- Fix the default array value from being escaped [\#58](https://github.com/drwl/annotaterb/pull/58) ([drwl](https://github.com/drwl)) -- Update dummyapp Rails version [\#56](https://github.com/drwl/annotaterb/pull/56) ([drwl](https://github.com/drwl)) -- Bump puma from 5.6.5 to 6.3.1 in /dummyapp [\#55](https://github.com/drwl/annotaterb/pull/55) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Generate changelog for v4.4.0 [\#53](https://github.com/drwl/annotaterb/pull/53) ([drwl](https://github.com/drwl)) -- Add CLI specs using `aruba` gem [\#43](https://github.com/drwl/annotaterb/pull/43) ([drwl](https://github.com/drwl)) +- Bump version to v4.4.1 [\#62](https://github.com/drwl/annotate_rb/pull/62) ([drwl](https://github.com/drwl)) +- Fix annotation for columns with `Date` and `DateTime` default values [\#61](https://github.com/drwl/annotate_rb/pull/61) ([drwl](https://github.com/drwl)) +- Add integration tests [\#60](https://github.com/drwl/annotate_rb/pull/60) ([drwl](https://github.com/drwl)) +- Fix the default array value from being escaped [\#58](https://github.com/drwl/annotate_rb/pull/58) ([drwl](https://github.com/drwl)) +- Update dummyapp Rails version [\#56](https://github.com/drwl/annotate_rb/pull/56) ([drwl](https://github.com/drwl)) +- Bump puma from 5.6.5 to 6.3.1 in /dummyapp [\#55](https://github.com/drwl/annotate_rb/pull/55) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Generate changelog for v4.4.0 [\#53](https://github.com/drwl/annotate_rb/pull/53) ([drwl](https://github.com/drwl)) +- Add CLI specs using `aruba` gem [\#43](https://github.com/drwl/annotate_rb/pull/43) ([drwl](https://github.com/drwl)) -## [v4.4.0](https://github.com/drwl/annotaterb/tree/v4.4.0) (2023-06-24) +## [v4.4.0](https://github.com/drwl/annotate_rb/tree/v4.4.0) (2023-06-24) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.3.1...v4.4.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.3.1...v4.4.0) **Merged pull requests:** -- Bump version to v4.4.0 [\#52](https://github.com/drwl/annotaterb/pull/52) ([drwl](https://github.com/drwl)) -- Flatten tests in `annotation_builder_spec.rb` [\#51](https://github.com/drwl/annotaterb/pull/51) ([drwl](https://github.com/drwl)) -- Add support for table comments [\#50](https://github.com/drwl/annotaterb/pull/50) ([drwl](https://github.com/drwl)) -- Improve some model annotator tests [\#49](https://github.com/drwl/annotaterb/pull/49) ([drwl](https://github.com/drwl)) -- Make tests that use `mock_column` more accurate [\#48](https://github.com/drwl/annotaterb/pull/48) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.3.1 [\#47](https://github.com/drwl/annotaterb/pull/47) ([drwl](https://github.com/drwl)) +- Bump version to v4.4.0 [\#52](https://github.com/drwl/annotate_rb/pull/52) ([drwl](https://github.com/drwl)) +- Flatten tests in `annotation_builder_spec.rb` [\#51](https://github.com/drwl/annotate_rb/pull/51) ([drwl](https://github.com/drwl)) +- Add support for table comments [\#50](https://github.com/drwl/annotate_rb/pull/50) ([drwl](https://github.com/drwl)) +- Improve some model annotator tests [\#49](https://github.com/drwl/annotate_rb/pull/49) ([drwl](https://github.com/drwl)) +- Make tests that use `mock_column` more accurate [\#48](https://github.com/drwl/annotate_rb/pull/48) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.3.1 [\#47](https://github.com/drwl/annotate_rb/pull/47) ([drwl](https://github.com/drwl)) -## [v4.3.1](https://github.com/drwl/annotaterb/tree/v4.3.1) (2023-06-15) +## [v4.3.1](https://github.com/drwl/annotate_rb/tree/v4.3.1) (2023-06-15) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.3.0...v4.3.1) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.3.0...v4.3.1) **Closed issues:** -- Column defaults change in migration [\#45](https://github.com/drwl/annotaterb/issues/45) +- Column defaults change in migration [\#45](https://github.com/drwl/annotate_rb/issues/45) **Merged pull requests:** -- Bump version to v4.3.1 [\#46](https://github.com/drwl/annotaterb/pull/46) ([drwl](https://github.com/drwl)) -- Prettify column defaults [\#44](https://github.com/drwl/annotaterb/pull/44) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.3.0 [\#42](https://github.com/drwl/annotaterb/pull/42) ([drwl](https://github.com/drwl)) +- Bump version to v4.3.1 [\#46](https://github.com/drwl/annotate_rb/pull/46) ([drwl](https://github.com/drwl)) +- Prettify column defaults [\#44](https://github.com/drwl/annotate_rb/pull/44) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.3.0 [\#42](https://github.com/drwl/annotate_rb/pull/42) ([drwl](https://github.com/drwl)) -## [v4.3.0](https://github.com/drwl/annotaterb/tree/v4.3.0) (2023-06-10) +## [v4.3.0](https://github.com/drwl/annotate_rb/tree/v4.3.0) (2023-06-10) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.2.0...v4.3.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.2.0...v4.3.0) **Merged pull requests:** -- Bump version to v4.3.0 [\#41](https://github.com/drwl/annotaterb/pull/41) ([drwl](https://github.com/drwl)) -- Add `ANNOTATERB_SKIP_ON_DB_TASKS` ENV var to skip auto annotations [\#40](https://github.com/drwl/annotaterb/pull/40) ([drwl](https://github.com/drwl)) +- Bump version to v4.3.0 [\#41](https://github.com/drwl/annotate_rb/pull/41) ([drwl](https://github.com/drwl)) +- Add `ANNOTATERB_SKIP_ON_DB_TASKS` ENV var to skip auto annotations [\#40](https://github.com/drwl/annotate_rb/pull/40) ([drwl](https://github.com/drwl)) -## [v4.2.0](https://github.com/drwl/annotaterb/tree/v4.2.0) (2023-06-02) +## [v4.2.0](https://github.com/drwl/annotate_rb/tree/v4.2.0) (2023-06-02) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.1.1...v4.2.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.1.1...v4.2.0) **Merged pull requests:** -- Specify `standard` gem version [\#39](https://github.com/drwl/annotaterb/pull/39) ([drwl](https://github.com/drwl)) -- Generate changelog for 4.2 again [\#38](https://github.com/drwl/annotaterb/pull/38) ([drwl](https://github.com/drwl)) -- Bump version to v4.2.0 [\#37](https://github.com/drwl/annotaterb/pull/37) ([drwl](https://github.com/drwl)) -- Generate changelog for 4.2 [\#36](https://github.com/drwl/annotaterb/pull/36) ([drwl](https://github.com/drwl)) -- Improve tests for `ColumnAnnotation::*` [\#35](https://github.com/drwl/annotaterb/pull/35) ([drwl](https://github.com/drwl)) -- Change instances of `Options.from` =\> `Options.new` in tests [\#34](https://github.com/drwl/annotaterb/pull/34) ([drwl](https://github.com/drwl)) -- Add `Standard` linter to project [\#33](https://github.com/drwl/annotaterb/pull/33) ([drwl](https://github.com/drwl)) -- Support Sorbet `typed` magic comment [\#32](https://github.com/drwl/annotaterb/pull/32) ([drwl](https://github.com/drwl)) -- Add `position_in_additional_file_patterns` to Options and Parser [\#31](https://github.com/drwl/annotaterb/pull/31) ([drwl](https://github.com/drwl)) -- Remove `Files` gem as a dependency [\#30](https://github.com/drwl/annotaterb/pull/30) ([drwl](https://github.com/drwl)) -- Refactor `ModelAnnotator` again [\#28](https://github.com/drwl/annotaterb/pull/28) ([drwl](https://github.com/drwl)) -- Add initial change log [\#27](https://github.com/drwl/annotaterb/pull/27) ([drwl](https://github.com/drwl)) +- Specify `standard` gem version [\#39](https://github.com/drwl/annotate_rb/pull/39) ([drwl](https://github.com/drwl)) +- Generate changelog for 4.2 again [\#38](https://github.com/drwl/annotate_rb/pull/38) ([drwl](https://github.com/drwl)) +- Bump version to v4.2.0 [\#37](https://github.com/drwl/annotate_rb/pull/37) ([drwl](https://github.com/drwl)) +- Generate changelog for 4.2 [\#36](https://github.com/drwl/annotate_rb/pull/36) ([drwl](https://github.com/drwl)) +- Improve tests for `ColumnAnnotation::*` [\#35](https://github.com/drwl/annotate_rb/pull/35) ([drwl](https://github.com/drwl)) +- Change instances of `Options.from` =\> `Options.new` in tests [\#34](https://github.com/drwl/annotate_rb/pull/34) ([drwl](https://github.com/drwl)) +- Add `Standard` linter to project [\#33](https://github.com/drwl/annotate_rb/pull/33) ([drwl](https://github.com/drwl)) +- Support Sorbet `typed` magic comment [\#32](https://github.com/drwl/annotate_rb/pull/32) ([drwl](https://github.com/drwl)) +- Add `position_in_additional_file_patterns` to Options and Parser [\#31](https://github.com/drwl/annotate_rb/pull/31) ([drwl](https://github.com/drwl)) +- Remove `Files` gem as a dependency [\#30](https://github.com/drwl/annotate_rb/pull/30) ([drwl](https://github.com/drwl)) +- Refactor `ModelAnnotator` again [\#28](https://github.com/drwl/annotate_rb/pull/28) ([drwl](https://github.com/drwl)) +- Add initial change log [\#27](https://github.com/drwl/annotate_rb/pull/27) ([drwl](https://github.com/drwl)) -## [v4.1.1](https://github.com/drwl/annotaterb/tree/v4.1.1) (2023-05-20) +## [v4.1.1](https://github.com/drwl/annotate_rb/tree/v4.1.1) (2023-05-20) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.1.0...v4.1.1) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.1.0...v4.1.1) **Merged pull requests:** -- Bump version to v4.1.1 [\#26](https://github.com/drwl/annotaterb/pull/26) ([drwl](https://github.com/drwl)) -- Tidy the github repo [\#25](https://github.com/drwl/annotaterb/pull/25) ([drwl](https://github.com/drwl)) -- Add guide for migrating from Annotate gem [\#24](https://github.com/drwl/annotaterb/pull/24) ([drwl](https://github.com/drwl)) -- Update column pattern regex to incorporate special column comments [\#23](https://github.com/drwl/annotaterb/pull/23) ([drwl](https://github.com/drwl)) +- Bump version to v4.1.1 [\#26](https://github.com/drwl/annotate_rb/pull/26) ([drwl](https://github.com/drwl)) +- Tidy the github repo [\#25](https://github.com/drwl/annotate_rb/pull/25) ([drwl](https://github.com/drwl)) +- Add guide for migrating from Annotate gem [\#24](https://github.com/drwl/annotate_rb/pull/24) ([drwl](https://github.com/drwl)) +- Update column pattern regex to incorporate special column comments [\#23](https://github.com/drwl/annotate_rb/pull/23) ([drwl](https://github.com/drwl)) -## [v4.1.0](https://github.com/drwl/annotaterb/tree/v4.1.0) (2023-05-17) +## [v4.1.0](https://github.com/drwl/annotate_rb/tree/v4.1.0) (2023-05-17) -[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.0.0...v4.1.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.0.0...v4.1.0) **Merged pull requests:** -- Bump version to 4.1.0 [\#22](https://github.com/drwl/annotaterb/pull/22) ([drwl](https://github.com/drwl)) -- Refactor ModelAnnotator; Fix instances of incorrect `exclude_*` keys [\#21](https://github.com/drwl/annotaterb/pull/21) ([drwl](https://github.com/drwl)) -- Fix the default behavior for model annotator [\#20](https://github.com/drwl/annotaterb/pull/20) ([drwl](https://github.com/drwl)) -- Refactor model annotator [\#19](https://github.com/drwl/annotaterb/pull/19) ([drwl](https://github.com/drwl)) -- Removed unused helper methods and `Env` class [\#18](https://github.com/drwl/annotaterb/pull/18) ([drwl](https://github.com/drwl)) -- Update dummy app depdencies [\#17](https://github.com/drwl/annotaterb/pull/17) ([drwl](https://github.com/drwl)) +- Bump version to 4.1.0 [\#22](https://github.com/drwl/annotate_rb/pull/22) ([drwl](https://github.com/drwl)) +- Refactor ModelAnnotator; Fix instances of incorrect `exclude_*` keys [\#21](https://github.com/drwl/annotate_rb/pull/21) ([drwl](https://github.com/drwl)) +- Fix the default behavior for model annotator [\#20](https://github.com/drwl/annotate_rb/pull/20) ([drwl](https://github.com/drwl)) +- Refactor model annotator [\#19](https://github.com/drwl/annotate_rb/pull/19) ([drwl](https://github.com/drwl)) +- Removed unused helper methods and `Env` class [\#18](https://github.com/drwl/annotate_rb/pull/18) ([drwl](https://github.com/drwl)) +- Update dummy app depdencies [\#17](https://github.com/drwl/annotate_rb/pull/17) ([drwl](https://github.com/drwl)) -## [v4.0.0](https://github.com/drwl/annotaterb/tree/v4.0.0) (2023-05-03) +## [v4.0.0](https://github.com/drwl/annotate_rb/tree/v4.0.0) (2023-05-03) -[Full Changelog](https://github.com/drwl/annotaterb/compare/1da0386bf9e1ca3fbd0d9d3ae69cdc7a8cdc26fa...v4.0.0) +[Full Changelog](https://github.com/drwl/annotate_rb/compare/1da0386bf9e1ca3fbd0d9d3ae69cdc7a8cdc26fa...v4.0.0) **Merged pull requests:** -- Last project polish for 4.0.0 release [\#14](https://github.com/drwl/annotaterb/pull/14) ([drwl](https://github.com/drwl)) -- Add configuration instructions to README [\#13](https://github.com/drwl/annotaterb/pull/13) ([drwl](https://github.com/drwl)) -- Prepare gem for beta release [\#12](https://github.com/drwl/annotaterb/pull/12) ([drwl](https://github.com/drwl)) -- Make annotaterb usable [\#11](https://github.com/drwl/annotaterb/pull/11) ([drwl](https://github.com/drwl)) -- Move old annotate code into AnnotateRb namespace [\#10](https://github.com/drwl/annotaterb/pull/10) ([drwl](https://github.com/drwl)) -- Fix CodeQL action [\#9](https://github.com/drwl/annotaterb/pull/9) ([drwl](https://github.com/drwl)) -- Regularly run CI [\#8](https://github.com/drwl/annotaterb/pull/8) ([drwl](https://github.com/drwl)) -- Get CI consistently green [\#7](https://github.com/drwl/annotaterb/pull/7) ([drwl](https://github.com/drwl)) -- More work [\#6](https://github.com/drwl/annotaterb/pull/6) ([drwl](https://github.com/drwl)) -- Make CI green [\#5](https://github.com/drwl/annotaterb/pull/5) ([drwl](https://github.com/drwl)) -- Make it work for Rails 7 [\#4](https://github.com/drwl/annotaterb/pull/4) ([drwl](https://github.com/drwl)) -- Tidy up project [\#3](https://github.com/drwl/annotaterb/pull/3) ([drwl](https://github.com/drwl)) -- Set spec run order to random [\#2](https://github.com/drwl/annotaterb/pull/2) ([drwl](https://github.com/drwl)) -- Tidy rspec configuration [\#1](https://github.com/drwl/annotaterb/pull/1) ([drwl](https://github.com/drwl)) +- Last project polish for 4.0.0 release [\#14](https://github.com/drwl/annotate_rb/pull/14) ([drwl](https://github.com/drwl)) +- Add configuration instructions to README [\#13](https://github.com/drwl/annotate_rb/pull/13) ([drwl](https://github.com/drwl)) +- Prepare gem for beta release [\#12](https://github.com/drwl/annotate_rb/pull/12) ([drwl](https://github.com/drwl)) +- Make annotate_rb usable [\#11](https://github.com/drwl/annotate_rb/pull/11) ([drwl](https://github.com/drwl)) +- Move old annotate code into AnnotateRb namespace [\#10](https://github.com/drwl/annotate_rb/pull/10) ([drwl](https://github.com/drwl)) +- Fix CodeQL action [\#9](https://github.com/drwl/annotate_rb/pull/9) ([drwl](https://github.com/drwl)) +- Regularly run CI [\#8](https://github.com/drwl/annotate_rb/pull/8) ([drwl](https://github.com/drwl)) +- Get CI consistently green [\#7](https://github.com/drwl/annotate_rb/pull/7) ([drwl](https://github.com/drwl)) +- More work [\#6](https://github.com/drwl/annotate_rb/pull/6) ([drwl](https://github.com/drwl)) +- Make CI green [\#5](https://github.com/drwl/annotate_rb/pull/5) ([drwl](https://github.com/drwl)) +- Make it work for Rails 7 [\#4](https://github.com/drwl/annotate_rb/pull/4) ([drwl](https://github.com/drwl)) +- Tidy up project [\#3](https://github.com/drwl/annotate_rb/pull/3) ([drwl](https://github.com/drwl)) +- Set spec run order to random [\#2](https://github.com/drwl/annotate_rb/pull/2) ([drwl](https://github.com/drwl)) +- Tidy rspec configuration [\#1](https://github.com/drwl/annotate_rb/pull/1) ([drwl](https://github.com/drwl)) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index 0455c812..dfcdc7b1 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -30,7 +30,7 @@ I have found integration tests hard to write because we are testing a command li Refer to git history for examples of previous commits. -When I run into errors with newly written integration tests, I run the gem in the context of the dummyapp (spec/dummyapp) using `DATABASE_ADAPTER=sqlite3 bundle exec annotaterb models` with debug statements. +When I run into errors with newly written integration tests, I run the gem in the context of the dummyapp (spec/dummyapp) using `DATABASE_ADAPTER=sqlite3 bundle exec annotate_rb models` with debug statements. ## Linter diff --git a/README.md b/README.md index a87c6307..2fc38b9c 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ A Ruby Gem that adds annotations to your Rails models and route files. ---------- -[![CI](https://github.com/drwl/annotaterb/actions/workflows/ci.yml/badge.svg)](https://github.com/drwl/annotaterb/actions/workflows/ci.yml) -[![Gem Version](https://badge.fury.io/rb/annotaterb.svg)](https://badge.fury.io/rb/annotaterb) +[![CI](https://github.com/drwl/annotate_rb/actions/workflows/ci.yml/badge.svg)](https://github.com/drwl/annotate_rb/actions/workflows/ci.yml) +[![Gem Version](https://badge.fury.io/rb/annotate_rb.svg)](https://badge.fury.io/rb/annotate_rb) Adds comments summarizing the model schema or routes in your: @@ -36,7 +36,7 @@ class Task < ApplicationRecord ## Installation ```sh -$ gem install annotaterb +$ gem install annotate_rb ``` Or install it into your Rails project through the Gemfile: @@ -45,7 +45,7 @@ Or install it into your Rails project through the Gemfile: group :development do ... - gem "annotaterb" + gem "annotate_rb" ... ``` @@ -83,7 +83,7 @@ AnnotateRb: ``` `bin/rails g annotate_rb:config` -- Generates a new configuration file, `.annotaterb.yml`, using defaults from the gem. +- Generates a new configuration file, `.annotate_rb.yml`, using defaults from the gem. `bin/rails g annotate_rb:hook` - Installs the Rake file to automatically annotate Rails models on a database task (e.g. AnnotateRb will automatically run after running `bin/rails db:migrate`). @@ -92,7 +92,7 @@ AnnotateRb: - Runs the `config` and `hook` generator commands `bin/rails g annotate_rb:update_config` -- Appends to `.annotaterb.yml` any configuration key-value pairs that are used by the Gem. This is useful when there's a drift between the config file values and the gem defaults (i.e. when new features get added). +- Appends to `.annotate_rb.yml` any configuration key-value pairs that are used by the Gem. This is useful when there's a drift between the config file values and the gem defaults (i.e. when new features get added). ## Migrating from the annotate gem Refer to the [migration guide](MIGRATION_GUIDE.md). @@ -103,9 +103,9 @@ AnnotateRb has a CLI that you can use to add or remove annotations. ```sh # To show the CLI options -$ bundle exec annotaterb +$ bundle exec annotate_rb -Usage: annotaterb [command] [options] +Usage: annotate_rb [command] [options] Commands: models [options] @@ -118,7 +118,7 @@ Options: -h, --help You're looking at it. Annotate model options: - Usage: annotaterb models [options] + Usage: annotate_rb models [options] -a, --active-admin Annotate active_admin models --show-migration Include the migration version number in the annotation @@ -136,7 +136,7 @@ Annotate model options: --with-comment include database comments in model annotations Annotate routes options: - Usage: annotaterb routes [options] + Usage: annotate_rb routes [options] --ignore-routes REGEX don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'` --timestamp Include timestamp in (routes) annotation @@ -184,10 +184,10 @@ Additional options that work for annotating models and routes ## Configuration ### Storing default options -Previously in the [Annotate](https://github.com/ctran/annotate_models) you could pass options through the CLI or store them as environment variables. Annotaterb removes dependency on the environment variables and instead can read values from a `.annotaterb.yml` file stored in the Rails project root. +Previously in the [Annotate](https://github.com/ctran/annotate_models) you could pass options through the CLI or store them as environment variables. Annotaterb removes dependency on the environment variables and instead can read values from a `.annotate_rb.yml` file stored in the Rails project root. ```yml -# .annotaterb.yml +# .annotate_rb.yml position: after ``` diff --git a/VERSION b/VERSION index 01b73abe..28cbf7c0 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -4.13.0 \ No newline at end of file +5.0.0 \ No newline at end of file diff --git a/annotaterb.gemspec b/annotate_rb.gemspec similarity index 86% rename from annotaterb.gemspec rename to annotate_rb.gemspec index 8cb30a08..1469d4ef 100644 --- a/annotaterb.gemspec +++ b/annotate_rb.gemspec @@ -1,5 +1,5 @@ Gem::Specification.new do |spec| - spec.name = "annotaterb" + spec.name = "annotate_rb" spec.version = File.read("VERSION").strip spec.authors = ["Andrew W. Lee"] spec.email = ["git@drewlee.com"] @@ -10,14 +10,14 @@ Gem::Specification.new do |spec| spec.description = <<~DESCRIPTION.strip Annotates Rails/ActiveRecord Models, routes, fixtures, and others based on the database schema. DESCRIPTION - spec.homepage = "https://github.com/drwl/annotaterb" + spec.homepage = "https://github.com/drwl/annotate_rb" spec.license = "BSD-2-Clause" spec.required_ruby_version = ">= 2.7.0" spec.metadata["homepage_uri"] = spec.homepage - spec.metadata["source_code_uri"] = "https://github.com/drwl/annotaterb" - spec.metadata["changelog_uri"] = "https://github.com/drwl/annotaterb/blob/master/CHANGELOG.md" - spec.metadata["bug_tracker_uri"] = "https://github.com/drwl/annotaterb/issues" + spec.metadata["source_code_uri"] = "https://github.com/drwl/annotate_rb" + spec.metadata["changelog_uri"] = "https://github.com/drwl/annotate_rb/blob/master/CHANGELOG.md" + spec.metadata["bug_tracker_uri"] = "https://github.com/drwl/annotate_rb/issues" spec.metadata["rubygems_mfa_required"] = "true" spec.files = Dir["VERSION", "CHANGELOG.md", "LICENSE.txt", "README.md", "lib/**/*"] diff --git a/exe/annotaterb b/exe/annotate_rb similarity index 83% rename from exe/annotaterb rename to exe/annotate_rb index a152c0b4..33e30434 100755 --- a/exe/annotaterb +++ b/exe/annotate_rb @@ -2,7 +2,7 @@ # frozen_string_literal: true if !File.exist?("./Rakefile") && !File.exist?("./Gemfile") - abort "Please run annotaterb from the root of the project." + abort "Please run annotate_rb from the root of the project." end begin diff --git a/lib/annotate_rb.rb b/lib/annotate_rb.rb index 9a180878..ce35d475 100644 --- a/lib/annotate_rb.rb +++ b/lib/annotate_rb.rb @@ -1,28 +1,4 @@ -# frozen_string_literal: true +# Gem names that follow naming convention work seamlessly. However, this gem is "annotate_rb" where in code it is +# AnnotateRb. Because of this, we need this file so that the rest of the library automatically gets required. -require "active_record" -require "active_support" - -# Helper.fallback depends on this being required because it adds #present? to nil -require "active_support/core_ext/object/blank" -require "active_support/core_ext/class/subclasses" -require "active_support/core_ext/string/inflections" - -require "rake" - -require_relative "annotate_rb/helper" -require_relative "annotate_rb/core" -require_relative "annotate_rb/commands" -require_relative "annotate_rb/parser" -require_relative "annotate_rb/runner" -require_relative "annotate_rb/route_annotator" -require_relative "annotate_rb/model_annotator" -require_relative "annotate_rb/options" -require_relative "annotate_rb/eager_loader" -require_relative "annotate_rb/rake_bootstrapper" -require_relative "annotate_rb/config_finder" -require_relative "annotate_rb/config_loader" -require_relative "annotate_rb/config_generator" - -module AnnotateRb -end +require "annotate_rb" diff --git a/lib/annotate_rb/config_finder.rb b/lib/annotate_rb/config_finder.rb index cba01014..8d352483 100644 --- a/lib/annotate_rb/config_finder.rb +++ b/lib/annotate_rb/config_finder.rb @@ -2,12 +2,12 @@ module AnnotateRb class ConfigFinder - DOTFILE = ".annotaterb.yml" + DOTFILE = ".annotate_rb.yml" class << self def find_project_root # We should expect this method to be called from a Rails project root and returning it - # e.g. "/Users/drwl/personal/annotaterb/dummyapp" + # e.g. "/Users/drwl/personal/annotate_rb/dummyapp" Dir.pwd end diff --git a/lib/annotate_rb/model_annotator/model_files_getter.rb b/lib/annotate_rb/model_annotator/model_files_getter.rb index 307db8e0..5389cdbe 100644 --- a/lib/annotate_rb/model_annotator/model_files_getter.rb +++ b/lib/annotate_rb/model_annotator/model_files_getter.rb @@ -30,7 +30,7 @@ def call(options) rescue SystemCallError warn "No models found in directory '#{options[:model_dir].join("', '")}'." warn "Either specify models on the command line, or use the --model-dir option." - warn "Call 'annotaterb --help' for more info." + warn "Call 'annotate_rb --help' for more info." # exit 1 # TODO: Return exit code back to caller. Right now it messes up RSpec being able to run end @@ -50,7 +50,7 @@ def list_model_files_from_argument(options) if model_files.size != specified_files.size warn "The specified file could not be found in directory '#{options[:model_dir].join("', '")}'." - warn "Call 'annotaterb --help' for more info." + warn "Call 'annotate_rb --help' for more info." # exit 1 # TODO: Return exit code back to caller. Right now it messes up RSpec being able to run end diff --git a/lib/annotate_rb/model_annotator/single_file_annotator.rb b/lib/annotate_rb/model_annotator/single_file_annotator.rb index 941aeaab..84c2565e 100644 --- a/lib/annotate_rb/model_annotator/single_file_annotator.rb +++ b/lib/annotate_rb/model_annotator/single_file_annotator.rb @@ -38,7 +38,7 @@ def call(file_name, annotation, annotation_position, options) return false if parsed_file.has_skip_string? return false if !parsed_file.annotations_changed? && !options[:force] - abort "AnnotateRb error. #{file_name} needs to be updated, but annotaterb was run with `--frozen`." if options[:frozen] + abort "AnnotateRb error. #{file_name} needs to be updated, but annotate_rb was run with `--frozen`." if options[:frozen] updated_file_content = if !parsed_file.has_annotations? AnnotatedFile::Generator.new(old_content, annotation, annotation_position, parser_klass, parsed_file, options).generate diff --git a/lib/annotate_rb/options.rb b/lib/annotate_rb/options.rb index 45b7724a..c8f72fc1 100644 --- a/lib/annotate_rb/options.rb +++ b/lib/annotate_rb/options.rb @@ -226,7 +226,7 @@ def print # Guard against user inputting strings instead of symbols def symbolize_exclude_tests # `:exclude_tests` option is being expanded to function as a boolean OR an array of symbols - # https://github.com/drwl/annotaterb/issues/103 + # https://github.com/drwl/annotate_rb/issues/103 if @options[:exclude_tests].is_a?(Array) @options[:exclude_tests].map! do |item| diff --git a/lib/annotate_rb/parser.rb b/lib/annotate_rb/parser.rb index 86c5c769..f6667cd3 100644 --- a/lib/annotate_rb/parser.rb +++ b/lib/annotate_rb/parser.rb @@ -8,7 +8,7 @@ def self.parse(args, existing_options) end BANNER_STRING = <<~BANNER.freeze - Usage: annotaterb [command] [options] + Usage: annotate_rb [command] [options] Commands: models [options] @@ -160,7 +160,7 @@ def add_utils_to_parser(option_parser) def add_model_options_to_parser(option_parser) option_parser.separator("") option_parser.separator("Annotate model options:") - option_parser.separator(" " * 4 + "Usage: annotaterb models [options]") + option_parser.separator(" " * 4 + "Usage: annotate_rb models [options]") option_parser.separator("") option_parser.on("-a", @@ -269,7 +269,7 @@ def add_model_options_to_parser(option_parser) def add_route_options_to_parser(option_parser) option_parser.separator("") option_parser.separator("Annotate routes options:") - option_parser.separator(" " * 4 + "Usage: annotaterb routes [options]") + option_parser.separator(" " * 4 + "Usage: annotate_rb routes [options]") option_parser.separator("") option_parser.on("--ignore-routes REGEX", diff --git a/lib/annotaterb.rb b/lib/annotaterb.rb deleted file mode 100644 index 13cc5a19..00000000 --- a/lib/annotaterb.rb +++ /dev/null @@ -1,4 +0,0 @@ -# Gem names that follow naming convention work seamlessly. However, this gem is "annotaterb" where in code it is -# AnnotateRb. Because of this, we need this file so that the rest of the library automatically gets required. - -require "annotate_rb" diff --git a/lib/generators/annotate_rb/config/USAGE b/lib/generators/annotate_rb/config/USAGE index e94a9ab8..6d5bea03 100644 --- a/lib/generators/annotate_rb/config/USAGE +++ b/lib/generators/annotate_rb/config/USAGE @@ -1,5 +1,5 @@ Description: - Generates a default configuration file, `.annotaterb.yml` in your + Generates a default configuration file, `.annotate_rb.yml` in your Rails app project root. Example: diff --git a/lib/generators/annotate_rb/update_config/USAGE b/lib/generators/annotate_rb/update_config/USAGE index f9f92ae4..a2f194a2 100644 --- a/lib/generators/annotate_rb/update_config/USAGE +++ b/lib/generators/annotate_rb/update_config/USAGE @@ -1,5 +1,5 @@ Description: - Appends to .annotaterb.yml any missing default configuration + Appends to .annotate_rb.yml any missing default configuration key-value pairs. Example: diff --git a/spec/dummyapp/Gemfile b/spec/dummyapp/Gemfile index 3412a90d..df291292 100644 --- a/spec/dummyapp/Gemfile +++ b/spec/dummyapp/Gemfile @@ -38,7 +38,7 @@ group :development, :test do end group :development do - gem "annotaterb", path: "../../" + gem "annotate_rb", path: "../../" # Use console on exceptions pages [https://github.com/rails/web-console] gem "web-console" diff --git a/spec/dummyapp/config/database.yml b/spec/dummyapp/config/database.yml index a77b734b..a4f5b5d3 100644 --- a/spec/dummyapp/config/database.yml +++ b/spec/dummyapp/config/database.yml @@ -10,7 +10,7 @@ development: primary: <<: *default - database: annotaterb_development + database: annotate_rb_development <% end %> <% if ENV['DATABASE_ADAPTER'] == 'pg' %> @@ -25,7 +25,7 @@ development: primary: <<: *default - database: annotaterb_development + database: annotate_rb_development <% end %> <% if ENV['DATABASE_ADAPTER'] == 'sqlite3' %> diff --git a/spec/integration/annotate_after_migration_spec.rb b/spec/integration/annotate_after_migration_spec.rb index 455bbe54..36cc072e 100644 --- a/spec/integration/annotate_after_migration_spec.rb +++ b/spec/integration/annotate_after_migration_spec.rb @@ -24,7 +24,7 @@ # Apply this specific migration _run_migrations_cmd = run_command_and_stop("bin/rails db:migrate:up VERSION=20231013230731", fail_on_error: true, exit_timeout: command_timeout_seconds) - _run_annotations_cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _run_annotations_cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_default = read_file(dummyapp_model("test_default.rb")) diff --git a/spec/integration/annotate_collapsed_models_spec.rb b/spec/integration/annotate_collapsed_models_spec.rb index 4fdd0bef..57b2be32 100644 --- a/spec/integration/annotate_collapsed_models_spec.rb +++ b/spec/integration/annotate_collapsed_models_spec.rb @@ -17,7 +17,7 @@ expect(expected_test_model).not_to eq(original_test_model) - _cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_model = read_file(dummyapp_model("collapsed/example/test_model.rb")) diff --git a/spec/integration/annotate_file_with_existing_annotations_spec.rb b/spec/integration/annotate_file_with_existing_annotations_spec.rb index e0ade884..9a953b31 100644 --- a/spec/integration/annotate_file_with_existing_annotations_spec.rb +++ b/spec/integration/annotate_file_with_existing_annotations_spec.rb @@ -24,7 +24,7 @@ expect(expected_test_default).not_to eq(original_test_default) _cmd = run_command_and_stop( - "bundle exec annotaterb models #{model_file} --force --position bottom", + "bundle exec annotate_rb models #{model_file} --force --position bottom", fail_on_error: true, exit_timeout: command_timeout_seconds ) diff --git a/spec/integration/annotate_model_with_foreign_key_spec.rb b/spec/integration/annotate_model_with_foreign_key_spec.rb index f7db7131..0eee3ade 100644 --- a/spec/integration/annotate_model_with_foreign_key_spec.rb +++ b/spec/integration/annotate_model_with_foreign_key_spec.rb @@ -16,7 +16,7 @@ expect(expected_test_model).not_to eq(original_test_model) - _cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_model = read_file(dummyapp_model("test_child_default.rb")) diff --git a/spec/integration/annotate_routes_spec.rb b/spec/integration/annotate_routes_spec.rb index 562e566c..662f5ea3 100644 --- a/spec/integration/annotate_routes_spec.rb +++ b/spec/integration/annotate_routes_spec.rb @@ -15,7 +15,7 @@ # Check that files have been copied over correctly expect(expected_routes_file).not_to eq(original_routes_file) - _cmd = run_command_and_stop("bundle exec annotaterb routes", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotate_rb routes", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_routes_file = read_file(routes_file) diff --git a/spec/integration/annotate_single_file_spec.rb b/spec/integration/annotate_single_file_spec.rb index da2ed415..bc378474 100644 --- a/spec/integration/annotate_single_file_spec.rb +++ b/spec/integration/annotate_single_file_spec.rb @@ -22,7 +22,7 @@ expect(expected_test_default).not_to eq(original_test_default) expect(expected_test_null_false).not_to eq(original_test_null_false) - _cmd = run_command_and_stop("bundle exec annotaterb models #{model_file}", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotate_rb models #{model_file}", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_default = read_file(dummyapp_model("test_default.rb")) annotated_test_null_false = read_file(dummyapp_model("test_null_false.rb")) diff --git a/spec/integration/cli_spec.rb b/spec/integration/cli_spec.rb index 181cc9cc..adeb6d7c 100644 --- a/spec/integration/cli_spec.rb +++ b/spec/integration/cli_spec.rb @@ -12,10 +12,10 @@ remove("Gemfile") if exist?("Gemfile") end - let(:error_message) { "Please run annotaterb from the root of the project." } + let(:error_message) { "Please run annotate_rb from the root of the project." } it "exits and outputs an error message" do - _cmd = run_command("bundle exec annotaterb") + _cmd = run_command("bundle exec annotate_rb") expect(last_command_started).to have_exit_status(1) expect(last_command_started).to have_output_on_stderr(error_message) @@ -23,10 +23,10 @@ end context "when running in a directory with a Rakefile and a Gemfile" do - let(:help_banner_fragment) { "Usage: annotaterb [command] [options]" } + let(:help_banner_fragment) { "Usage: annotate_rb [command] [options]" } it "outputs the help message" do - _cmd = run_command("bundle exec annotaterb", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command("bundle exec annotate_rb", fail_on_error: true, exit_timeout: command_timeout_seconds) expect(last_command_started).to be_successfully_executed expect(last_command_started.stdout).to include(help_banner_fragment) @@ -45,7 +45,7 @@ expect(expected_test_default).not_to eq(original_test_default) expect(expected_test_null_false).not_to eq(original_test_null_false) - _cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_default = read_file(dummyapp_model("test_default.rb")) annotated_test_null_false = read_file(dummyapp_model("test_null_false.rb")) diff --git a/spec/integration/rails_generator_install_spec.rb b/spec/integration/rails_generator_install_spec.rb index 08c55dce..3b04e188 100644 --- a/spec/integration/rails_generator_install_spec.rb +++ b/spec/integration/rails_generator_install_spec.rb @@ -5,7 +5,7 @@ let(:rake_task_file) { "lib/tasks/annotate_rb.rake" } let(:rake_task) { File.join(aruba.config.root_directory, "lib/generators/annotate_rb/hook/templates/annotate_rb.rake") } - let(:config_file) { ".annotaterb.yml" } + let(:config_file) { ".annotate_rb.yml" } let(:generator_install_command) { "bin/rails generate annotate_rb:install" } diff --git a/spec/integration/rails_generator_update_config_spec.rb b/spec/integration/rails_generator_update_config_spec.rb index 7ecccf05..bd93fbec 100644 --- a/spec/integration/rails_generator_update_config_spec.rb +++ b/spec/integration/rails_generator_update_config_spec.rb @@ -5,7 +5,7 @@ RSpec.describe "Generator appends to config file", type: "aruba" do let(:command_timeout_seconds) { 10 } - let(:config_file) { ".annotaterb.yml" } + let(:config_file) { ".annotate_rb.yml" } let(:config_file_content) do <<~YML.strip --- diff --git a/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb b/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb index 3ea17cc5..8a61a5ec 100644 --- a/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb +++ b/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb @@ -23,7 +23,7 @@ class User < ActiveRecord::Base # TODO: Check out why this test fails due to test pollution describe "frozen option" do it "should abort without existing annotation when frozen: true " do - expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotaterb was run with `--frozen`./ + expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotate_rb was run with `--frozen`./ end it "should abort with different annotation when frozen: true " do @@ -36,7 +36,7 @@ class User < ActiveRecord::Base @schema_info = another_schema_info - expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotaterb was run with `--frozen`./ + expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotate_rb was run with `--frozen`./ end it "should NOT abort with same annotation when frozen: true " do diff --git a/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb b/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb index 0dd2669a..53225ca4 100644 --- a/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb +++ b/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb @@ -24,7 +24,7 @@ end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end diff --git a/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb b/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb index 804923da..4fc2c164 100644 --- a/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb +++ b/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb @@ -3,7 +3,7 @@ subject { described_class.call(path) } let(:tmpdir) do - Dir.mktmpdir("annotaterb") + Dir.mktmpdir("annotate_rb") end let(:filename) { "some_file.rb" } diff --git a/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb b/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb index e85388cc..a9f0a2b5 100644 --- a/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb +++ b/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb @@ -37,7 +37,7 @@ class User < ActiveRecord::Base end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -87,7 +87,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -139,7 +139,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -190,7 +190,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -244,7 +244,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -295,7 +295,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) @klass = mock_class(:users, @@ -363,7 +363,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.yml", starting_file_content) end @@ -422,7 +422,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotaterb") + @model_dir = Dir.mktmpdir("annotate_rb") (@model_file_name, _file_content) = write_model("user.yml", starting_file_content) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 5ae5f40f..570a318e 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -21,8 +21,8 @@ config.before(:example, type: :aruba) do copy_dummy_app_into_aruba_working_directory - # Unset the bundler context from running annotaterb integration specs. - # This way, when `run_command("bundle exec annotaterb")` runs, it runs as if it's within the context of dummyapp. + # Unset the bundler context from running annotate_rb integration specs. + # This way, when `run_command("bundle exec annotate_rb")` runs, it runs as if it's within the context of dummyapp. unset_bundler_env_vars end From 3606d0a4f93f1670906593e2acfbf95b1ca8ef13 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Wed, 5 Feb 2025 16:12:52 -0800 Subject: [PATCH 02/17] update changelog --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index e694fdad..f0759074 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ # Changelog +## [v5.0.0](...) (XXXX) +- changed all references for `annotaterb` to `annotate_rb`, for consistency + ## [v4.13.0](https://github.com/drwl/annotate_rb/tree/v4.13.0) (2024-10-21) [Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.12.0...v4.13.0) From f094adc50b13f8d68965f985415efd2dabf0c09d Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Wed, 5 Feb 2025 16:16:37 -0800 Subject: [PATCH 03/17] put correct things in lib --- lib/annotate_rb.rb | 28 +++++++++++++++++++++++++--- 1 file changed, 25 insertions(+), 3 deletions(-) diff --git a/lib/annotate_rb.rb b/lib/annotate_rb.rb index ce35d475..754e75c5 100644 --- a/lib/annotate_rb.rb +++ b/lib/annotate_rb.rb @@ -1,4 +1,26 @@ -# Gem names that follow naming convention work seamlessly. However, this gem is "annotate_rb" where in code it is -# AnnotateRb. Because of this, we need this file so that the rest of the library automatically gets required. +require "active_record" +require "active_support" -require "annotate_rb" +# Helper.fallback depends on this being required because it adds #present? to nil +require "active_support/core_ext/object/blank" +require "active_support/core_ext/class/subclasses" +require "active_support/core_ext/string/inflections" + +require "rake" + +require_relative "annotate_rb/helper" +require_relative "annotate_rb/core" +require_relative "annotate_rb/commands" +require_relative "annotate_rb/parser" +require_relative "annotate_rb/runner" +require_relative "annotate_rb/route_annotator" +require_relative "annotate_rb/model_annotator" +require_relative "annotate_rb/options" +require_relative "annotate_rb/eager_loader" +require_relative "annotate_rb/rake_bootstrapper" +require_relative "annotate_rb/config_finder" +require_relative "annotate_rb/config_loader" +require_relative "annotate_rb/config_generator" + +module AnnotateRb +end From d57fdfa40bbd98a154c40ec594793f679e6a3d38 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Wed, 5 Feb 2025 16:23:13 -0800 Subject: [PATCH 04/17] revert unnecessary changes --- CHANGELOG.md | 374 ++++++++++++++++++++++----------------------- lib/annotate_rb.rb | 2 + 2 files changed, 189 insertions(+), 187 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f0759074..b36047da 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,321 +3,321 @@ ## [v5.0.0](...) (XXXX) - changed all references for `annotaterb` to `annotate_rb`, for consistency -## [v4.13.0](https://github.com/drwl/annotate_rb/tree/v4.13.0) (2024-10-21) +## [v4.13.0](https://github.com/drwl/annotaterb/tree/v4.13.0) (2024-10-21) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.12.0...v4.13.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.12.0...v4.13.0) **Closed issues:** -- Bug: Bigint are reported as integer [\#157](https://github.com/drwl/annotate_rb/issues/157) -- Bug \(apparently\): :ignore\_columns does not work \(with any syntax I've tried\) [\#154](https://github.com/drwl/annotate_rb/issues/154) +- Bug: Bigint are reported as integer [\#157](https://github.com/drwl/annotaterb/issues/157) +- Bug \(apparently\): :ignore\_columns does not work \(with any syntax I've tried\) [\#154](https://github.com/drwl/annotaterb/issues/154) **Merged pull requests:** -- Bump version to v4.13.0 [\#159](https://github.com/drwl/annotate_rb/pull/159) ([drwl](https://github.com/drwl)) -- Support parsing of dynamic fixture erb yml files [\#158](https://github.com/drwl/annotate_rb/pull/158) ([drwl](https://github.com/drwl)) -- Fix updating of indexes containing escaped characters [\#156](https://github.com/drwl/annotate_rb/pull/156) ([antonivanopoulos](https://github.com/antonivanopoulos)) -- Add model with association and foreign key to dummyapp [\#153](https://github.com/drwl/annotate_rb/pull/153) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.12.0 [\#152](https://github.com/drwl/annotate_rb/pull/152) ([drwl](https://github.com/drwl)) +- Bump version to v4.13.0 [\#159](https://github.com/drwl/annotaterb/pull/159) ([drwl](https://github.com/drwl)) +- Support parsing of dynamic fixture erb yml files [\#158](https://github.com/drwl/annotaterb/pull/158) ([drwl](https://github.com/drwl)) +- Fix updating of indexes containing escaped characters [\#156](https://github.com/drwl/annotaterb/pull/156) ([antonivanopoulos](https://github.com/antonivanopoulos)) +- Add model with association and foreign key to dummyapp [\#153](https://github.com/drwl/annotaterb/pull/153) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.12.0 [\#152](https://github.com/drwl/annotaterb/pull/152) ([drwl](https://github.com/drwl)) -## [v4.12.0](https://github.com/drwl/annotate_rb/tree/v4.12.0) (2024-09-15) +## [v4.12.0](https://github.com/drwl/annotaterb/tree/v4.12.0) (2024-09-15) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.11.0...v4.12.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.11.0...v4.12.0) **Merged pull requests:** -- Bump version to v4.12.0 [\#151](https://github.com/drwl/annotate_rb/pull/151) ([drwl](https://github.com/drwl)) -- Support postgres NULLS NOT DISTINCT clause in unique index [\#148](https://github.com/drwl/annotate_rb/pull/148) ([ENewmeration](https://github.com/ENewmeration)) -- Generate changelog for v4.11.0 [\#147](https://github.com/drwl/annotate_rb/pull/147) ([drwl](https://github.com/drwl)) +- Bump version to v4.12.0 [\#151](https://github.com/drwl/annotaterb/pull/151) ([drwl](https://github.com/drwl)) +- Support postgres NULLS NOT DISTINCT clause in unique index [\#148](https://github.com/drwl/annotaterb/pull/148) ([ENewmeration](https://github.com/ENewmeration)) +- Generate changelog for v4.11.0 [\#147](https://github.com/drwl/annotaterb/pull/147) ([drwl](https://github.com/drwl)) -## [v4.11.0](https://github.com/drwl/annotate_rb/tree/v4.11.0) (2024-08-16) +## [v4.11.0](https://github.com/drwl/annotaterb/tree/v4.11.0) (2024-08-16) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.10.2...v4.11.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.2...v4.11.0) **Closed issues:** -- Include the length of comments in max\_schema\_info\_width only when the with\_column\_comments option is true. [\#144](https://github.com/drwl/annotate_rb/issues/144) -- Rakefile seems to be loaded twice [\#130](https://github.com/drwl/annotate_rb/issues/130) +- Include the length of comments in max\_schema\_info\_width only when the with\_column\_comments option is true. [\#144](https://github.com/drwl/annotaterb/issues/144) +- Rakefile seems to be loaded twice [\#130](https://github.com/drwl/annotaterb/issues/130) **Merged pull requests:** -- Bump version to v4.11.0 [\#146](https://github.com/drwl/annotate_rb/pull/146) ([drwl](https://github.com/drwl)) -- Include the length of comments in max\_schema\_info\_width only when the with\_comment and with\_column\_comments option is true. [\#145](https://github.com/drwl/annotate_rb/pull/145) ([shibaaaa](https://github.com/shibaaaa)) -- Add Ruby 3.3 to CI [\#143](https://github.com/drwl/annotate_rb/pull/143) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.10.2 [\#142](https://github.com/drwl/annotate_rb/pull/142) ([drwl](https://github.com/drwl)) +- Bump version to v4.11.0 [\#146](https://github.com/drwl/annotaterb/pull/146) ([drwl](https://github.com/drwl)) +- Include the length of comments in max\_schema\_info\_width only when the with\_comment and with\_column\_comments option is true. [\#145](https://github.com/drwl/annotaterb/pull/145) ([shibaaaa](https://github.com/shibaaaa)) +- Add Ruby 3.3 to CI [\#143](https://github.com/drwl/annotaterb/pull/143) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.10.2 [\#142](https://github.com/drwl/annotaterb/pull/142) ([drwl](https://github.com/drwl)) -## [v4.10.2](https://github.com/drwl/annotate_rb/tree/v4.10.2) (2024-07-23) +## [v4.10.2](https://github.com/drwl/annotaterb/tree/v4.10.2) (2024-07-23) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.10.1...v4.10.2) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.1...v4.10.2) **Closed issues:** -- Composite primary keys are unsupported [\#138](https://github.com/drwl/annotate_rb/issues/138) +- Composite primary keys are unsupported [\#138](https://github.com/drwl/annotaterb/issues/138) **Merged pull requests:** -- Bump version to v4.10.2 [\#141](https://github.com/drwl/annotate_rb/pull/141) ([drwl](https://github.com/drwl)) -- Fix double-loading of Rakefile [\#140](https://github.com/drwl/annotate_rb/pull/140) ([dmke](https://github.com/dmke)) -- Change structure of model annotation builder [\#136](https://github.com/drwl/annotate_rb/pull/136) ([drwl](https://github.com/drwl)) -- Refactor model annotation components [\#134](https://github.com/drwl/annotate_rb/pull/134) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.10.1 [\#133](https://github.com/drwl/annotate_rb/pull/133) ([drwl](https://github.com/drwl)) +- Bump version to v4.10.2 [\#141](https://github.com/drwl/annotaterb/pull/141) ([drwl](https://github.com/drwl)) +- Fix double-loading of Rakefile [\#140](https://github.com/drwl/annotaterb/pull/140) ([dmke](https://github.com/dmke)) +- Change structure of model annotation builder [\#136](https://github.com/drwl/annotaterb/pull/136) ([drwl](https://github.com/drwl)) +- Refactor model annotation components [\#134](https://github.com/drwl/annotaterb/pull/134) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.10.1 [\#133](https://github.com/drwl/annotaterb/pull/133) ([drwl](https://github.com/drwl)) -## [v4.10.1](https://github.com/drwl/annotate_rb/tree/v4.10.1) (2024-07-07) +## [v4.10.1](https://github.com/drwl/annotaterb/tree/v4.10.1) (2024-07-07) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.10.0...v4.10.1) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.10.0...v4.10.1) **Merged pull requests:** -- Bump version to v4.10.1 [\#132](https://github.com/drwl/annotate_rb/pull/132) ([drwl](https://github.com/drwl)) -- Correct uses of `respond_to` in AnnotationDecider [\#131](https://github.com/drwl/annotate_rb/pull/131) ([andreccosta](https://github.com/andreccosta)) -- Generate changelog for v4.10.0 [\#129](https://github.com/drwl/annotate_rb/pull/129) ([drwl](https://github.com/drwl)) +- Bump version to v4.10.1 [\#132](https://github.com/drwl/annotaterb/pull/132) ([drwl](https://github.com/drwl)) +- Correct uses of `respond_to` in AnnotationDecider [\#131](https://github.com/drwl/annotaterb/pull/131) ([andreccosta](https://github.com/andreccosta)) +- Generate changelog for v4.10.0 [\#129](https://github.com/drwl/annotaterb/pull/129) ([drwl](https://github.com/drwl)) -## [v4.10.0](https://github.com/drwl/annotate_rb/tree/v4.10.0) (2024-06-28) +## [v4.10.0](https://github.com/drwl/annotaterb/tree/v4.10.0) (2024-06-28) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.9.0...v4.10.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.9.0...v4.10.0) **Closed issues:** -- Feature Request: add support for arrays when using StoreModel [\#125](https://github.com/drwl/annotate_rb/issues/125) -- Error on composite foreign key constraints [\#121](https://github.com/drwl/annotate_rb/issues/121) +- Feature Request: add support for arrays when using StoreModel [\#125](https://github.com/drwl/annotaterb/issues/125) +- Error on composite foreign key constraints [\#121](https://github.com/drwl/annotaterb/issues/121) **Merged pull requests:** -- Bump version to v4.10.0 [\#128](https://github.com/drwl/annotate_rb/pull/128) ([drwl](https://github.com/drwl)) -- Support composite foreign keys [\#126](https://github.com/drwl/annotate_rb/pull/126) ([drwl](https://github.com/drwl)) -- Add files to improve other's ability to help the project [\#123](https://github.com/drwl/annotate_rb/pull/123) ([drwl](https://github.com/drwl)) -- Add database and adapter to issue template [\#122](https://github.com/drwl/annotate_rb/pull/122) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.9.0 [\#120](https://github.com/drwl/annotate_rb/pull/120) ([drwl](https://github.com/drwl)) +- Bump version to v4.10.0 [\#128](https://github.com/drwl/annotaterb/pull/128) ([drwl](https://github.com/drwl)) +- Support composite foreign keys [\#126](https://github.com/drwl/annotaterb/pull/126) ([drwl](https://github.com/drwl)) +- Add files to improve other's ability to help the project [\#123](https://github.com/drwl/annotaterb/pull/123) ([drwl](https://github.com/drwl)) +- Add database and adapter to issue template [\#122](https://github.com/drwl/annotaterb/pull/122) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.9.0 [\#120](https://github.com/drwl/annotaterb/pull/120) ([drwl](https://github.com/drwl)) -## [v4.9.0](https://github.com/drwl/annotate_rb/tree/v4.9.0) (2024-05-29) +## [v4.9.0](https://github.com/drwl/annotaterb/tree/v4.9.0) (2024-05-29) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.8.0...v4.9.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.8.0...v4.9.0) **Closed issues:** -- Duplicate content in fixtures when annotating models [\#108](https://github.com/drwl/annotate_rb/issues/108) -- Cannot exclude annotations from serializer specs [\#103](https://github.com/drwl/annotate_rb/issues/103) +- Duplicate content in fixtures when annotating models [\#108](https://github.com/drwl/annotaterb/issues/108) +- Cannot exclude annotations from serializer specs [\#103](https://github.com/drwl/annotaterb/issues/103) **Merged pull requests:** -- Bump version to v4.9.0 [\#119](https://github.com/drwl/annotate_rb/pull/119) ([drwl](https://github.com/drwl)) -- Add support for `NOT VALID` constraints [\#118](https://github.com/drwl/annotate_rb/pull/118) ([gmcabrita](https://github.com/gmcabrita)) -- Generate changelog for v4.8.0 [\#116](https://github.com/drwl/annotate_rb/pull/116) ([drwl](https://github.com/drwl)) +- Bump version to v4.9.0 [\#119](https://github.com/drwl/annotaterb/pull/119) ([drwl](https://github.com/drwl)) +- Add support for `NOT VALID` constraints [\#118](https://github.com/drwl/annotaterb/pull/118) ([gmcabrita](https://github.com/gmcabrita)) +- Generate changelog for v4.8.0 [\#116](https://github.com/drwl/annotaterb/pull/116) ([drwl](https://github.com/drwl)) -## [v4.8.0](https://github.com/drwl/annotate_rb/tree/v4.8.0) (2024-05-14) +## [v4.8.0](https://github.com/drwl/annotaterb/tree/v4.8.0) (2024-05-14) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.7.1...v4.8.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.7.1...v4.8.0) **Closed issues:** -- Nested module models and unexpected annotations [\#106](https://github.com/drwl/annotate_rb/issues/106) +- Nested module models and unexpected annotations [\#106](https://github.com/drwl/annotaterb/issues/106) **Merged pull requests:** -- Bump version to v4.8.0 [\#115](https://github.com/drwl/annotate_rb/pull/115) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.7.1 [\#114](https://github.com/drwl/annotate_rb/pull/114) ([drwl](https://github.com/drwl)) -- Support annotating model fixture files [\#110](https://github.com/drwl/annotate_rb/pull/110) ([drwl](https://github.com/drwl)) -- Make `exclude_tests` option able to override other exclude options [\#107](https://github.com/drwl/annotate_rb/pull/107) ([drwl](https://github.com/drwl)) +- Bump version to v4.8.0 [\#115](https://github.com/drwl/annotaterb/pull/115) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.7.1 [\#114](https://github.com/drwl/annotaterb/pull/114) ([drwl](https://github.com/drwl)) +- Support annotating model fixture files [\#110](https://github.com/drwl/annotaterb/pull/110) ([drwl](https://github.com/drwl)) +- Make `exclude_tests` option able to override other exclude options [\#107](https://github.com/drwl/annotaterb/pull/107) ([drwl](https://github.com/drwl)) -## [v4.7.1](https://github.com/drwl/annotate_rb/tree/v4.7.1) (2024-05-09) +## [v4.7.1](https://github.com/drwl/annotaterb/tree/v4.7.1) (2024-05-09) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.7.0...v4.7.1) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.7.0...v4.7.1) **Closed issues:** -- Check constraint support [\#104](https://github.com/drwl/annotate_rb/issues/104) +- Check constraint support [\#104](https://github.com/drwl/annotaterb/issues/104) **Merged pull requests:** -- Bump version to v4.7.1 [\#113](https://github.com/drwl/annotate_rb/pull/113) ([drwl](https://github.com/drwl)) -- Change AnnotationDecider to return false early [\#112](https://github.com/drwl/annotate_rb/pull/112) ([drwl](https://github.com/drwl)) -- Memoize ActiveRecord migrator version calls [\#111](https://github.com/drwl/annotate_rb/pull/111) ([drwl](https://github.com/drwl)) -- Fix misspelling in migration guide [\#109](https://github.com/drwl/annotate_rb/pull/109) ([RobinDaugherty](https://github.com/RobinDaugherty)) -- Annotate model check constraints [\#105](https://github.com/drwl/annotate_rb/pull/105) ([drwl](https://github.com/drwl)) -- Fix CHANGELOG.md [\#102](https://github.com/drwl/annotate_rb/pull/102) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.7.0 [\#101](https://github.com/drwl/annotate_rb/pull/101) ([drwl](https://github.com/drwl)) +- Bump version to v4.7.1 [\#113](https://github.com/drwl/annotaterb/pull/113) ([drwl](https://github.com/drwl)) +- Change AnnotationDecider to return false early [\#112](https://github.com/drwl/annotaterb/pull/112) ([drwl](https://github.com/drwl)) +- Memoize ActiveRecord migrator version calls [\#111](https://github.com/drwl/annotaterb/pull/111) ([drwl](https://github.com/drwl)) +- Fix misspelling in migration guide [\#109](https://github.com/drwl/annotaterb/pull/109) ([RobinDaugherty](https://github.com/RobinDaugherty)) +- Annotate model check constraints [\#105](https://github.com/drwl/annotaterb/pull/105) ([drwl](https://github.com/drwl)) +- Fix CHANGELOG.md [\#102](https://github.com/drwl/annotaterb/pull/102) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.7.0 [\#101](https://github.com/drwl/annotaterb/pull/101) ([drwl](https://github.com/drwl)) -## [v4.7.0](https://github.com/drwl/annotate_rb/tree/v4.7.0) (2024-03-27) +## [v4.7.0](https://github.com/drwl/annotaterb/tree/v4.7.0) (2024-03-27) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.6.0...v4.7.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.6.0...v4.7.0) **Closed issues:** -- Feature request: better custom type representation [\#97](https://github.com/drwl/annotate_rb/issues/97) +- Feature request: better custom type representation [\#97](https://github.com/drwl/annotaterb/issues/97) **Merged pull requests:** -- Bump version to v4.7.0 [\#100](https://github.com/drwl/annotate_rb/pull/100) ([drwl](https://github.com/drwl)) -- Add configurable classes list with `to_s` representation [\#98](https://github.com/drwl/annotate_rb/pull/98) ([viralpraxis](https://github.com/viralpraxis)) -- Generate changelog for v4.6.0 [\#96](https://github.com/drwl/annotate_rb/pull/96) ([drwl](https://github.com/drwl)) +- Bump version to v4.7.0 [\#100](https://github.com/drwl/annotaterb/pull/100) ([drwl](https://github.com/drwl)) +- Add configurable classes list with `to_s` representation [\#98](https://github.com/drwl/annotaterb/pull/98) ([viralpraxis](https://github.com/viralpraxis)) +- Generate changelog for v4.6.0 [\#96](https://github.com/drwl/annotaterb/pull/96) ([drwl](https://github.com/drwl)) -## [v4.6.0](https://github.com/drwl/annotate_rb/tree/v4.6.0) (2024-02-27) +## [v4.6.0](https://github.com/drwl/annotaterb/tree/v4.6.0) (2024-02-27) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.5.0...v4.6.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.5.0...v4.6.0) **Closed issues:** -- Add support for `data_migrate` gem [\#89](https://github.com/drwl/annotate_rb/issues/89) +- Add support for `data_migrate` gem [\#89](https://github.com/drwl/annotaterb/issues/89) **Merged pull requests:** -- Bump version to v4.6.0 [\#95](https://github.com/drwl/annotate_rb/pull/95) ([drwl](https://github.com/drwl)) -- Add support for parsing RSpec files [\#94](https://github.com/drwl/annotate_rb/pull/94) ([drwl](https://github.com/drwl)) -- Add support for model name without namespace in resolver [\#93](https://github.com/drwl/annotate_rb/pull/93) ([drwl](https://github.com/drwl)) -- Fixes for `RelatedFilesListBuilder` [\#92](https://github.com/drwl/annotate_rb/pull/92) ([drwl](https://github.com/drwl)) -- Refactor `AnnotatedFile` classes [\#91](https://github.com/drwl/annotate_rb/pull/91) ([drwl](https://github.com/drwl)) -- Add support for data\_migrate gem [\#90](https://github.com/drwl/annotate_rb/pull/90) ([cmer](https://github.com/cmer)) -- Support non-model files in `CustomParser` [\#88](https://github.com/drwl/annotate_rb/pull/88) ([drwl](https://github.com/drwl)) -- Fix flakey integration test [\#87](https://github.com/drwl/annotate_rb/pull/87) ([drwl](https://github.com/drwl)) -- Improve integration tests [\#86](https://github.com/drwl/annotate_rb/pull/86) ([drwl](https://github.com/drwl)) -- Add Zeitwerk support [\#85](https://github.com/drwl/annotate_rb/pull/85) ([drwl](https://github.com/drwl)) -- Improve annotate after adding new migration integration test [\#84](https://github.com/drwl/annotate_rb/pull/84) ([drwl](https://github.com/drwl)) -- Add integration test using force [\#81](https://github.com/drwl/annotate_rb/pull/81) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.5.0 [\#80](https://github.com/drwl/annotate_rb/pull/80) ([drwl](https://github.com/drwl)) -- Fix annotations swallowing comments [\#72](https://github.com/drwl/annotate_rb/pull/72) ([drwl](https://github.com/drwl)) - -## [v4.5.0](https://github.com/drwl/annotate_rb/tree/v4.5.0) (2024-02-08) - -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.4.1...v4.5.0) +- Bump version to v4.6.0 [\#95](https://github.com/drwl/annotaterb/pull/95) ([drwl](https://github.com/drwl)) +- Add support for parsing RSpec files [\#94](https://github.com/drwl/annotaterb/pull/94) ([drwl](https://github.com/drwl)) +- Add support for model name without namespace in resolver [\#93](https://github.com/drwl/annotaterb/pull/93) ([drwl](https://github.com/drwl)) +- Fixes for `RelatedFilesListBuilder` [\#92](https://github.com/drwl/annotaterb/pull/92) ([drwl](https://github.com/drwl)) +- Refactor `AnnotatedFile` classes [\#91](https://github.com/drwl/annotaterb/pull/91) ([drwl](https://github.com/drwl)) +- Add support for data\_migrate gem [\#90](https://github.com/drwl/annotaterb/pull/90) ([cmer](https://github.com/cmer)) +- Support non-model files in `CustomParser` [\#88](https://github.com/drwl/annotaterb/pull/88) ([drwl](https://github.com/drwl)) +- Fix flakey integration test [\#87](https://github.com/drwl/annotaterb/pull/87) ([drwl](https://github.com/drwl)) +- Improve integration tests [\#86](https://github.com/drwl/annotaterb/pull/86) ([drwl](https://github.com/drwl)) +- Add Zeitwerk support [\#85](https://github.com/drwl/annotaterb/pull/85) ([drwl](https://github.com/drwl)) +- Improve annotate after adding new migration integration test [\#84](https://github.com/drwl/annotaterb/pull/84) ([drwl](https://github.com/drwl)) +- Add integration test using force [\#81](https://github.com/drwl/annotaterb/pull/81) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.5.0 [\#80](https://github.com/drwl/annotaterb/pull/80) ([drwl](https://github.com/drwl)) +- Fix annotations swallowing comments [\#72](https://github.com/drwl/annotaterb/pull/72) ([drwl](https://github.com/drwl)) + +## [v4.5.0](https://github.com/drwl/annotaterb/tree/v4.5.0) (2024-02-08) + +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.4.1...v4.5.0) **Closed issues:** -- Add an automated way to migrate from the old annotate gem [\#73](https://github.com/drwl/annotate_rb/issues/73) -- Default array value is double-quoted/escaped [\#57](https://github.com/drwl/annotate_rb/issues/57) +- Add an automated way to migrate from the old annotate gem [\#73](https://github.com/drwl/annotaterb/issues/73) +- Default array value is double-quoted/escaped [\#57](https://github.com/drwl/annotaterb/issues/57) **Merged pull requests:** -- Bump version to v4.5.0 [\#79](https://github.com/drwl/annotate_rb/pull/79) ([drwl](https://github.com/drwl)) -- Update README on the new Rails generator commands [\#78](https://github.com/drwl/annotate_rb/pull/78) ([drwl](https://github.com/drwl)) -- Bump github/codeql-action from 2 to 3 [\#77](https://github.com/drwl/annotate_rb/pull/77) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Add command to generate a configuration file [\#76](https://github.com/drwl/annotate_rb/pull/76) ([drwl](https://github.com/drwl)) -- Bump actions/checkout from 3 to 4 [\#75](https://github.com/drwl/annotate_rb/pull/75) ([dependabot[bot]](https://github.com/apps/dependabot)) -- CI: Configure dependabot to update GH Actions [\#74](https://github.com/drwl/annotate_rb/pull/74) ([olleolleolle](https://github.com/olleolleolle)) -- Refactor `FileBuilder` and `MagicCommentParser` [\#71](https://github.com/drwl/annotate_rb/pull/71) ([drwl](https://github.com/drwl)) -- Test running annotations after a migration [\#70](https://github.com/drwl/annotate_rb/pull/70) ([drwl](https://github.com/drwl)) -- Add integration test for rake task installer [\#69](https://github.com/drwl/annotate_rb/pull/69) ([drwl](https://github.com/drwl)) -- Add integration test for annotating routes [\#68](https://github.com/drwl/annotate_rb/pull/68) ([drwl](https://github.com/drwl)) -- Remove optional args [\#67](https://github.com/drwl/annotate_rb/pull/67) ([drwl](https://github.com/drwl)) -- Remove optional arg from `AnnotationPatternGenerator` [\#66](https://github.com/drwl/annotate_rb/pull/66) ([drwl](https://github.com/drwl)) -- Remove `ARGV` use during runtime [\#65](https://github.com/drwl/annotate_rb/pull/65) ([drwl](https://github.com/drwl)) -- Add integration test for annotating a singular file [\#64](https://github.com/drwl/annotate_rb/pull/64) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.4.1 [\#63](https://github.com/drwl/annotate_rb/pull/63) ([drwl](https://github.com/drwl)) -- Add support for factory\_bot's default suffixed pattern [\#59](https://github.com/drwl/annotate_rb/pull/59) ([drwl](https://github.com/drwl)) - -## [v4.4.1](https://github.com/drwl/annotate_rb/tree/v4.4.1) (2023-09-11) - -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.4.0...v4.4.1) +- Bump version to v4.5.0 [\#79](https://github.com/drwl/annotaterb/pull/79) ([drwl](https://github.com/drwl)) +- Update README on the new Rails generator commands [\#78](https://github.com/drwl/annotaterb/pull/78) ([drwl](https://github.com/drwl)) +- Bump github/codeql-action from 2 to 3 [\#77](https://github.com/drwl/annotaterb/pull/77) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Add command to generate a configuration file [\#76](https://github.com/drwl/annotaterb/pull/76) ([drwl](https://github.com/drwl)) +- Bump actions/checkout from 3 to 4 [\#75](https://github.com/drwl/annotaterb/pull/75) ([dependabot[bot]](https://github.com/apps/dependabot)) +- CI: Configure dependabot to update GH Actions [\#74](https://github.com/drwl/annotaterb/pull/74) ([olleolleolle](https://github.com/olleolleolle)) +- Refactor `FileBuilder` and `MagicCommentParser` [\#71](https://github.com/drwl/annotaterb/pull/71) ([drwl](https://github.com/drwl)) +- Test running annotations after a migration [\#70](https://github.com/drwl/annotaterb/pull/70) ([drwl](https://github.com/drwl)) +- Add integration test for rake task installer [\#69](https://github.com/drwl/annotaterb/pull/69) ([drwl](https://github.com/drwl)) +- Add integration test for annotating routes [\#68](https://github.com/drwl/annotaterb/pull/68) ([drwl](https://github.com/drwl)) +- Remove optional args [\#67](https://github.com/drwl/annotaterb/pull/67) ([drwl](https://github.com/drwl)) +- Remove optional arg from `AnnotationPatternGenerator` [\#66](https://github.com/drwl/annotaterb/pull/66) ([drwl](https://github.com/drwl)) +- Remove `ARGV` use during runtime [\#65](https://github.com/drwl/annotaterb/pull/65) ([drwl](https://github.com/drwl)) +- Add integration test for annotating a singular file [\#64](https://github.com/drwl/annotaterb/pull/64) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.4.1 [\#63](https://github.com/drwl/annotaterb/pull/63) ([drwl](https://github.com/drwl)) +- Add support for factory\_bot's default suffixed pattern [\#59](https://github.com/drwl/annotaterb/pull/59) ([drwl](https://github.com/drwl)) + +## [v4.4.1](https://github.com/drwl/annotaterb/tree/v4.4.1) (2023-09-11) + +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.4.0...v4.4.1) **Merged pull requests:** -- Bump version to v4.4.1 [\#62](https://github.com/drwl/annotate_rb/pull/62) ([drwl](https://github.com/drwl)) -- Fix annotation for columns with `Date` and `DateTime` default values [\#61](https://github.com/drwl/annotate_rb/pull/61) ([drwl](https://github.com/drwl)) -- Add integration tests [\#60](https://github.com/drwl/annotate_rb/pull/60) ([drwl](https://github.com/drwl)) -- Fix the default array value from being escaped [\#58](https://github.com/drwl/annotate_rb/pull/58) ([drwl](https://github.com/drwl)) -- Update dummyapp Rails version [\#56](https://github.com/drwl/annotate_rb/pull/56) ([drwl](https://github.com/drwl)) -- Bump puma from 5.6.5 to 6.3.1 in /dummyapp [\#55](https://github.com/drwl/annotate_rb/pull/55) ([dependabot[bot]](https://github.com/apps/dependabot)) -- Generate changelog for v4.4.0 [\#53](https://github.com/drwl/annotate_rb/pull/53) ([drwl](https://github.com/drwl)) -- Add CLI specs using `aruba` gem [\#43](https://github.com/drwl/annotate_rb/pull/43) ([drwl](https://github.com/drwl)) +- Bump version to v4.4.1 [\#62](https://github.com/drwl/annotaterb/pull/62) ([drwl](https://github.com/drwl)) +- Fix annotation for columns with `Date` and `DateTime` default values [\#61](https://github.com/drwl/annotaterb/pull/61) ([drwl](https://github.com/drwl)) +- Add integration tests [\#60](https://github.com/drwl/annotaterb/pull/60) ([drwl](https://github.com/drwl)) +- Fix the default array value from being escaped [\#58](https://github.com/drwl/annotaterb/pull/58) ([drwl](https://github.com/drwl)) +- Update dummyapp Rails version [\#56](https://github.com/drwl/annotaterb/pull/56) ([drwl](https://github.com/drwl)) +- Bump puma from 5.6.5 to 6.3.1 in /dummyapp [\#55](https://github.com/drwl/annotaterb/pull/55) ([dependabot[bot]](https://github.com/apps/dependabot)) +- Generate changelog for v4.4.0 [\#53](https://github.com/drwl/annotaterb/pull/53) ([drwl](https://github.com/drwl)) +- Add CLI specs using `aruba` gem [\#43](https://github.com/drwl/annotaterb/pull/43) ([drwl](https://github.com/drwl)) -## [v4.4.0](https://github.com/drwl/annotate_rb/tree/v4.4.0) (2023-06-24) +## [v4.4.0](https://github.com/drwl/annotaterb/tree/v4.4.0) (2023-06-24) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.3.1...v4.4.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.3.1...v4.4.0) **Merged pull requests:** -- Bump version to v4.4.0 [\#52](https://github.com/drwl/annotate_rb/pull/52) ([drwl](https://github.com/drwl)) -- Flatten tests in `annotation_builder_spec.rb` [\#51](https://github.com/drwl/annotate_rb/pull/51) ([drwl](https://github.com/drwl)) -- Add support for table comments [\#50](https://github.com/drwl/annotate_rb/pull/50) ([drwl](https://github.com/drwl)) -- Improve some model annotator tests [\#49](https://github.com/drwl/annotate_rb/pull/49) ([drwl](https://github.com/drwl)) -- Make tests that use `mock_column` more accurate [\#48](https://github.com/drwl/annotate_rb/pull/48) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.3.1 [\#47](https://github.com/drwl/annotate_rb/pull/47) ([drwl](https://github.com/drwl)) +- Bump version to v4.4.0 [\#52](https://github.com/drwl/annotaterb/pull/52) ([drwl](https://github.com/drwl)) +- Flatten tests in `annotation_builder_spec.rb` [\#51](https://github.com/drwl/annotaterb/pull/51) ([drwl](https://github.com/drwl)) +- Add support for table comments [\#50](https://github.com/drwl/annotaterb/pull/50) ([drwl](https://github.com/drwl)) +- Improve some model annotator tests [\#49](https://github.com/drwl/annotaterb/pull/49) ([drwl](https://github.com/drwl)) +- Make tests that use `mock_column` more accurate [\#48](https://github.com/drwl/annotaterb/pull/48) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.3.1 [\#47](https://github.com/drwl/annotaterb/pull/47) ([drwl](https://github.com/drwl)) -## [v4.3.1](https://github.com/drwl/annotate_rb/tree/v4.3.1) (2023-06-15) +## [v4.3.1](https://github.com/drwl/annotaterb/tree/v4.3.1) (2023-06-15) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.3.0...v4.3.1) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.3.0...v4.3.1) **Closed issues:** -- Column defaults change in migration [\#45](https://github.com/drwl/annotate_rb/issues/45) +- Column defaults change in migration [\#45](https://github.com/drwl/annotaterb/issues/45) **Merged pull requests:** -- Bump version to v4.3.1 [\#46](https://github.com/drwl/annotate_rb/pull/46) ([drwl](https://github.com/drwl)) -- Prettify column defaults [\#44](https://github.com/drwl/annotate_rb/pull/44) ([drwl](https://github.com/drwl)) -- Generate changelog for v4.3.0 [\#42](https://github.com/drwl/annotate_rb/pull/42) ([drwl](https://github.com/drwl)) +- Bump version to v4.3.1 [\#46](https://github.com/drwl/annotaterb/pull/46) ([drwl](https://github.com/drwl)) +- Prettify column defaults [\#44](https://github.com/drwl/annotaterb/pull/44) ([drwl](https://github.com/drwl)) +- Generate changelog for v4.3.0 [\#42](https://github.com/drwl/annotaterb/pull/42) ([drwl](https://github.com/drwl)) -## [v4.3.0](https://github.com/drwl/annotate_rb/tree/v4.3.0) (2023-06-10) +## [v4.3.0](https://github.com/drwl/annotaterb/tree/v4.3.0) (2023-06-10) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.2.0...v4.3.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.2.0...v4.3.0) **Merged pull requests:** -- Bump version to v4.3.0 [\#41](https://github.com/drwl/annotate_rb/pull/41) ([drwl](https://github.com/drwl)) -- Add `ANNOTATERB_SKIP_ON_DB_TASKS` ENV var to skip auto annotations [\#40](https://github.com/drwl/annotate_rb/pull/40) ([drwl](https://github.com/drwl)) +- Bump version to v4.3.0 [\#41](https://github.com/drwl/annotaterb/pull/41) ([drwl](https://github.com/drwl)) +- Add `ANNOTATERB_SKIP_ON_DB_TASKS` ENV var to skip auto annotations [\#40](https://github.com/drwl/annotaterb/pull/40) ([drwl](https://github.com/drwl)) -## [v4.2.0](https://github.com/drwl/annotate_rb/tree/v4.2.0) (2023-06-02) +## [v4.2.0](https://github.com/drwl/annotaterb/tree/v4.2.0) (2023-06-02) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.1.1...v4.2.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.1.1...v4.2.0) **Merged pull requests:** -- Specify `standard` gem version [\#39](https://github.com/drwl/annotate_rb/pull/39) ([drwl](https://github.com/drwl)) -- Generate changelog for 4.2 again [\#38](https://github.com/drwl/annotate_rb/pull/38) ([drwl](https://github.com/drwl)) -- Bump version to v4.2.0 [\#37](https://github.com/drwl/annotate_rb/pull/37) ([drwl](https://github.com/drwl)) -- Generate changelog for 4.2 [\#36](https://github.com/drwl/annotate_rb/pull/36) ([drwl](https://github.com/drwl)) -- Improve tests for `ColumnAnnotation::*` [\#35](https://github.com/drwl/annotate_rb/pull/35) ([drwl](https://github.com/drwl)) -- Change instances of `Options.from` =\> `Options.new` in tests [\#34](https://github.com/drwl/annotate_rb/pull/34) ([drwl](https://github.com/drwl)) -- Add `Standard` linter to project [\#33](https://github.com/drwl/annotate_rb/pull/33) ([drwl](https://github.com/drwl)) -- Support Sorbet `typed` magic comment [\#32](https://github.com/drwl/annotate_rb/pull/32) ([drwl](https://github.com/drwl)) -- Add `position_in_additional_file_patterns` to Options and Parser [\#31](https://github.com/drwl/annotate_rb/pull/31) ([drwl](https://github.com/drwl)) -- Remove `Files` gem as a dependency [\#30](https://github.com/drwl/annotate_rb/pull/30) ([drwl](https://github.com/drwl)) -- Refactor `ModelAnnotator` again [\#28](https://github.com/drwl/annotate_rb/pull/28) ([drwl](https://github.com/drwl)) -- Add initial change log [\#27](https://github.com/drwl/annotate_rb/pull/27) ([drwl](https://github.com/drwl)) +- Specify `standard` gem version [\#39](https://github.com/drwl/annotaterb/pull/39) ([drwl](https://github.com/drwl)) +- Generate changelog for 4.2 again [\#38](https://github.com/drwl/annotaterb/pull/38) ([drwl](https://github.com/drwl)) +- Bump version to v4.2.0 [\#37](https://github.com/drwl/annotaterb/pull/37) ([drwl](https://github.com/drwl)) +- Generate changelog for 4.2 [\#36](https://github.com/drwl/annotaterb/pull/36) ([drwl](https://github.com/drwl)) +- Improve tests for `ColumnAnnotation::*` [\#35](https://github.com/drwl/annotaterb/pull/35) ([drwl](https://github.com/drwl)) +- Change instances of `Options.from` =\> `Options.new` in tests [\#34](https://github.com/drwl/annotaterb/pull/34) ([drwl](https://github.com/drwl)) +- Add `Standard` linter to project [\#33](https://github.com/drwl/annotaterb/pull/33) ([drwl](https://github.com/drwl)) +- Support Sorbet `typed` magic comment [\#32](https://github.com/drwl/annotaterb/pull/32) ([drwl](https://github.com/drwl)) +- Add `position_in_additional_file_patterns` to Options and Parser [\#31](https://github.com/drwl/annotaterb/pull/31) ([drwl](https://github.com/drwl)) +- Remove `Files` gem as a dependency [\#30](https://github.com/drwl/annotaterb/pull/30) ([drwl](https://github.com/drwl)) +- Refactor `ModelAnnotator` again [\#28](https://github.com/drwl/annotaterb/pull/28) ([drwl](https://github.com/drwl)) +- Add initial change log [\#27](https://github.com/drwl/annotaterb/pull/27) ([drwl](https://github.com/drwl)) -## [v4.1.1](https://github.com/drwl/annotate_rb/tree/v4.1.1) (2023-05-20) +## [v4.1.1](https://github.com/drwl/annotaterb/tree/v4.1.1) (2023-05-20) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.1.0...v4.1.1) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.1.0...v4.1.1) **Merged pull requests:** -- Bump version to v4.1.1 [\#26](https://github.com/drwl/annotate_rb/pull/26) ([drwl](https://github.com/drwl)) -- Tidy the github repo [\#25](https://github.com/drwl/annotate_rb/pull/25) ([drwl](https://github.com/drwl)) -- Add guide for migrating from Annotate gem [\#24](https://github.com/drwl/annotate_rb/pull/24) ([drwl](https://github.com/drwl)) -- Update column pattern regex to incorporate special column comments [\#23](https://github.com/drwl/annotate_rb/pull/23) ([drwl](https://github.com/drwl)) +- Bump version to v4.1.1 [\#26](https://github.com/drwl/annotaterb/pull/26) ([drwl](https://github.com/drwl)) +- Tidy the github repo [\#25](https://github.com/drwl/annotaterb/pull/25) ([drwl](https://github.com/drwl)) +- Add guide for migrating from Annotate gem [\#24](https://github.com/drwl/annotaterb/pull/24) ([drwl](https://github.com/drwl)) +- Update column pattern regex to incorporate special column comments [\#23](https://github.com/drwl/annotaterb/pull/23) ([drwl](https://github.com/drwl)) -## [v4.1.0](https://github.com/drwl/annotate_rb/tree/v4.1.0) (2023-05-17) +## [v4.1.0](https://github.com/drwl/annotaterb/tree/v4.1.0) (2023-05-17) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/v4.0.0...v4.1.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/v4.0.0...v4.1.0) **Merged pull requests:** -- Bump version to 4.1.0 [\#22](https://github.com/drwl/annotate_rb/pull/22) ([drwl](https://github.com/drwl)) -- Refactor ModelAnnotator; Fix instances of incorrect `exclude_*` keys [\#21](https://github.com/drwl/annotate_rb/pull/21) ([drwl](https://github.com/drwl)) -- Fix the default behavior for model annotator [\#20](https://github.com/drwl/annotate_rb/pull/20) ([drwl](https://github.com/drwl)) -- Refactor model annotator [\#19](https://github.com/drwl/annotate_rb/pull/19) ([drwl](https://github.com/drwl)) -- Removed unused helper methods and `Env` class [\#18](https://github.com/drwl/annotate_rb/pull/18) ([drwl](https://github.com/drwl)) -- Update dummy app depdencies [\#17](https://github.com/drwl/annotate_rb/pull/17) ([drwl](https://github.com/drwl)) +- Bump version to 4.1.0 [\#22](https://github.com/drwl/annotaterb/pull/22) ([drwl](https://github.com/drwl)) +- Refactor ModelAnnotator; Fix instances of incorrect `exclude_*` keys [\#21](https://github.com/drwl/annotaterb/pull/21) ([drwl](https://github.com/drwl)) +- Fix the default behavior for model annotator [\#20](https://github.com/drwl/annotaterb/pull/20) ([drwl](https://github.com/drwl)) +- Refactor model annotator [\#19](https://github.com/drwl/annotaterb/pull/19) ([drwl](https://github.com/drwl)) +- Removed unused helper methods and `Env` class [\#18](https://github.com/drwl/annotaterb/pull/18) ([drwl](https://github.com/drwl)) +- Update dummy app depdencies [\#17](https://github.com/drwl/annotaterb/pull/17) ([drwl](https://github.com/drwl)) -## [v4.0.0](https://github.com/drwl/annotate_rb/tree/v4.0.0) (2023-05-03) +## [v4.0.0](https://github.com/drwl/annotaterb/tree/v4.0.0) (2023-05-03) -[Full Changelog](https://github.com/drwl/annotate_rb/compare/1da0386bf9e1ca3fbd0d9d3ae69cdc7a8cdc26fa...v4.0.0) +[Full Changelog](https://github.com/drwl/annotaterb/compare/1da0386bf9e1ca3fbd0d9d3ae69cdc7a8cdc26fa...v4.0.0) **Merged pull requests:** -- Last project polish for 4.0.0 release [\#14](https://github.com/drwl/annotate_rb/pull/14) ([drwl](https://github.com/drwl)) -- Add configuration instructions to README [\#13](https://github.com/drwl/annotate_rb/pull/13) ([drwl](https://github.com/drwl)) -- Prepare gem for beta release [\#12](https://github.com/drwl/annotate_rb/pull/12) ([drwl](https://github.com/drwl)) -- Make annotate_rb usable [\#11](https://github.com/drwl/annotate_rb/pull/11) ([drwl](https://github.com/drwl)) -- Move old annotate code into AnnotateRb namespace [\#10](https://github.com/drwl/annotate_rb/pull/10) ([drwl](https://github.com/drwl)) -- Fix CodeQL action [\#9](https://github.com/drwl/annotate_rb/pull/9) ([drwl](https://github.com/drwl)) -- Regularly run CI [\#8](https://github.com/drwl/annotate_rb/pull/8) ([drwl](https://github.com/drwl)) -- Get CI consistently green [\#7](https://github.com/drwl/annotate_rb/pull/7) ([drwl](https://github.com/drwl)) -- More work [\#6](https://github.com/drwl/annotate_rb/pull/6) ([drwl](https://github.com/drwl)) -- Make CI green [\#5](https://github.com/drwl/annotate_rb/pull/5) ([drwl](https://github.com/drwl)) -- Make it work for Rails 7 [\#4](https://github.com/drwl/annotate_rb/pull/4) ([drwl](https://github.com/drwl)) -- Tidy up project [\#3](https://github.com/drwl/annotate_rb/pull/3) ([drwl](https://github.com/drwl)) -- Set spec run order to random [\#2](https://github.com/drwl/annotate_rb/pull/2) ([drwl](https://github.com/drwl)) -- Tidy rspec configuration [\#1](https://github.com/drwl/annotate_rb/pull/1) ([drwl](https://github.com/drwl)) +- Last project polish for 4.0.0 release [\#14](https://github.com/drwl/annotaterb/pull/14) ([drwl](https://github.com/drwl)) +- Add configuration instructions to README [\#13](https://github.com/drwl/annotaterb/pull/13) ([drwl](https://github.com/drwl)) +- Prepare gem for beta release [\#12](https://github.com/drwl/annotaterb/pull/12) ([drwl](https://github.com/drwl)) +- Make annotaterb usable [\#11](https://github.com/drwl/annotaterb/pull/11) ([drwl](https://github.com/drwl)) +- Move old annotate code into AnnotateRb namespace [\#10](https://github.com/drwl/annotaterb/pull/10) ([drwl](https://github.com/drwl)) +- Fix CodeQL action [\#9](https://github.com/drwl/annotaterb/pull/9) ([drwl](https://github.com/drwl)) +- Regularly run CI [\#8](https://github.com/drwl/annotaterb/pull/8) ([drwl](https://github.com/drwl)) +- Get CI consistently green [\#7](https://github.com/drwl/annotaterb/pull/7) ([drwl](https://github.com/drwl)) +- More work [\#6](https://github.com/drwl/annotaterb/pull/6) ([drwl](https://github.com/drwl)) +- Make CI green [\#5](https://github.com/drwl/annotaterb/pull/5) ([drwl](https://github.com/drwl)) +- Make it work for Rails 7 [\#4](https://github.com/drwl/annotaterb/pull/4) ([drwl](https://github.com/drwl)) +- Tidy up project [\#3](https://github.com/drwl/annotaterb/pull/3) ([drwl](https://github.com/drwl)) +- Set spec run order to random [\#2](https://github.com/drwl/annotaterb/pull/2) ([drwl](https://github.com/drwl)) +- Tidy rspec configuration [\#1](https://github.com/drwl/annotaterb/pull/1) ([drwl](https://github.com/drwl)) diff --git a/lib/annotate_rb.rb b/lib/annotate_rb.rb index 754e75c5..9a180878 100644 --- a/lib/annotate_rb.rb +++ b/lib/annotate_rb.rb @@ -1,3 +1,5 @@ +# frozen_string_literal: true + require "active_record" require "active_support" From 8ff8ef0a04f347468e2b46630df6454f13c3287e Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Wed, 5 Feb 2025 16:26:21 -0800 Subject: [PATCH 05/17] find file if it's annotaterb.yml --- lib/annotate_rb/config_finder.rb | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/lib/annotate_rb/config_finder.rb b/lib/annotate_rb/config_finder.rb index 8d352483..734880c3 100644 --- a/lib/annotate_rb/config_finder.rb +++ b/lib/annotate_rb/config_finder.rb @@ -3,6 +3,7 @@ module AnnotateRb class ConfigFinder DOTFILE = ".annotate_rb.yml" + LEGACY_DOTFILE = ".annotaterb.yml" class << self def find_project_root @@ -13,8 +14,13 @@ def find_project_root def find_project_dotfile file_path = File.expand_path(DOTFILE, find_project_root) + legacy_file_path = File.expand_path(LEGACY_DOTFILE, find_project_root) - return file_path if File.exist?(file_path) + if File.exist?(file_path) + file_path + elsif File.exist?(legacy_file_path) + legacy_file_path + end end end end From 4705b0c2c0818bab97e25568d9aeaaee99a6508d Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Wed, 5 Feb 2025 16:35:26 -0800 Subject: [PATCH 06/17] lint --- .gitignore | 1 + lib/annotate_rb/config_finder.rb | 2 +- 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.gitignore b/.gitignore index e2ca8b3b..b6949ebb 100644 --- a/.gitignore +++ b/.gitignore @@ -4,6 +4,7 @@ .gems .rbenv-version .ruby-* +.tool-versions .idea/ /.rbx /.rvmrc diff --git a/lib/annotate_rb/config_finder.rb b/lib/annotate_rb/config_finder.rb index 734880c3..da44fa40 100644 --- a/lib/annotate_rb/config_finder.rb +++ b/lib/annotate_rb/config_finder.rb @@ -17,7 +17,7 @@ def find_project_dotfile legacy_file_path = File.expand_path(LEGACY_DOTFILE, find_project_root) if File.exist?(file_path) - file_path + file_path elsif File.exist?(legacy_file_path) legacy_file_path end From a947916dff1eab2c1b570a8b57020fb24337c797 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Wed, 5 Feb 2025 16:51:10 -0800 Subject: [PATCH 07/17] update MIGRATION_GUIDE --- MIGRATION_GUIDE.md | 26 +++++++++++++------------- 1 file changed, 13 insertions(+), 13 deletions(-) diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 82dd2bf8..c69b00ca 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -16,18 +16,18 @@ Annotate provided 3 ways for passing options to the gem. ---------- ### Command line differences -Previously, Annotate allowed you to annotate both model and route files in the same command. In an attempt to make the CLI easier to use, they are now separate. The following output is what you see when running annotaterb without any options. +Previously, Annotate allowed you to annotate both model and route files in the same command. In an attempt to make the CLI easier to use, they are now separate. The following output is what you see when running annotate_rb without any options. **Note: most of the options are similar with the following differences:** -* `--models` has been removed, to annotate models use `annotaterb models [options]` instead -* `-r`, `--routes` has been removed, to annotate routes use `annotaterb routes [options]` instead +* `--models` has been removed, to annotate models use `annotate_rb models [options]` instead +* `-r`, `--routes` has been removed, to annotate routes use `annotate_rb routes [options]` instead -If you notice any differences please [report an issue](https://github.com/drwl/annotaterb/issues/new) or [submit a pull request](https://github.com/drwl/annotaterb/pulls) to update this document. +If you notice any differences please [report an issue](https://github.com/drwl/annotate_rb/issues/new) or [submit a pull request](https://github.com/drwl/annotate_rb/pulls) to update this document. ```sh -$ bundle exec annotaterb +$ bundle exec annotate_rb -Usage: annotaterb [command] [options] +Usage: annotate_rb [command] [options] Commands: models [options] @@ -40,7 +40,7 @@ Options: -h, --help You're looking at it. Annotate model options: - Usage: annotaterb models [options] + Usage: annotate_rb models [options] -a, --active-admin Annotate active_admin models --show-migration Include the migration version number in the annotation @@ -48,7 +48,7 @@ Annotate model options: ... Annotate routes options: - Usage: annotaterb routes [options] + Usage: annotate_rb routes [options] --ignore-routes REGEX don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'` ... @@ -74,17 +74,17 @@ Additional options that work for annotating models and routes ### Passing options via Environment Variables Annotate also reads options from ENV. For example, this command line argument `ANNOTATE_SKIP_ON_DB_MIGRATE=1 rake db:migrate` would affect Annotate's behavior. -The reading from ENV / environment variables has **been removed** in favor of reading configuration from `.annotaterb.yml` file in your Rails project root. +The reading from ENV / environment variables has **been removed** in favor of reading configuration from `.annotate_rb.yml` file in your Rails project root. ```yml -# .annotaterb.yml +# .annotate_rb.yml position: after ``` This change was done to reduce complexity in configuration and make the gem easier to maintain. -**Note: `.annotaterb.yml` is optional.** In its, AnnotateRb will use command line arguments and then the defaults. The defaults are implemented in `AnnotateRb::Options`. +**Note: `.annotate_rb.yml` is optional.** In its, AnnotateRb will use command line arguments and then the defaults. The defaults are implemented in `AnnotateRb::Options`. ---------- @@ -116,8 +116,8 @@ $ bin/rails g annotate_rb:install to install AnnotateRb's equivalent file into your Rails project. -#### Default .annotaterb.yml -When running the install generator command, `bin/rails g annotate_rb:install`, an `.annotaterb.yml` file gets automatically generated for your project using the defaults from the gem. +#### Default .annotate_rb.yml +When running the install generator command, `bin/rails g annotate_rb:install`, an `.annotate_rb.yml` file gets automatically generated for your project using the defaults from the gem. It _should_ match the old Annotate defaults however there may be differences. From 5eae700a00b43042b0a22113ec57872635739143 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 24 Feb 2025 11:30:18 -0800 Subject: [PATCH 08/17] rename the skip env variable too --- README.md | 4 ++-- lib/generators/annotate_rb/hook/templates/annotate_rb.rake | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 2fc38b9c..ae6ad0cf 100644 --- a/README.md +++ b/README.md @@ -59,10 +59,10 @@ $ bin/rails g annotate_rb:install This will copy a rake task into your Rails project's `lib/tasks` directory that will hook into the Rails project rake tasks, automatically running AnnotateRb after database migration rake tasks. -To skip the automatic annotation that happens after a db task, pass the environment variable `ANNOTATERB_SKIP_ON_DB_TASKS=1` before your command. +To skip the automatic annotation that happens after a db task, pass the environment variable `ANNOTATE_RB_SKIP_ON_DB_TASKS=1` before your command. ```sh -$ ANNOTATERB_SKIP_ON_DB_TASKS=1 bin/rails db:migrate +$ ANNOTATE_RB_SKIP_ON_DB_TASKS=1 bin/rails db:migrate ``` ### Added Rails generators diff --git a/lib/generators/annotate_rb/hook/templates/annotate_rb.rake b/lib/generators/annotate_rb/hook/templates/annotate_rb.rake index 1ad0ec39..e2efd133 100644 --- a/lib/generators/annotate_rb/hook/templates/annotate_rb.rake +++ b/lib/generators/annotate_rb/hook/templates/annotate_rb.rake @@ -1,7 +1,7 @@ # This rake task was added by annotate_rb gem. -# Can set `ANNOTATERB_SKIP_ON_DB_TASKS` to be anything to skip this -if Rails.env.development? && ENV["ANNOTATERB_SKIP_ON_DB_TASKS"].nil? +# Can set `ANNOTATE_RB_SKIP_ON_DB_TASKS` to be anything to skip this +if Rails.env.development? && ENV["ANNOTATE_RB_SKIP_ON_DB_TASKS"].nil? require "annotate_rb" AnnotateRb::Core.load_rake_tasks From e1f2a4ee2f3947cb5ebf0ae15fe79d385c42fbed Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:01:07 -0700 Subject: [PATCH 09/17] idk, does the unrenamed executable work? --- exe/{annotate_rb => annotaterb} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename exe/{annotate_rb => annotaterb} (100%) diff --git a/exe/annotate_rb b/exe/annotaterb similarity index 100% rename from exe/annotate_rb rename to exe/annotaterb From 2efeca00d7820b2d9ac29db6cdb3d2c9f0ce1e8f Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:05:09 -0700 Subject: [PATCH 10/17] revert gem name change --- annotate_rb.gemspec | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/annotate_rb.gemspec b/annotate_rb.gemspec index 520bdeff..3ff3d9d7 100644 --- a/annotate_rb.gemspec +++ b/annotate_rb.gemspec @@ -1,5 +1,5 @@ Gem::Specification.new do |spec| - spec.name = "annotate_rb" + spec.name = "annotaterb" spec.version = File.read("VERSION").strip spec.authors = ["Andrew W. Lee"] spec.email = ["git@drewlee.com"] From ceb70515d9e0d4223570e1d7d55002ada9cc4cd9 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:25:27 -0700 Subject: [PATCH 11/17] un-rename gemspec --- README.md | 18 +++++++++--------- annotate_rb.gemspec => annotaterb.gemspec | 0 spec/dummyapp/Gemfile | 2 +- 3 files changed, 10 insertions(+), 10 deletions(-) rename annotate_rb.gemspec => annotaterb.gemspec (100%) diff --git a/README.md b/README.md index e52f045a..8bc7f36e 100644 --- a/README.md +++ b/README.md @@ -4,8 +4,8 @@ A Ruby Gem that adds annotations to your Rails models and route files. ---------- -[![CI](https://github.com/drwl/annotate_rb/actions/workflows/ci.yml/badge.svg)](https://github.com/drwl/annotate_rb/actions/workflows/ci.yml) -[![Gem Version](https://badge.fury.io/rb/annotate_rb.svg)](https://badge.fury.io/rb/annotate_rb) +[![CI](https://github.com/drwl/annotaterb/actions/workflows/ci.yml/badge.svg)](https://github.com/drwl/annotaterb/actions/workflows/ci.yml) +[![Gem Version](https://badge.fury.io/rb/annotaterb.svg)](https://badge.fury.io/rb/annotaterb) Adds comments summarizing the model schema or routes in your: @@ -36,7 +36,7 @@ class Task < ApplicationRecord ## Installation ```sh -$ gem install annotate_rb +$ gem install annotaterb ``` Or install it into your Rails project through the Gemfile: @@ -45,7 +45,7 @@ Or install it into your Rails project through the Gemfile: group :development do ... - gem "annotate_rb" + gem "annotaterb" ... ``` @@ -103,9 +103,9 @@ AnnotateRb has a CLI that you can use to add or remove annotations. ```sh # To show the CLI options -$ bundle exec annotate_rb +$ bundle exec annotaterb -Usage: annotate_rb [command] [options] +Usage: annotaterb [command] [options] Commands: models [options] @@ -118,7 +118,7 @@ Options: -h, --help You're looking at it. Annotate model options: - Usage: annotate_rb models [options] + Usage: annotaterb models [options] -a, --active-admin Annotate active_admin models --show-migration Include the migration version number in the annotation @@ -136,7 +136,7 @@ Annotate model options: --with-comment include database comments in model annotations Annotate routes options: - Usage: annotate_rb routes [options] + Usage: annotaterb routes [options] --ignore-routes REGEX don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'` --timestamp Include timestamp in (routes) annotation @@ -149,7 +149,7 @@ Command options: Additional options that work for annotating models and routes --additional-file-patterns path1,path2,path3 - Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%MODEL_NAME%/*.rb,/baz/%MODEL_NAME%.rb`) + Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`) -d, --delete Remove annotations from all model files or the routes.rb file --model-dir dir Annotate model files stored in dir rather than app/models, separate multiple dirs with commas --root-dir dir Annotate files stored within root dir projects, separate multiple dirs with commas diff --git a/annotate_rb.gemspec b/annotaterb.gemspec similarity index 100% rename from annotate_rb.gemspec rename to annotaterb.gemspec diff --git a/spec/dummyapp/Gemfile b/spec/dummyapp/Gemfile index df291292..3412a90d 100644 --- a/spec/dummyapp/Gemfile +++ b/spec/dummyapp/Gemfile @@ -38,7 +38,7 @@ group :development, :test do end group :development do - gem "annotate_rb", path: "../../" + gem "annotaterb", path: "../../" # Use console on exceptions pages [https://github.com/rails/web-console] gem "web-console" From 2f2a1400cd9ada1248da23ed96852de2e112d9ab Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:33:16 -0700 Subject: [PATCH 12/17] lint --- exe/annotaterb | 2 +- lib/annotate_rb/model_annotator/annotation/schema_header.rb | 2 +- lib/annotate_rb/model_annotator/annotation_decider.rb | 2 +- .../model_annotator/column_annotation/annotation_builder.rb | 2 +- lib/annotate_rb/model_annotator/model_files_getter.rb | 2 +- lib/annotate_rb/parser.rb | 4 ++-- lib/annotate_rb/route_annotator/base_processor.rb | 2 +- lib/annotate_rb/route_annotator/header_generator.rb | 2 +- lib/annotate_rb/route_annotator/helper.rb | 2 +- spec/lib/annotate_rb/parser_spec.rb | 2 +- 10 files changed, 11 insertions(+), 11 deletions(-) diff --git a/exe/annotaterb b/exe/annotaterb index 33e30434..a152c0b4 100755 --- a/exe/annotaterb +++ b/exe/annotaterb @@ -2,7 +2,7 @@ # frozen_string_literal: true if !File.exist?("./Rakefile") && !File.exist?("./Gemfile") - abort "Please run annotate_rb from the root of the project." + abort "Please run annotaterb from the root of the project." end begin diff --git a/lib/annotate_rb/model_annotator/annotation/schema_header.rb b/lib/annotate_rb/model_annotator/annotation/schema_header.rb index dccfc1f6..6dec4105 100644 --- a/lib/annotate_rb/model_annotator/annotation/schema_header.rb +++ b/lib/annotate_rb/model_annotator/annotation/schema_header.rb @@ -52,7 +52,7 @@ def display_table_comments? def name if display_table_comments? && table_comment - formatted_comment = "(#{table_comment.gsub(/\n/, "\\n")})" + formatted_comment = "(#{table_comment.gsub("\n", "\\n")})" "#{table_name}#{formatted_comment}" else diff --git a/lib/annotate_rb/model_annotator/annotation_decider.rb b/lib/annotate_rb/model_annotator/annotation_decider.rb index e6bdc24e..f5442b46 100644 --- a/lib/annotate_rb/model_annotator/annotation_decider.rb +++ b/lib/annotate_rb/model_annotator/annotation_decider.rb @@ -26,7 +26,7 @@ def annotate? klass_is_not_abstract = klass.respond_to?(:abstract_class?) && !klass.abstract_class? klass_table_exists = klass.respond_to?(:table_exists?) && klass.table_exists? - not_sure_this_conditional = (!@options[:exclude_sti_subclasses] || !(klass.superclass < ActiveRecord::Base && klass.table_name == klass.superclass.table_name)) + not_sure_this_conditional = !@options[:exclude_sti_subclasses] || !(klass.superclass < ActiveRecord::Base && klass.table_name == klass.superclass.table_name) annotate_conditions = [ klass_is_a_class, diff --git a/lib/annotate_rb/model_annotator/column_annotation/annotation_builder.rb b/lib/annotate_rb/model_annotator/column_annotation/annotation_builder.rb index 18a4a788..a22e06d3 100644 --- a/lib/annotate_rb/model_annotator/column_annotation/annotation_builder.rb +++ b/lib/annotate_rb/model_annotator/column_annotation/annotation_builder.rb @@ -23,7 +23,7 @@ def build display_column_comments = @options[:with_comment] && @options[:with_column_comments] col_name = if display_column_comments && @model.with_comments? && @column.comment - "#{@column.name}(#{@column.comment.gsub(/\n/, '\\n')})" + "#{@column.name}(#{@column.comment.gsub("\n", '\\n')})" else @column.name end diff --git a/lib/annotate_rb/model_annotator/model_files_getter.rb b/lib/annotate_rb/model_annotator/model_files_getter.rb index bc7690c1..c0ef478c 100644 --- a/lib/annotate_rb/model_annotator/model_files_getter.rb +++ b/lib/annotate_rb/model_annotator/model_files_getter.rb @@ -62,4 +62,4 @@ def list_model_files_from_argument(options) end end end -end \ No newline at end of file +end diff --git a/lib/annotate_rb/parser.rb b/lib/annotate_rb/parser.rb index 6f01f6df..28f46489 100644 --- a/lib/annotate_rb/parser.rb +++ b/lib/annotate_rb/parser.rb @@ -412,14 +412,14 @@ def add_options_to_parser(option_parser) # rubocop:disable Metrics/MethodLength Array, "Do not annotate fixtures, test files, factories, and/or serializers") do |exclusions| exclusions ||= EXCLUSION_LIST - exclusions.each { |exclusion| @options["exclude_#{exclusion}".to_sym] = true } + exclusions.each { |exclusion| @options[:"exclude_#{exclusion}"] = true } end option_parser.on("-f", "--format [bare|rdoc|yard|markdown]", FORMAT_TYPES, "Render Schema Information as plain/RDoc/Yard/Markdown") do |format_type| - @options["format_#{format_type}".to_sym] = true + @options[:"format_#{format_type}"] = true end end end diff --git a/lib/annotate_rb/route_annotator/base_processor.rb b/lib/annotate_rb/route_annotator/base_processor.rb index faabab58..fe7e911f 100644 --- a/lib/annotate_rb/route_annotator/base_processor.rb +++ b/lib/annotate_rb/route_annotator/base_processor.rb @@ -70,7 +70,7 @@ def strip_annotations(content) mode = :content header_position = 0 - content.split(/\n/, -1).each_with_index do |line, line_number| + content.split("\n", -1).each_with_index do |line, line_number| if mode == :header && line !~ /\s*#/ mode = :content real_content << line unless line.blank? diff --git a/lib/annotate_rb/route_annotator/header_generator.rb b/lib/annotate_rb/route_annotator/header_generator.rb index f55f3abb..e9c0d970 100644 --- a/lib/annotate_rb/route_annotator/header_generator.rb +++ b/lib/annotate_rb/route_annotator/header_generator.rb @@ -15,7 +15,7 @@ def generate(options = {}) private def routes_map(options) - result = `rails routes`.chomp("\n").split(/\n/, -1) + result = `rails routes`.chomp("\n").split("\n", -1) # In old versions of Rake, the first line of output was the cwd. Not so # much in newer ones. We ditch that line if it exists, and if not, we diff --git a/lib/annotate_rb/route_annotator/helper.rb b/lib/annotate_rb/route_annotator/helper.rb index edad9d48..e49228a7 100644 --- a/lib/annotate_rb/route_annotator/helper.rb +++ b/lib/annotate_rb/route_annotator/helper.rb @@ -69,7 +69,7 @@ def strip_annotations(content) mode = :content header_position = 0 - content.split(/\n/, -1).each_with_index do |line, line_number| + content.split("\n", -1).each_with_index do |line, line_number| if mode == :header && line !~ /\s*#/ mode = :content real_content << line unless line.blank? diff --git a/spec/lib/annotate_rb/parser_spec.rb b/spec/lib/annotate_rb/parser_spec.rb index c22c857f..1e83a8df 100644 --- a/spec/lib/annotate_rb/parser_spec.rb +++ b/spec/lib/annotate_rb/parser_spec.rb @@ -440,7 +440,7 @@ module AnnotateRb # rubocop:disable Metrics/ModuleLength describe option do Parser::FORMAT_TYPES.each do |format_type| context "when passing in format type '#{format_type}'" do - let(:format_key) { "format_#{format_type}".to_sym } + let(:format_key) { :"format_#{format_type}" } let(:args) { [option, format_type] } it "sets key for the format type to true" do From 976b8680695854d79a4491420d4352edf6c20ac3 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:35:05 -0700 Subject: [PATCH 13/17] update bundle_exec in all those places --- DEVELOPMENT.md | 2 +- MIGRATION_GUIDE.md | 2 +- spec/integration/annotate_after_migration_spec.rb | 2 +- spec/integration/annotate_collapsed_models_spec.rb | 2 +- .../annotate_file_with_existing_annotations_spec.rb | 2 +- spec/integration/annotate_model_with_foreign_key_spec.rb | 2 +- spec/integration/annotate_routes_spec.rb | 2 +- spec/integration/annotate_single_file_spec.rb | 2 +- spec/integration/cli_spec.rb | 6 +++--- spec/spec_helper.rb | 2 +- 10 files changed, 12 insertions(+), 12 deletions(-) diff --git a/DEVELOPMENT.md b/DEVELOPMENT.md index dfcdc7b1..0455c812 100644 --- a/DEVELOPMENT.md +++ b/DEVELOPMENT.md @@ -30,7 +30,7 @@ I have found integration tests hard to write because we are testing a command li Refer to git history for examples of previous commits. -When I run into errors with newly written integration tests, I run the gem in the context of the dummyapp (spec/dummyapp) using `DATABASE_ADAPTER=sqlite3 bundle exec annotate_rb models` with debug statements. +When I run into errors with newly written integration tests, I run the gem in the context of the dummyapp (spec/dummyapp) using `DATABASE_ADAPTER=sqlite3 bundle exec annotaterb models` with debug statements. ## Linter diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 51569d35..84e83082 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -25,7 +25,7 @@ Previously, Annotate allowed you to annotate both model and route files in the s If you notice any differences please [report an issue](https://github.com/drwl/annotate_rb/issues/new) or [submit a pull request](https://github.com/drwl/annotate_rb/pulls) to update this document. ```sh -$ bundle exec annotate_rb +$ bundle exec annotaterb Usage: annotate_rb [command] [options] diff --git a/spec/integration/annotate_after_migration_spec.rb b/spec/integration/annotate_after_migration_spec.rb index 36cc072e..455bbe54 100644 --- a/spec/integration/annotate_after_migration_spec.rb +++ b/spec/integration/annotate_after_migration_spec.rb @@ -24,7 +24,7 @@ # Apply this specific migration _run_migrations_cmd = run_command_and_stop("bin/rails db:migrate:up VERSION=20231013230731", fail_on_error: true, exit_timeout: command_timeout_seconds) - _run_annotations_cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _run_annotations_cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_default = read_file(dummyapp_model("test_default.rb")) diff --git a/spec/integration/annotate_collapsed_models_spec.rb b/spec/integration/annotate_collapsed_models_spec.rb index 57b2be32..4fdd0bef 100644 --- a/spec/integration/annotate_collapsed_models_spec.rb +++ b/spec/integration/annotate_collapsed_models_spec.rb @@ -17,7 +17,7 @@ expect(expected_test_model).not_to eq(original_test_model) - _cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_model = read_file(dummyapp_model("collapsed/example/test_model.rb")) diff --git a/spec/integration/annotate_file_with_existing_annotations_spec.rb b/spec/integration/annotate_file_with_existing_annotations_spec.rb index 9a953b31..e0ade884 100644 --- a/spec/integration/annotate_file_with_existing_annotations_spec.rb +++ b/spec/integration/annotate_file_with_existing_annotations_spec.rb @@ -24,7 +24,7 @@ expect(expected_test_default).not_to eq(original_test_default) _cmd = run_command_and_stop( - "bundle exec annotate_rb models #{model_file} --force --position bottom", + "bundle exec annotaterb models #{model_file} --force --position bottom", fail_on_error: true, exit_timeout: command_timeout_seconds ) diff --git a/spec/integration/annotate_model_with_foreign_key_spec.rb b/spec/integration/annotate_model_with_foreign_key_spec.rb index 0eee3ade..f7db7131 100644 --- a/spec/integration/annotate_model_with_foreign_key_spec.rb +++ b/spec/integration/annotate_model_with_foreign_key_spec.rb @@ -16,7 +16,7 @@ expect(expected_test_model).not_to eq(original_test_model) - _cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_model = read_file(dummyapp_model("test_child_default.rb")) diff --git a/spec/integration/annotate_routes_spec.rb b/spec/integration/annotate_routes_spec.rb index 662f5ea3..562e566c 100644 --- a/spec/integration/annotate_routes_spec.rb +++ b/spec/integration/annotate_routes_spec.rb @@ -15,7 +15,7 @@ # Check that files have been copied over correctly expect(expected_routes_file).not_to eq(original_routes_file) - _cmd = run_command_and_stop("bundle exec annotate_rb routes", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotaterb routes", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_routes_file = read_file(routes_file) diff --git a/spec/integration/annotate_single_file_spec.rb b/spec/integration/annotate_single_file_spec.rb index bc378474..da2ed415 100644 --- a/spec/integration/annotate_single_file_spec.rb +++ b/spec/integration/annotate_single_file_spec.rb @@ -22,7 +22,7 @@ expect(expected_test_default).not_to eq(original_test_default) expect(expected_test_null_false).not_to eq(original_test_null_false) - _cmd = run_command_and_stop("bundle exec annotate_rb models #{model_file}", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotaterb models #{model_file}", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_default = read_file(dummyapp_model("test_default.rb")) annotated_test_null_false = read_file(dummyapp_model("test_null_false.rb")) diff --git a/spec/integration/cli_spec.rb b/spec/integration/cli_spec.rb index adeb6d7c..1b0b2888 100644 --- a/spec/integration/cli_spec.rb +++ b/spec/integration/cli_spec.rb @@ -15,7 +15,7 @@ let(:error_message) { "Please run annotate_rb from the root of the project." } it "exits and outputs an error message" do - _cmd = run_command("bundle exec annotate_rb") + _cmd = run_command("bundle exec annotaterb") expect(last_command_started).to have_exit_status(1) expect(last_command_started).to have_output_on_stderr(error_message) @@ -26,7 +26,7 @@ let(:help_banner_fragment) { "Usage: annotate_rb [command] [options]" } it "outputs the help message" do - _cmd = run_command("bundle exec annotate_rb", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command("bundle exec annotaterb", fail_on_error: true, exit_timeout: command_timeout_seconds) expect(last_command_started).to be_successfully_executed expect(last_command_started.stdout).to include(help_banner_fragment) @@ -45,7 +45,7 @@ expect(expected_test_default).not_to eq(original_test_default) expect(expected_test_null_false).not_to eq(original_test_null_false) - _cmd = run_command_and_stop("bundle exec annotate_rb models", fail_on_error: true, exit_timeout: command_timeout_seconds) + _cmd = run_command_and_stop("bundle exec annotaterb models", fail_on_error: true, exit_timeout: command_timeout_seconds) annotated_test_default = read_file(dummyapp_model("test_default.rb")) annotated_test_null_false = read_file(dummyapp_model("test_null_false.rb")) diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 570a318e..74681672 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -22,7 +22,7 @@ copy_dummy_app_into_aruba_working_directory # Unset the bundler context from running annotate_rb integration specs. - # This way, when `run_command("bundle exec annotate_rb")` runs, it runs as if it's within the context of dummyapp. + # This way, when `run_command("bundle exec annotaterb")` runs, it runs as if it's within the context of dummyapp. unset_bundler_env_vars end From 823d64b1efd64a00c3bba73cd1e88097818ac2e2 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:41:54 -0700 Subject: [PATCH 14/17] cli spec fix --- spec/integration/cli_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/integration/cli_spec.rb b/spec/integration/cli_spec.rb index 1b0b2888..181cc9cc 100644 --- a/spec/integration/cli_spec.rb +++ b/spec/integration/cli_spec.rb @@ -12,7 +12,7 @@ remove("Gemfile") if exist?("Gemfile") end - let(:error_message) { "Please run annotate_rb from the root of the project." } + let(:error_message) { "Please run annotaterb from the root of the project." } it "exits and outputs an error message" do _cmd = run_command("bundle exec annotaterb") @@ -23,7 +23,7 @@ end context "when running in a directory with a Rakefile and a Gemfile" do - let(:help_banner_fragment) { "Usage: annotate_rb [command] [options]" } + let(:help_banner_fragment) { "Usage: annotaterb [command] [options]" } it "outputs the help message" do _cmd = run_command("bundle exec annotaterb", fail_on_error: true, exit_timeout: command_timeout_seconds) From f848a3e37b04a3063662810bd5f8b4b6217b5f8b Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:46:16 -0700 Subject: [PATCH 15/17] another spec --- .../annotate_models_annotating_a_file_frozen_spec.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb b/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb index 8a61a5ec..3ea17cc5 100644 --- a/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb +++ b/spec/lib/annotate_rb/annotate_models/annotate_models_annotating_a_file_frozen_spec.rb @@ -23,7 +23,7 @@ class User < ActiveRecord::Base # TODO: Check out why this test fails due to test pollution describe "frozen option" do it "should abort without existing annotation when frozen: true " do - expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotate_rb was run with `--frozen`./ + expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotaterb was run with `--frozen`./ end it "should abort with different annotation when frozen: true " do @@ -36,7 +36,7 @@ class User < ActiveRecord::Base @schema_info = another_schema_info - expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotate_rb was run with `--frozen`./ + expect { annotate_one_file frozen: true }.to raise_error SystemExit, /user.rb needs to be updated, but annotaterb was run with `--frozen`./ end it "should NOT abort with same annotation when frozen: true " do From 4cd975fe7aaf4b6d38d5fd850aaa0c7109bd3075 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 10:52:34 -0700 Subject: [PATCH 16/17] couple more unrenames --- .github/ISSUE_TEMPLATE.md | 2 +- MIGRATION_GUIDE.md | 14 +++++++------- README.md | 2 +- .../model_annotator/model_files_getter.rb | 4 ++-- .../model_annotator/single_file_annotator.rb | 2 +- lib/annotate_rb/options.rb | 2 +- lib/annotate_rb/parser.rb | 6 +++--- 7 files changed, 16 insertions(+), 16 deletions(-) diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE.md index 5967d224..02f86bc4 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE.md @@ -8,7 +8,7 @@ $ show your commands here. ## Version -- annotate_rb version +- annotaterb version - rails version - ruby version - database version diff --git a/MIGRATION_GUIDE.md b/MIGRATION_GUIDE.md index 84e83082..54517196 100644 --- a/MIGRATION_GUIDE.md +++ b/MIGRATION_GUIDE.md @@ -16,18 +16,18 @@ Annotate provided 3 ways for passing options to the gem. ---------- ### Command line differences -Previously, Annotate allowed you to annotate both model and route files in the same command. In an attempt to make the CLI easier to use, they are now separate. The following output is what you see when running annotate_rb without any options. +Previously, Annotate allowed you to annotate both model and route files in the same command. In an attempt to make the CLI easier to use, they are now separate. The following output is what you see when running annotaterb without any options. **Note: most of the options are similar with the following differences:** -* `--models` has been removed, to annotate models use `annotate_rb models [options]` instead -* `-r`, `--routes` has been removed, to annotate routes use `annotate_rb routes [options]` instead +* `--models` has been removed, to annotate models use `annotaterb models [options]` instead +* `-r`, `--routes` has been removed, to annotate routes use `annotaterb routes [options]` instead -If you notice any differences please [report an issue](https://github.com/drwl/annotate_rb/issues/new) or [submit a pull request](https://github.com/drwl/annotate_rb/pulls) to update this document. +If you notice any differences please [report an issue](https://github.com/drwl/annotaterb/issues/new) or [submit a pull request](https://github.com/drwl/annotaterb/pulls) to update this document. ```sh $ bundle exec annotaterb -Usage: annotate_rb [command] [options] +Usage: annotaterb [command] [options] Commands: models [options] @@ -40,7 +40,7 @@ Options: -h, --help You're looking at it. Annotate model options: - Usage: annotate_rb models [options] + Usage: annotaterb models [options] -a, --active-admin Annotate active_admin models --show-migration Include the migration version number in the annotation @@ -48,7 +48,7 @@ Annotate model options: ... Annotate routes options: - Usage: annotate_rb routes [options] + Usage: annotaterb routes [options] --ignore-routes REGEX don't annotate routes that match a given REGEX (i.e., `annotate -I '(mobile|resque|pghero)'` ... diff --git a/README.md b/README.md index 8bc7f36e..762602e6 100644 --- a/README.md +++ b/README.md @@ -149,7 +149,7 @@ Command options: Additional options that work for annotating models and routes --additional-file-patterns path1,path2,path3 - Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%model_name%/*.rb,/baz/%model_name%.rb`) + Additional file paths or globs to annotate, separated by commas (e.g. `/foo/bar/%MODEL_NAME%/*.rb,/baz/%MODEL_NAME%.rb`) -d, --delete Remove annotations from all model files or the routes.rb file --model-dir dir Annotate model files stored in dir rather than app/models, separate multiple dirs with commas --root-dir dir Annotate files stored within root dir projects, separate multiple dirs with commas diff --git a/lib/annotate_rb/model_annotator/model_files_getter.rb b/lib/annotate_rb/model_annotator/model_files_getter.rb index c0ef478c..397e5be9 100644 --- a/lib/annotate_rb/model_annotator/model_files_getter.rb +++ b/lib/annotate_rb/model_annotator/model_files_getter.rb @@ -30,7 +30,7 @@ def call(options) if model_files.empty? warn "No models found in directory '#{options[:model_dir].join("', '")}'." warn "Either specify models on the command line, or use the --model-dir option." - warn "Call 'annotate_rb --help' for more info." + warn "Call 'annotaterb --help' for more info." # exit 1 # TODO: Return exit code back to caller. Right now it messes up RSpec being able to run else model_files @@ -53,7 +53,7 @@ def list_model_files_from_argument(options) if model_files.size != specified_files.size warn "The specified file could not be found in directory '#{options[:model_dir].join("', '")}'." - warn "Call 'annotate_rb --help' for more info." + warn "Call 'annotaterb --help' for more info." # exit 1 # TODO: Return exit code back to caller. Right now it messes up RSpec being able to run end diff --git a/lib/annotate_rb/model_annotator/single_file_annotator.rb b/lib/annotate_rb/model_annotator/single_file_annotator.rb index 84c2565e..941aeaab 100644 --- a/lib/annotate_rb/model_annotator/single_file_annotator.rb +++ b/lib/annotate_rb/model_annotator/single_file_annotator.rb @@ -38,7 +38,7 @@ def call(file_name, annotation, annotation_position, options) return false if parsed_file.has_skip_string? return false if !parsed_file.annotations_changed? && !options[:force] - abort "AnnotateRb error. #{file_name} needs to be updated, but annotate_rb was run with `--frozen`." if options[:frozen] + abort "AnnotateRb error. #{file_name} needs to be updated, but annotaterb was run with `--frozen`." if options[:frozen] updated_file_content = if !parsed_file.has_annotations? AnnotatedFile::Generator.new(old_content, annotation, annotation_position, parser_klass, parsed_file, options).generate diff --git a/lib/annotate_rb/options.rb b/lib/annotate_rb/options.rb index 74350e00..37385498 100644 --- a/lib/annotate_rb/options.rb +++ b/lib/annotate_rb/options.rb @@ -231,7 +231,7 @@ def print # Guard against user inputting strings instead of symbols def symbolize_exclude_tests # `:exclude_tests` option is being expanded to function as a boolean OR an array of symbols - # https://github.com/drwl/annotate_rb/issues/103 + # https://github.com/drwl/annotaterb/issues/103 if @options[:exclude_tests].is_a?(Array) @options[:exclude_tests].map! do |item| diff --git a/lib/annotate_rb/parser.rb b/lib/annotate_rb/parser.rb index 28f46489..9b90dc67 100644 --- a/lib/annotate_rb/parser.rb +++ b/lib/annotate_rb/parser.rb @@ -8,7 +8,7 @@ def self.parse(args, existing_options) end BANNER_STRING = <<~BANNER.freeze - Usage: annotate_rb [command] [options] + Usage: annotaterb [command] [options] Commands: models [options] @@ -160,7 +160,7 @@ def add_utils_to_parser(option_parser) def add_model_options_to_parser(option_parser) option_parser.separator("") option_parser.separator("Annotate model options:") - option_parser.separator(" " * 4 + "Usage: annotate_rb models [options]") + option_parser.separator(" " * 4 + "Usage: annotaterb models [options]") option_parser.separator("") option_parser.on("-a", @@ -269,7 +269,7 @@ def add_model_options_to_parser(option_parser) def add_route_options_to_parser(option_parser) option_parser.separator("") option_parser.separator("Annotate routes options:") - option_parser.separator(" " * 4 + "Usage: annotate_rb routes [options]") + option_parser.separator(" " * 4 + "Usage: annotaterb routes [options]") option_parser.separator("") option_parser.on("--ignore-routes REGEX", From 9ce1d680e0b810da6362af1506faaa120527ac98 Mon Sep 17 00:00:00 2001 From: Seth Herr Date: Mon, 2 Jun 2025 11:37:09 -0700 Subject: [PATCH 17/17] more name reversions --- lib/annotaterb.rb | 4 ++++ .../annotating_a_file_with_comments_spec.rb | 2 +- .../single_file_annotation_remover_spec.rb | 2 +- .../single_file_annotator_spec.rb | 16 ++++++++-------- spec/spec_helper.rb | 2 +- 5 files changed, 15 insertions(+), 11 deletions(-) create mode 100644 lib/annotaterb.rb diff --git a/lib/annotaterb.rb b/lib/annotaterb.rb new file mode 100644 index 00000000..13cc5a19 --- /dev/null +++ b/lib/annotaterb.rb @@ -0,0 +1,4 @@ +# Gem names that follow naming convention work seamlessly. However, this gem is "annotaterb" where in code it is +# AnnotateRb. Because of this, we need this file so that the rest of the library automatically gets required. + +require "annotate_rb" diff --git a/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb b/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb index 53225ca4..0dd2669a 100644 --- a/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb +++ b/spec/lib/annotate_rb/model_annotator/annotating_a_file_with_comments_spec.rb @@ -24,7 +24,7 @@ end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end diff --git a/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb b/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb index 4fc2c164..804923da 100644 --- a/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb +++ b/spec/lib/annotate_rb/model_annotator/single_file_annotation_remover_spec.rb @@ -3,7 +3,7 @@ subject { described_class.call(path) } let(:tmpdir) do - Dir.mktmpdir("annotate_rb") + Dir.mktmpdir("annotaterb") end let(:filename) { "some_file.rb" } diff --git a/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb b/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb index a9f0a2b5..e85388cc 100644 --- a/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb +++ b/spec/lib/annotate_rb/model_annotator/single_file_annotator_spec.rb @@ -37,7 +37,7 @@ class User < ActiveRecord::Base end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -87,7 +87,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -139,7 +139,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -190,7 +190,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -244,7 +244,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) end @@ -295,7 +295,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.rb", starting_file_content) @klass = mock_class(:users, @@ -363,7 +363,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.yml", starting_file_content) end @@ -422,7 +422,7 @@ class User < ApplicationRecord end before do - @model_dir = Dir.mktmpdir("annotate_rb") + @model_dir = Dir.mktmpdir("annotaterb") (@model_file_name, _file_content) = write_model("user.yml", starting_file_content) end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 74681672..5ae5f40f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -21,7 +21,7 @@ config.before(:example, type: :aruba) do copy_dummy_app_into_aruba_working_directory - # Unset the bundler context from running annotate_rb integration specs. + # Unset the bundler context from running annotaterb integration specs. # This way, when `run_command("bundle exec annotaterb")` runs, it runs as if it's within the context of dummyapp. unset_bundler_env_vars end