1. 01 Mar, 2020 2 commits
  2. 25 Feb, 2020 1 commit
  3. 20 Feb, 2020 1 commit
  4. 17 Feb, 2020 1 commit
  5. 13 Feb, 2020 2 commits
  6. 11 Feb, 2020 1 commit
    • Add integration tests to project (#747) · ec0b3b61
      Andrew W. Lee authored
      Adds integration tests to the project that's able to run in CI across different ruby versions.
      
      * Adds a Rails 5.2.4.1 app
      * Adds a Rails 6.0.2.1 app
      
      Fixes #733 
  7. 06 Feb, 2020 1 commit
  8. 04 Feb, 2020 1 commit
  9. 01 Feb, 2020 2 commits
  10. 27 Jan, 2020 2 commits
  11. 26 Jan, 2020 2 commits
  12. 24 Jan, 2020 1 commit
    • Support YARD notation (#724) · 06255470
      tvallois authored
      The scope of this pull request is to allow annotate_models to generate models documentation using YARD. This is the first step, I'll add more features later.
  13. 20 Jan, 2020 3 commits
    • AnnotateModels.get_schema_info (with custom options) (#732) · 1b51de89
      Shu Fujita authored
      * Structuralize RSpec test cases of AnnotateModels.get_schema_info (with custom options)
      
      * Replace expression expansion to plain text
      
      * Refactor RSpec test cases of AnnotateModels.get_schema_info (with custom options)
      
      * Change position of test cases
    • Fix typo in RSpec of AnnotateModels (#731) · fd663b96
      Shu Fujita authored
    • Add columns managed by Globalize gem (#602) · d894fa29
      Peter Gundel authored
      * Add columns managed by Globalize gem
      
      Globalize hooks into the model and removes the translated columns
      from the `klass.columns`. This commit checks if globalize is
      hooked into the model and adds the necessary columns to the
      annotation array.
      
      * Disable Rubocop Metrics/BlockLength for spec files
      
      RSpec spec files can contain long blocks easily because
      of the outher describe methods. So this rule makes not too much
      sense for these files.
  14. 19 Jan, 2020 1 commit
    • Refactor RSpec for AnnotateModels (1) (#726) · 87b51c24
      Shu Fujita authored
      I refactored and structuralized RSpec test cases of AnnotateModels for readability and scalability because it was too complex to read.
      
      cf. #718 
      In this PR, I refactored test cases of some methods in `AnnotateModels`.
      I will refactor test cases of other methods in another PR.
  15. 18 Jan, 2020 1 commit
    • Refactor AnnotateRoutes.routes_file_exist? (#716) · 9a8db1b7
      Shu Fujita authored
      I refactored `AnnotateRoutes.routes_exists?` and methods using this.
      The points are as follows.
      
      *   Removing `puts` in `AnnotateRoutes.routes_exists?`
      *   Using `File.exist?` instead of `File.exists?` because `File.exists?` is deprecated
      *   Renaming `AnnotateRoutes.routes_exists?` to `AnnotateRoutes.routes_file_exists?` in order to make the name of method more explanatory
  16. 16 Jan, 2020 1 commit
  17. 30 Dec, 2019 1 commit
    • Refactor lib/annotate.rb (#707) · 3f0b6b32
      Andrew W. Lee authored
      This change converts .all_options into a constant and moves it into Annotate::Constants. It also changes usages of .all_options.
  18. 18 Dec, 2019 2 commits
    • [Fix #430] Handle columns from activerecord-postgis-adapter (#694) · c13fe49c
      inkstak authored
      Same problem returned by @janosrusiczki in #430
      
      Spatial columns with activerecord-postgis-adapter (5.2.2) are not displayed nice
      
      ```
      # name           :string(3)
      # active         :boolean          default(FALSE), not null
      # geom           :geometry({:srid= geometry, 4326
      ```
      
      That's come from activerecord-postgis-adapter, with redefined columns as such :
      
      ``` 
      #<ActiveRecord::ConnectionAdapters::PostGIS::SpatialColumn 
        @sql_type="geometry(Geometry,4326)",
        @geo_type="Geometry",
        @geometric_type=RGeo::Feature::Geometry,
        @srid=4326,
        @limit={:srid=>4326, :type=>"geometry"}
        [...]
      >
      ```
      
      This fix displays them like this :
      
      ```
      # name           :string(3)
      # active         :boolean          default(FALSE), not null
      # geometry       :geometry         geometry, 4326
      ```
      
      Another possibility would have been to display them as below, but it involves a lot of extra-spaces for other columns.
      
      ```
      # name           :string(3)
      # active         :boolean                   default(FALSE), not null
      # geometry       :geometry(Geometry, 4326)
      ```
  19. 09 Nov, 2019 5 commits
  20. 02 Oct, 2019 1 commit
  21. 28 Sep, 2019 1 commit
  22. 26 Sep, 2019 1 commit
  23. 03 Sep, 2019 1 commit
    • Make it possible to annotate models and routes together (#647) · 846c7f8e
      Andrew W. Lee authored
      Prior to this change, `Annotate.include_models?` returned the inverse of `Annotate.include_routes?`. This made it so annotating models and routes was not possible to do together.
      
      This PR adds an explicit `--models` flag and also adds it the option to `lib/generators/annotate/templates/auto_annotate_models.rake` with the default being set to `false`. 
      
      Fixes #563 and undoes the bug introduced in #485.
  24. 02 Sep, 2019 1 commit
    • Tidy spec directory (#646) · 2775001d
      Andrew W. Lee authored
      In looking into #563, I realized there are gaps in test coverage. For example, `bin/annotate` doesn't have any tests. 
      
      Tidying the spec directory to make it easier to add tests in future work.
  25. 06 Aug, 2019 1 commit
  26. 16 Jul, 2019 1 commit
    • Refactor Parser (#641) · f8f1b178
      Andrew W. Lee authored
      Refactored Parser to isolate changes being made to ENV. This way we have an intermediate step where we know the environment variables being set.
  27. 10 Jul, 2019 1 commit
    • Add option for additional file patterns (#633) · f95913ba
      Ryan authored
      This PR adds an option named `additional_file_patterns`.  You can specify custom path patterns (including globs) that the gem will use to annotate.
      
      For example, I used it like this on a project:
      
      ```ruby
      Annotate.set_defaults(
            'additional_file_patterns' => [
              File.join(Rails.application.root, 'app/lib/forms/%PLURALIZED_MODEL_NAME%/**/*.rb'),
              File.join(Rails.application.root, 'spec/lib/forms/%PLURALIZED_MODEL_NAME%/**/*.rb')
            ],
            ...
      )
      ```
      
      This makes it possible to have files nested under a directory which corresponds to the model.
      
      I believe this fixes #594.
  28. 07 Jul, 2019 1 commit
    • Add tests for the CLI (#635) · f612f8ad
      Andrew W. Lee authored
      Currently there's no test coverage on CLI. This adds tests for a new class Parser which will replace the command line options currently in bin/annotate.
      
      The technical direction I'm planning to go is to remove ENV variables completely and to have things passed into as arguments. Will be adding deprecation warnings in 3.0 and then deprecate ENV variables completely in 3.1. Deprecation warnings will be non-blocking in 3.0 when an ENV variable is set and an argument isn't passed in, and will becoming blocking in 3.1.