From 2459fdf70e8da17c348a391a4c778f0279551cee Mon Sep 17 00:00:00 2001 From: Geremia Taglialatela Date: Wed, 10 Dec 2025 14:17:29 +0100 Subject: [PATCH] Fix YARD documentation warnings Additionally: - Use https where possible - Remove 404 links (`awesome_bot`) - Fix typos (`codespell`) --- CHANGELOG.md | 11 +++++++++-- features/support/env.rb | 4 ++-- lib/eaco.rb | 2 +- lib/eaco/adapters.rb | 2 +- lib/eaco/adapters/active_record.rb | 2 +- lib/eaco/adapters/active_record/compatibility/v40.rb | 2 +- lib/eaco/adapters/active_record/compatibility/v51.rb | 2 +- lib/eaco/adapters/active_record/compatibility/v52.rb | 2 +- lib/eaco/adapters/active_record/compatibility/v60.rb | 2 +- lib/eaco/adapters/active_record/compatibility/v61.rb | 2 +- lib/eaco/adapters/active_record/postgres_jsonb.rb | 2 +- lib/eaco/controller.rb | 8 ++++---- lib/eaco/cucumber/active_record.rb | 8 ++++---- lib/eaco/cucumber/world.rb | 4 ++-- lib/eaco/dsl/acl.rb | 6 +++--- lib/eaco/rake/default_task.rb | 2 +- lib/eaco/resource.rb | 2 +- spec/eaco_spec.rb | 4 ++-- spec/spec_helper.rb | 7 ++----- 19 files changed, 39 insertions(+), 35 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc61649..d25b9b7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,8 +2,15 @@ All notable changes to this project will be documented in this file. -The format is based on [Keep a Changelog](http://keepachangelog.com/) and this -project adheres to [Semantic Versioning](http://semver.org/) +The format is based on [Keep a Changelog](https://keepachangelog.com/) and this +project adheres to [Semantic Versioning](https://semver.org/) + +## Unreleased + +### Fixed +* Fix YARD documentation warnings: + - Remove curly braces from `@see` tags (causes rendering issues) + - Use fully-qualified constant names for `ACL#find_by_role` references (`Eaco::ACL#find_by_role`) ## 1.1.1 - 2017-03-08 diff --git a/features/support/env.rb b/features/support/env.rb index 4affb50..d3d948d 100644 --- a/features/support/env.rb +++ b/features/support/env.rb @@ -13,7 +13,7 @@ ## # Create a whole new world. -# @see {World} +# @see World # @!method World World do Eaco::Cucumber::World.new @@ -21,7 +21,7 @@ ## # Recreate the schema before each feature, to start fresh. -# @see {ActiveRecord.define_schema!} +# @see ActiveRecord.define_schema! # @!method Before Before do Eaco::Cucumber::ActiveRecord.define_schema! diff --git a/lib/eaco.rb b/lib/eaco.rb index fbd8121..f913cc5 100644 --- a/lib/eaco.rb +++ b/lib/eaco.rb @@ -60,7 +60,7 @@ def self.parse_rules!(rules) end ## - # Evaluates the given authorization rules +source+, orignally found on + # Evaluates the given authorization rules +source+, originally found on # +path+. # # @param source [String] {DSL} source code diff --git a/lib/eaco/adapters.rb b/lib/eaco/adapters.rb index df4c585..409bc35 100644 --- a/lib/eaco/adapters.rb +++ b/lib/eaco/adapters.rb @@ -1,6 +1,6 @@ module Eaco - # Persistance adapters for ACL objects and authorized collections extractor + # Persistence adapters for ACL objects and authorized collections extractor # strategies. # # @see ActiveRecord diff --git a/lib/eaco/adapters/active_record.rb b/lib/eaco/adapters/active_record.rb index d2f69a2..1675d13 100644 --- a/lib/eaco/adapters/active_record.rb +++ b/lib/eaco/adapters/active_record.rb @@ -21,7 +21,7 @@ def self.strategies end ## - # Checks whether the model's data structure fits the ACL persistance + # Checks whether the model's data structure fits the ACL persistence # requirements. # # @param base [Class] your application's model diff --git a/lib/eaco/adapters/active_record/compatibility/v40.rb b/lib/eaco/adapters/active_record/compatibility/v40.rb index dd295c6..b4108aa 100644 --- a/lib/eaco/adapters/active_record/compatibility/v40.rb +++ b/lib/eaco/adapters/active_record/compatibility/v40.rb @@ -10,7 +10,7 @@ module V40 ## # # Sets up the OID Type Map, reloads it, hacks native database types, - # and makes jsonb mimick itself as a json - for the rest of the AR + # and makes jsonb mimic itself as a json - for the rest of the AR # machinery to work intact. # # @param base [Class] the +ActiveRecord+ model to mangle diff --git a/lib/eaco/adapters/active_record/compatibility/v51.rb b/lib/eaco/adapters/active_record/compatibility/v51.rb index a231846..b2de739 100644 --- a/lib/eaco/adapters/active_record/compatibility/v51.rb +++ b/lib/eaco/adapters/active_record/compatibility/v51.rb @@ -11,7 +11,7 @@ class Compatibility # # @see Scoped # - # Sanitize has dissapeared in favour of quote. + # Sanitize has disappeared in favour of quote. # # @see Sanitized # diff --git a/lib/eaco/adapters/active_record/compatibility/v52.rb b/lib/eaco/adapters/active_record/compatibility/v52.rb index 63ab45a..c96506f 100644 --- a/lib/eaco/adapters/active_record/compatibility/v52.rb +++ b/lib/eaco/adapters/active_record/compatibility/v52.rb @@ -11,7 +11,7 @@ class Compatibility # # @see Scoped # - # Sanitize has dissapeared in favour of quote. + # Sanitize has disappeared in favour of quote. # # @see Sanitized # diff --git a/lib/eaco/adapters/active_record/compatibility/v60.rb b/lib/eaco/adapters/active_record/compatibility/v60.rb index 9e7fddc..8005dea 100644 --- a/lib/eaco/adapters/active_record/compatibility/v60.rb +++ b/lib/eaco/adapters/active_record/compatibility/v60.rb @@ -11,7 +11,7 @@ class Compatibility # # @see Scoped # - # Sanitize has dissapeared in favour of quote. + # Sanitize has disappeared in favour of quote. # # @see Sanitized # diff --git a/lib/eaco/adapters/active_record/compatibility/v61.rb b/lib/eaco/adapters/active_record/compatibility/v61.rb index ed9c85c..ff96a2a 100644 --- a/lib/eaco/adapters/active_record/compatibility/v61.rb +++ b/lib/eaco/adapters/active_record/compatibility/v61.rb @@ -11,7 +11,7 @@ class Compatibility # # @see Scoped # - # Sanitize has dissapeared in favour of quote. + # Sanitize has disappeared in favour of quote. # # @see Sanitized # diff --git a/lib/eaco/adapters/active_record/postgres_jsonb.rb b/lib/eaco/adapters/active_record/postgres_jsonb.rb index 8fedc2c..094fb06 100644 --- a/lib/eaco/adapters/active_record/postgres_jsonb.rb +++ b/lib/eaco/adapters/active_record/postgres_jsonb.rb @@ -15,7 +15,7 @@ module ActiveRecord module PostgresJSONb ## - # Uses the json key existance operator +?|+ to check whether one of the + # Uses the json key existence operator +?|+ to check whether one of the # +Actor+'s +Designator+ instances exist as keys in the +ACL+ objects. # # @param actor [Actor] diff --git a/lib/eaco/controller.rb b/lib/eaco/controller.rb index 6d0c712..5980d2b 100644 --- a/lib/eaco/controller.rb +++ b/lib/eaco/controller.rb @@ -71,8 +71,8 @@ def authorize(*actions) # # @return [Symbol] the required permission or nil # - # @see {Eaco::Resource} - # @see {Eaco::DSL::Resource} + # @see Eaco::Resource + # @see Eaco::DSL::Resource # def permission_for(action) authorization_permissions[action] || authorization_permissions[:all] @@ -85,7 +85,7 @@ def permission_for(action) # # @return [Hash] # - # @see {Eaco::DSL::Resource} + # @see Eaco::DSL::Resource # def authorization_permissions @_authorization_permissions ||= {} @@ -156,7 +156,7 @@ def authorization_permissions # /_'O\|| # .-'___/(__) # - # http://ascii.co.uk/art/guardiana + # https://ascii.co.uk/art/guardiana # def confront_eaco action = params[:action].intern diff --git a/lib/eaco/cucumber/active_record.rb b/lib/eaco/cucumber/active_record.rb index 28aa893..4c30312 100644 --- a/lib/eaco/cucumber/active_record.rb +++ b/lib/eaco/cucumber/active_record.rb @@ -61,14 +61,14 @@ def logger end ## - # Returns an Hash wit the database configuration. + # Returns an Hash with the database configuration. # # Caveat:the returned +Hash+ has a custom +.to_s+ method that formats # the configuration as a +pgsql://+ URL. # # @return [Hash] the current database configuration # - # @see {#config_file} + # @see #config_file # def configuration @_config ||= YAML.load(config_file.read).tap do |conf| @@ -84,7 +84,7 @@ def conf.to_s ## # @return [Pathname] the currently configured configuration file. Override - # using the +EACO_AR_CONFIG' envinronment variable. + # using the +EACO_AR_CONFIG' environment variable. # def config_file Pathname.new(ENV['EACO_AR_CONFIG'] || default_config_file) @@ -147,7 +147,7 @@ def define_schema! # # @param block [Proc] # @return [nil] - # @see {Rake::Utils.capture_stdout} + # @see Rake::Utils.capture_stdout # def log_stdout(&block) stdout = Rake::Utils.capture_stdout(&block) diff --git a/lib/eaco/cucumber/world.rb b/lib/eaco/cucumber/world.rb index c0b5002..3290c3d 100644 --- a/lib/eaco/cucumber/world.rb +++ b/lib/eaco/cucumber/world.rb @@ -90,7 +90,7 @@ module Cucumber # mmmmmmMMMM" # ch1x0r # - # http://ascii.co.uk/art/anime + # https://ascii.co.uk/art/anime # # = Scenario # @@ -145,7 +145,7 @@ def initialize # # @param name [String] the model name # @param definition [String] the {DSL} code - # @see {#find_model} + # @see #find_model # # @return [void] # diff --git a/lib/eaco/dsl/acl.rb b/lib/eaco/dsl/acl.rb index 5eb923d..d345d16 100644 --- a/lib/eaco/dsl/acl.rb +++ b/lib/eaco/dsl/acl.rb @@ -12,7 +12,7 @@ module DSL # * Defines syntactic sugar on the ACL to easily retrieve {Actor}s with a # specific Role ({#define_role_getters}) # - # * Installs {ACL} objects persistance for the supported ORMs + # * Installs {ACL} objects persistence for the supported ORMs # ({#install_persistance}) # # * Installs the authorized collection extraction strategy @@ -61,7 +61,7 @@ def define_acl_subclass ## # Define getter methods on the ACL for each role, syntactic sugar - # for calling {ACL#find_by_role}. + # for calling {Eaco::ACL#find_by_role}. # # Example: # @@ -81,7 +81,7 @@ def define_role_getters end ## - # Sets up the persistance layer for ACLs (+#acl+ and +#acl=+). + # Sets up the persistence layer for ACLs (+#acl+ and +#acl=+). # # These APIs can be implemented directly in your Resource model, as long # as the +acl+ accessor accepts and returns the Resource model's ACL diff --git a/lib/eaco/rake/default_task.rb b/lib/eaco/rake/default_task.rb index d545ac1..850f678 100644 --- a/lib/eaco/rake/default_task.rb +++ b/lib/eaco/rake/default_task.rb @@ -188,7 +188,7 @@ def fancy(msg) end ## - # @see {Rake::Utils.gemfile} + # @see Rake::Utils.gemfile # @private # def gemfile diff --git a/lib/eaco/resource.rb b/lib/eaco/resource.rb index 946a099..807722f 100644 --- a/lib/eaco/resource.rb +++ b/lib/eaco/resource.rb @@ -198,7 +198,7 @@ def batch_grant(role, designators) protected ## - # Changes the ACL, calling the persistance setter if it changes. + # Changes the ACL, calling the persistence setter if it changes. # # @yield [ACL] the current ACL or a new one if no ACL is set # diff --git a/spec/eaco_spec.rb b/spec/eaco_spec.rb index dfc0c52..63da141 100644 --- a/spec/eaco_spec.rb +++ b/spec/eaco_spec.rb @@ -29,9 +29,9 @@ end context 'when the file does not exist' do - let(:file) { Pathname('/nonexistant') } + let(:file) { Pathname('/nonexistent') } - it { expect { subject }.to raise_error(Eaco::Malformed, /Please create \/nonexistant/) } + it { expect { subject }.to raise_error(Eaco::Malformed, /Please create \/nonexistent/) } end end diff --git a/spec/spec_helper.rb b/spec/spec_helper.rb index 3fbc1a0..bc5760f 100644 --- a/spec/spec_helper.rb +++ b/spec/spec_helper.rb @@ -6,7 +6,7 @@ require 'eaco' -# See http://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration +# See https://rubydoc.info/gems/rspec-core/RSpec/Core/Configuration # RSpec.configure do |config| @@ -36,10 +36,7 @@ config.run_all_when_everything_filtered = true # Limits the available syntax to the non-monkey patched syntax that is - # recommended. For more details, see: - # - http://myronmars.to/n/dev-blog/2012/06/rspecs-new-expectation-syntax - # - http://teaisaweso.me/blog/2013/05/27/rspecs-new-message-expectation-syntax/ - # - http://myronmars.to/n/dev-blog/2014/05/notable-changes-in-rspec-3#new__config_option_to_disable_rspeccore_monkey_patching + # recommended. config.disable_monkey_patching! # This setting enables warnings. It's recommended, but in some cases may