diff --git a/.rubocop_gradual.lock b/.rubocop_gradual.lock index 38849df..182ae98 100644 --- a/.rubocop_gradual.lock +++ b/.rubocop_gradual.lock @@ -1,14 +1,16 @@ { - "README.md:517414065": [ + "README.md:1323834265": [ [232, 3, 100, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 3592044714] ], - "lib/omniauth/identity/model.rb:3893215304": [ - [26, 7, 310, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 2741399784], - [51, 11, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], - [52, 11, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], - [52, 40, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], - [52, 54, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], - [54, 11, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525] + "bin/bundle:247448467": [ + [64, 5, 20, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 2485198147] + ], + "lib/omniauth/identity/model.rb:1162570792": [ + [53, 11, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], + [54, 11, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], + [54, 40, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], + [54, 54, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525], + [56, 11, 9, "ThreadSafety/ClassInstanceVariable: Avoid class instance variables.", 4045031525] ], "lib/omniauth/identity/models/active_record.rb:1552301885": [ [19, 9, 113, "Style/ClassMethodsDefinitions: Use `class << self` to define a class method.", 2104861380], diff --git a/CHANGELOG.md b/CHANGELOG.md index 14dbd08..8818b8a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,35 +1,56 @@ # Changelog -All notable changes to this project will be documented in this file. +All notable changes to this project since v2.0 will be documented in this file. - -The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), -and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). +The format is based on [Keep a Changelog v1](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning v2](https://semver.org/spec/v2.0.0.html). ## [Unreleased] - -## [3.0.9] - 2021-06-16 - +### Added +### Changed ### Fixed +### Removed +## [3.1.0] - 2024-11-18 ([tag][3.1.0t]) +- COVERAGE: 91.98% -- 344/374 lines in 15 files +- BRANCH COVERAGE: 80.26% -- 61/76 branches in 15 files +- 44.44% documented +### Added +- [PR #123][123] Improve readability in #identity method of OmniAuth::Strategies::Identity by @Xeragus +- [PR #124][124] Modernized gem structure, and updated dependencies for development by @pboling + - Gem releases are now cryptographically signed + - All ORM adapters (except NoBrainer) are tested in CI +- [PR #127][127] Improved documentation by @pboling +- [PR #128][128] Instructions for contributing by @pboling +### Changed +- Deprecate `require 'omniauth/identity'` by @pboling + - in favor of `require omniauth-identity` (matching the gem name) +### Fixed +- [PR #120][120] Fix: handling of SCRIPT_NAME for registration_path by @btalbot +- [PR #122][122] Compatibility with rack v3.1+: use `req.params[]` instead of `req[]` by @emon + - See: https://github.com/rack/rack/pull/2183 + +[128]: https://github.com/omniauth/omniauth-identity/pull/128 +[127]: https://github.com/omniauth/omniauth-identity/pull/127 +[124]: https://github.com/omniauth/omniauth-identity/pull/124 +[123]: https://github.com/omniauth/omniauth-identity/pull/123 +[122]: https://github.com/omniauth/omniauth-identity/pull/122 +[120]: https://github.com/omniauth/omniauth-identity/pull/120 + +## [3.0.9] - 2021-06-16 ([tag][3.0.9t]) +### Fixed - \[Sequel\] Fixes loading the Sequel adapter, issue reported as [#112](https://github.com/omniauth/omniauth-identity/issues/112) - ### Added - - 📝 Document the Database adapters and drivers the gem currently works with -## [3.0.8] - 2021-03-24 - +## [3.0.8] - 2021-03-24 ([tag][3.0.8t]) ### Fixed - - \[Model\] Fixes 2 issues raised in a comment on PR [#108](https://github.com/omniauth/omniauth-identity/pull/108#issuecomment-804456604) - When `options[:on_validation]` is set `new`/`save`/`persisted?` logic is used. - When `options[:on_validation]` is not set `create`/`persisted?` logic is used. -## [3.0.7] - 2021-03-23 - +## [3.0.7] - 2021-03-23 ([tag][3.0.7t]) ### Fixed - - \[ActiveRecord\] Fixed [#110](https://github.com/omniauth/omniauth-identity/issues/110) which prevented `OmniAuth::Identity::Models::ActiveRecord`-based records from saving. - \[CouchPotato\] Fixed `OmniAuth::Identity::Models::CouchPotato`'s `#save`. - \[Sequel\] Fixed `OmniAuth::Identity::Models::Sequel`'s `#save`. @@ -37,15 +58,12 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - \[Model\] Restore original `info` functionality which set `name` based on `first_name`, `last_name`, or `nickname` ### Changed - - Upgraded to a newer `OmniAuth::Identity::SecurePassword` ripped from [Rails 6-1-stable](https://github.com/rails/rails/blob/6-1-stable/activemodel/lib/active_model/secure_password.rb) - Aeons ago the original was ripped from Rails 3.1, and frozen in time. While writing specs, it was discovered to be incompatible with this gem's Sequel adapter. - Specs validate that the new version does work. In any case, the ripped version is only used when the `has_secure_password` macro is not yet defined in the class. - ### Added - - New specs to cover real use cases and implementations of each ORM model adapter that ships with the gem: - ActiveRecord (Polyglot - Many Relational Databases) - Sequel (Polyglot - Many Relational Databases) @@ -53,14 +71,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Mongoid (MongoDB) - NoBrainer (RethinkDB) -## [3.0.6] - 2021-03-20 - +## [3.0.6] - 2021-03-20 ([tag][3.0.6t]) ### Fixed - - Fix breaking changes introduced by [#108](https://github.com/omniauth/omniauth-identity/pull/108) which prevented `:on_validation` from firing - ### Added - - New (or finally documented) options: - `:create_identity_link_text` defaults to `'Create an Identity'` - `:registration_failure_message` defaults to `'One or more fields were invalid'` @@ -68,58 +82,42 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - `:title` defaults to `'Identity Verification'` - `:registration_form_title` defaults to `'Register Identity'` -## [3.0.5] - 2021-03-19 - +## [3.0.5] - 2021-03-19 ([tag][3.0.5t]) ### Fixed - - Fix breaking changes introduced by [#86's](https://github.com/omniauth/omniauth-identity/pull/86) introduction of `:on_validation` - ### Added - - Define `#save`, `#persisted?` and `::create` on `Omniauth::Identity::Model` - Add `@since` YARD tags to interface methods - Refactor `Omniauth::Strategies::Identity.registration_phase` to support `Omniauth::Identity::Model`-inheriting classes that do not define `#save`. - This support will be dropped in v4.0. -## [3.0.4] - 2021-02-14 - +## [3.0.4] - 2021-02-14 ([tag][3.0.4t]) ### Added - - Add support for [sequel ORM](http://sequel.jeremyevans.net/) -## [3.0.3] - 2021-02-14 - +## [3.0.3] - 2021-02-14 ([tag][3.0.3t]) ### Added - - Add option `:on_validation`, which can be used to add a Captcha - See [example here](https://github.com/omniauth/omniauth-identity/pull/86#issue-63225122) - Add support for nobrainer, an ORM for RethinkDB - Validation error message on invalid registration form submission - ### Removed - - ruby-head build... simply too slow -## [3.0.2] - 2021-02-14 - +## [3.0.2] - 2021-02-14 ([tag][3.0.2t]) ### Fixed - - Github Actions CI Build for Ruby 2.4, 3.0 and ruby-head - Updated copyright - Code style cleanup - Added Code Climate "Quality" - Updated Readme -## [3.0.1] - 2021-02-14 - +## [3.0.1] - 2021-02-14 ([tag][3.0.1t]) ### Fixed - - Github Actions CI Build for various Rubies -## [3.0] - 2021-02-13 - +## [3.0.0] - 2021-02-13 ([tag][3.0.0t]) ### Added - - Compatibility with Ruby 3 - Add option `:enable_login` to bypass OmniAuth disabling of GET method (default `true`) - NOTE: This restores compatibility between this gem and the current, core, omniauth gem! @@ -130,22 +128,16 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Minimum Ruby version = 2.4 - Automatically adds "provider" => "identity" when "provider" column is detected - Documentation in README.md - ### Removed - - Support for Rubies < 2.4 - Support for DataMapper, which died long ago. - Unwanted git artifacts -## [2.0] - 2020-09-01 - +## [2.0.0] - 2020-09-01 ([tag][2.0.0t]) ### Added - - CHANGELOG to maintain a history of changes. - Include mongoid-rspec gem. - ### Changed - - Fix failing Specs - Update Spec syntax to RSpec 3 - Fix deprecation Warnings @@ -154,7 +146,70 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Dependency version limits so that the most up-to-date gem dependencies are used. (rspec 3+, mongo 2+, mongoid 7+, rake 13+, rack 2+, json 2+) - Updated copyright information. - Updated MongoMapper section of README to reflect its discontinued support. - ### Removed - Gemfile.lock file -- MongoMapper support; unable to satisfy dependencies of both MongoMapper and Mongoig now that MongoMapper is no longer actively maintained. \ No newline at end of file +- MongoMapper support; unable to satisfy dependencies of both MongoMapper and Mongoid now that MongoMapper is no longer actively maintained. + +[Unreleased]: https://github.com/omniauth/omniauth-identity/compare/v3.1.0...HEAD +[3.1.0]: https://github.com/omniauth/omniauth-identity/compare/v3.0.9...v3.1.0 +[3.1.0t]: https://github.com/omniauth/omniauth-identity/tags/v3.1.0 +[3.0.9]: https://github.com/omniauth/omniauth-identity/compare/v3.0.8...v3.0.9 +[3.0.9t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.9 +[3.0.8]: https://github.com/omniauth/omniauth-identity/compare/v3.0.7...v3.0.8 +[3.0.8t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.8 +[3.0.7]: https://github.com/omniauth/omniauth-identity/compare/v3.0.6...v3.0.7 +[3.0.7t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.7 +[3.0.6]: https://github.com/omniauth/omniauth-identity/compare/v3.0.5...v3.0.6 +[3.0.6t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.6 +[3.0.5]: https://github.com/omniauth/omniauth-identity/compare/v3.0.4...v3.0.5 +[3.0.5t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.5 +[3.0.4]: https://github.com/omniauth/omniauth-identity/compare/v3.0.3...v3.0.4 +[3.0.4t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.4 +[3.0.3]: https://github.com/omniauth/omniauth-identity/compare/v3.0.2...v3.0.3 +[3.0.3t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.3 +[3.0.2]: https://github.com/omniauth/omniauth-identity/compare/v3.0.1...v3.0.2 +[3.0.2t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.2 +[3.0.1]: https://github.com/omniauth/omniauth-identity/compare/v3.0.0...v3.0.1 +[3.0.1t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.1 +[3.0.0]: https://github.com/omniauth/omniauth-identity/compare/v2.0.0...v3.0.0 +[3.0.0t]: https://github.com/omniauth/omniauth-identity/tags/v3.0.0 +[2.0.0]: https://github.com/omniauth/omniauth-identity/compare/v1.1.1...v2.0.0 +[2.0.0t]: https://github.com/omniauth/omniauth-identity/tags/v2.0.0 +[1.1.1]: https://github.com/omniauth/omniauth-identity/compare/v1.1.0...v1.1.1 +[1.1.1t]: https://github.com/omniauth/omniauth-identity/tags/v1.1.1 +[1.1.0]: https://github.com/omniauth/omniauth-identity/compare/v1.0.0...v1.1.0 +[1.1.0t]: https://github.com/omniauth/omniauth-identity/tags/v1.0.0 +[1.0.0]: https://github.com/omniauth/omniauth-identity/compare/v0.3.0...v1.0.0 +[1.0.0t]: https://github.com/omniauth/omniauth-identity/tags/v1.0.0 +[0.3.0]: https://github.com/omniauth/omniauth-identity/compare/v0.2.6...v0.3.0 +[0.3.0t]: https://github.com/omniauth/omniauth-identity/tags/v0.3.0 +[0.2.6]: https://github.com/omniauth/omniauth-identity/compare/v0.2.5...v0.2.6 +[0.2.6t]: https://github.com/omniauth/omniauth-identity/tags/v0.2.6 +[0.2.5]: https://github.com/omniauth/omniauth-identity/compare/v0.2.4...v0.2.5 +[0.2.5t]: https://github.com/omniauth/omniauth-identity/tags/v0.2.5 +[0.2.4]: https://github.com/omniauth/omniauth-identity/compare/v0.2.3...v0.2.4 +[0.2.4t]: https://github.com/omniauth/omniauth-identity/tags/v0.2.5 +[0.2.3]: https://github.com/omniauth/omniauth-identity/compare/v0.2.2...v0.2.3 +[0.2.3t]: https://github.com/omniauth/omniauth-identity/tags/v0.2.3 +[0.2.2]: https://github.com/omniauth/omniauth-identity/compare/v0.2.1...v0.2.2 +[0.2.2t]: https://github.com/omniauth/omniauth-identity/tags/v0.2.2 +[0.2.1]: https://github.com/omniauth/omniauth-identity/compare/v0.2.0...v0.2.1 +[0.2.1t]: https://github.com/omniauth/omniauth-identity/tags/v0.2.1 +[0.2.0]: https://github.com/omniauth/omniauth-identity/compare/v0.1.6...v0.2.0 +[0.2.0t]: https://github.com/omniauth/omniauth-identity/tags/v0.2.0 +[0.1.6]: https://github.com/omniauth/omniauth-identity/compare/v0.1.5...v0.1.6 +[0.1.6t]: https://github.com/omniauth/omniauth-identity/tags/v0.1.6 +[0.1.5]: https://github.com/omniauth/omniauth-identity/compare/v0.1.4...v0.1.5 +[0.1.5t]: https://github.com/omniauth/omniauth-identity/tags/v0.1.5 +[0.1.4]: https://github.com/omniauth/omniauth-identity/compare/v0.1.3...v0.1.4 +[0.1.4t]: https://github.com/omniauth/omniauth-identity/tags/v0.1.4 +[0.1.3]: https://github.com/omniauth/omniauth-identity/compare/v0.1.1...v0.1.3 +[0.1.3t]: https://github.com/omniauth/omniauth-identity/tags/v0.1.3 +[0.1.1]: https://github.com/omniauth/omniauth-identity/compare/v0.0.4...v0.1.1 +[0.1.1t]: https://github.com/omniauth/omniauth-identity/tags/v0.1.1 +[0.0.4]: https://github.com/omniauth/omniauth-identity/compare/v0.0.3...v0.0.4 +[0.0.4t]: https://github.com/omniauth/omniauth-identity/tags/v0.0.4 +[0.0.3]: https://github.com/omniauth/omniauth-identity/compare/v0.0.1...v0.0.3 +[0.0.3t]: https://github.com/omniauth/omniauth-identity/tags/v0.0.3 +[0.0.1]: https://github.com/omniauth/omniauth-identity/compare/be7b50aafea590caae6dc9dce550a96b997773cd...v0.0.1 +[0.0.1t]: https://github.com/omniauth/omniauth-identity/tags/v0.0.1 diff --git a/README.md b/README.md index 91e4b16..dd4a2c9 100644 --- a/README.md +++ b/README.md @@ -16,7 +16,7 @@ [![CI Coverage Build][🚎2-cov-wfi]][🚎2-cov-wf] [![CI Style Build][🚎5-st-wfi]][🚎5-st-wf] -[comment]: <> ( 👽️ INFO LINKS ) + [👽dl-rank]: https://rubygems.org/gems/omniauth-identity [👽dl-ranki]: https://img.shields.io/gem/rd/omniauth-identity.svg @@ -25,7 +25,7 @@ [👽version]: https://rubygems.org/gems/omniauth-identity [👽versioni]: https://img.shields.io/gem/v/omniauth-identity.svg -[comment]: <> ( 🔑 KEYED LINKS ) + [🔑cc-mnt]: https://codeclimate.com/github/omniauth/omniauth-identity/maintainability [🔑cc-mnti♻️]: https://api.codeclimate.com/v1/badges/621d6211cb2e0959ce00/maintainability @@ -36,7 +36,7 @@ [🔑depfu]: https://depfu.com/github/omniauth/omniauth-identity [🔑depfui♻️]: https://badges.depfu.com/badges/6c9b45362951b872127f9e46d39bed76/count.svg -[comment]: <> ( 🚎 BUILD LINKS ) + [🚎1-an-wf]: https://github.com/omniauth/omniauth-identity/actions/workflows/ancient.yml [🚎1-an-wfi]: https://github.com/omniauth/omniauth-identity/actions/workflows/ancient.yml/badge.svg @@ -78,13 +78,13 @@ to give up the simple authentication flow provided by OmniAuth. Identity is designed on purpose to be as featureless as possible: it provides the basic construct for user management and then gets out of the way. -| Primary Namespace | `OmniAuth::Identity` | -|-------------------|----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| -| documentation | [on Github.com][homepage], [on RubyDoc.info][documentation] | -| expert support | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) | +| Primary Namespace | `OmniAuth::Identity` | +|-------------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------| +| documentation | [on Github.com][homepage], [Latest release on RubyDoc.info][documentation], [HEAD on RubyDoc.info][documentation-head] | +| expert support | [![Get help on Codementor](https://cdn.codementor.io/badges/get_help_github.svg)](https://www.codementor.io/peterboling?utm_source=github&utm_medium=button&utm_term=peterboling&utm_campaign=github) | | `...` 💖 | [![Follow Me on LinkedIn][🖇linkedin-img]][🖇linkedin] [![Find Me on WellFound:][✌️wellfound-img]][✌️wellfound] [![Find Me on CrunchBase][💲crunchbase-img]][💲crunchbase] [![My LinkTree][🌳linktree-img]][🌳linktree] [![Follow Me on Ruby.Social][🐘ruby-mast-img]][🐘ruby-mast] [![Tweet @ Peter][🐦tweet-img]][🐦tweet] [💻][coderme] [🌏][aboutme] | - + [🐦tweet-img]: https://img.shields.io/twitter/follow/galtzo.svg?style=social&label=Follow%20%40galtzo [🐦tweet]: http://twitter.com/galtzo [🚎blog]: http://www.railsbling.com/tags/omniauth-identity/ @@ -100,7 +100,7 @@ basic construct for user management and then gets out of the way. [🌳linktree]: https://linktr.ee/galtzo [🌳linktree-img]: https://img.shields.io/badge/galtzo-purple?style=plastic&logo=linktree - + [aboutme]: https://about.me/peter.boling [coderme]: https://coderwall.com/Peter%20Boling @@ -433,7 +433,7 @@ spec.add_dependency("omniauth-identity", "~> 3.1") See [CHANGELOG.md][📌changelog] for list of releases. -[comment]: <> ( 📌 VERSIONING LINKS ) + [📌pvc]: http://guides.rubygems.org/patterns/#pessimistic-version-constraint [📌semver]: http://semver.org/ @@ -463,6 +463,7 @@ See [LICENSE.txt][📄license] for the official [Copyright Notice][📄copyright [peterboling]: http://www.peterboling.com [bundle-group-pattern]: https://gist.github.com/pboling/4564780 [documentation]: http://rubydoc.info/gems/omniauth-identity +[documentation-head]: https://rubydoc.info/github/omniauth/omniauth-identity/main [homepage]: https://github.com/omniauth/omniauth-identity ## 🤑 One more thing diff --git a/REEK b/REEK index b056a03..53f0b47 100644 --- a/REEK +++ b/REEK @@ -9,24 +9,24 @@ spec_orms/active_record_spec.rb -- 1 warning: spec_orms/support/rspec_config/mongoid.rb -- 1 warning: [12]:IrresponsibleModule: MongoidTestIdentity has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] lib/omniauth/identity/model.rb -- 18 warnings: - [50]:BooleanParameter: OmniAuth::Identity::Model::ClassMethods#auth_key has boolean parameter 'method' [https://github.com/troessner/reek/blob/v6.3.0/docs/Boolean-Parameter.md] - [139, 140]:DuplicateMethodCall: OmniAuth::Identity::Model#auth_key calls 'self.class' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] - [139, 140]:DuplicateMethodCall: OmniAuth::Identity::Model#auth_key calls 'self.class.auth_key' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] - [175, 175]:DuplicateMethodCall: OmniAuth::Identity::Model#info calls 'info["first_name"]' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] - [175, 175]:DuplicateMethodCall: OmniAuth::Identity::Model#info calls 'info["last_name"]' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] - [175, 176]:DuplicateMethodCall: OmniAuth::Identity::Model#info calls 'info["name"]' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] - [175, 175, 175, 175, 175, 176, 176]:FeatureEnvy: OmniAuth::Identity::Model#info refers to 'info' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.3.0/docs/Feature-Envy.md] - [67]:IrresponsibleModule: OmniAuth::Identity::Model::ClassCreateApi has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] - [34]:IrresponsibleModule: OmniAuth::Identity::Model::ClassMethods has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] - [96]:IrresponsibleModule: OmniAuth::Identity::Model::InstancePersistedApi has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] - [82]:IrresponsibleModule: OmniAuth::Identity::Model::InstanceSaveApi has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] - [139]:ManualDispatch: OmniAuth::Identity::Model#auth_key manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] - [154]:ManualDispatch: OmniAuth::Identity::Model#auth_key= manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] - [173]:ManualDispatch: OmniAuth::Identity::Model#info manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] - [28]:ManualDispatch: OmniAuth::Identity::Model#self.included manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] - [123]:ManualDispatch: OmniAuth::Identity::Model#uid manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] - [124]:NilCheck: OmniAuth::Identity::Model#uid performs a nil-check [https://github.com/troessner/reek/blob/v6.3.0/docs/Nil-Check.md] - [170]:TooManyStatements: OmniAuth::Identity::Model#info has approx 6 statements [https://github.com/troessner/reek/blob/v6.3.0/docs/Too-Many-Statements.md] + [52]:BooleanParameter: OmniAuth::Identity::Model::ClassMethods#auth_key has boolean parameter 'method' [https://github.com/troessner/reek/blob/v6.3.0/docs/Boolean-Parameter.md] + [141, 142]:DuplicateMethodCall: OmniAuth::Identity::Model#auth_key calls 'self.class' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] + [141, 142]:DuplicateMethodCall: OmniAuth::Identity::Model#auth_key calls 'self.class.auth_key' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] + [177, 177]:DuplicateMethodCall: OmniAuth::Identity::Model#info calls 'info["first_name"]' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] + [177, 177]:DuplicateMethodCall: OmniAuth::Identity::Model#info calls 'info["last_name"]' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] + [177, 178]:DuplicateMethodCall: OmniAuth::Identity::Model#info calls 'info["name"]' 2 times [https://github.com/troessner/reek/blob/v6.3.0/docs/Duplicate-Method-Call.md] + [177, 177, 177, 177, 177, 178, 178]:FeatureEnvy: OmniAuth::Identity::Model#info refers to 'info' more than self (maybe move it to another class?) [https://github.com/troessner/reek/blob/v6.3.0/docs/Feature-Envy.md] + [69]:IrresponsibleModule: OmniAuth::Identity::Model::ClassCreateApi has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] + [36]:IrresponsibleModule: OmniAuth::Identity::Model::ClassMethods has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] + [98]:IrresponsibleModule: OmniAuth::Identity::Model::InstancePersistedApi has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] + [84]:IrresponsibleModule: OmniAuth::Identity::Model::InstanceSaveApi has no descriptive comment [https://github.com/troessner/reek/blob/v6.3.0/docs/Irresponsible-Module.md] + [141]:ManualDispatch: OmniAuth::Identity::Model#auth_key manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] + [156]:ManualDispatch: OmniAuth::Identity::Model#auth_key= manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] + [29]:ManualDispatch: OmniAuth::Identity::Model#included manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] + [175]:ManualDispatch: OmniAuth::Identity::Model#info manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] + [125]:ManualDispatch: OmniAuth::Identity::Model#uid manually dispatches method call [https://github.com/troessner/reek/blob/v6.3.0/docs/Manual-Dispatch.md] + [126]:NilCheck: OmniAuth::Identity::Model#uid performs a nil-check [https://github.com/troessner/reek/blob/v6.3.0/docs/Nil-Check.md] + [172]:TooManyStatements: OmniAuth::Identity::Model#info has approx 6 statements [https://github.com/troessner/reek/blob/v6.3.0/docs/Too-Many-Statements.md] lib/omniauth/identity/models/couch_potato.rb -- 1 warning: [14]:TooManyStatements: OmniAuth::Identity::Models::CouchPotatoModule#self.included has approx 7 statements [https://github.com/troessner/reek/blob/v6.3.0/docs/Too-Many-Statements.md] lib/omniauth/identity/models/mongoid.rb -- 1 warning: diff --git a/Rakefile b/Rakefile index 369d4a7..76f8fd3 100644 --- a/Rakefile +++ b/Rakefile @@ -69,6 +69,26 @@ rescue LoadError end end +begin + require "yard-junk/rake" + + YardJunk::Rake.define_task +rescue LoadError + task("yard:junk") do + warn("yard:junk is disabled") + end +end + +begin + require "yard" + + YARD::Rake::YardocTask.new(:yard) +rescue LoadError + task(:yard) do + warn("yard is disabled") + end +end + begin require "rubocop/lts" Rubocop::Lts.install_tasks @@ -79,4 +99,4 @@ rescue LoadError end # These tests do not require any services to be running, so this is what we run as default -task default: %i[test:sqlite3 rubocop_gradual:autocorrect] +task default: %i[spec:orm:all rubocop_gradual:autocorrect yard yard:junk] diff --git a/bin/_guard-core b/bin/_guard-core new file mode 100755 index 0000000..9105b28 --- /dev/null +++ b/bin/_guard-core @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application '_guard-core' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("guard", "_guard-core") diff --git a/bin/appraisal b/bin/appraisal new file mode 100755 index 0000000..5038ce5 --- /dev/null +++ b/bin/appraisal @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'appraisal' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("appraisal", "appraisal") diff --git a/bin/bundle b/bin/bundle new file mode 100755 index 0000000..71881c3 --- /dev/null +++ b/bin/bundle @@ -0,0 +1,109 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'bundle' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +require "rubygems" + +m = Module.new do + module_function + + def invoked_as_script? + File.expand_path($0) == File.expand_path(__FILE__) + end + + def env_var_version + ENV["BUNDLER_VERSION"] + end + + def cli_arg_version + return unless invoked_as_script? # don't want to hijack other binstubs + return unless "update".start_with?(ARGV.first || " ") # must be running `bundle update` + bundler_version = nil + update_index = nil + ARGV.each_with_index do |a, i| + if update_index && update_index.succ == i && a.match?(Gem::Version::ANCHORED_VERSION_PATTERN) + bundler_version = a + end + next unless a =~ /\A--bundler(?:[= ](#{Gem::Version::VERSION_PATTERN}))?\z/o + bundler_version = $1 + update_index = i + end + bundler_version + end + + def gemfile + gemfile = ENV["BUNDLE_GEMFILE"] + return gemfile if gemfile && !gemfile.empty? + + File.expand_path("../Gemfile", __dir__) + end + + def lockfile + lockfile = + case File.basename(gemfile) + when "gems.rb" then gemfile.sub(/\.rb$/, ".locked") + else "#{gemfile}.lock" + end + File.expand_path(lockfile) + end + + def lockfile_version + return unless File.file?(lockfile) + lockfile_contents = File.read(lockfile) + return unless lockfile_contents =~ /\n\nBUNDLED WITH\n\s{2,}(#{Gem::Version::VERSION_PATTERN})\n/o + Regexp.last_match(1) + end + + def bundler_requirement + @bundler_requirement ||= + env_var_version || + cli_arg_version || + bundler_requirement_for(lockfile_version) + end + + def bundler_requirement_for(version) + return "#{Gem::Requirement.default}.a" unless version + + bundler_gem_version = Gem::Version.new(version) + + bundler_gem_version.approximate_recommendation + end + + def load_bundler! + ENV["BUNDLE_GEMFILE"] ||= gemfile + + activate_bundler + end + + def activate_bundler + gem_error = activation_error_handling do + gem("bundler", bundler_requirement) + end + return if gem_error.nil? + require_error = activation_error_handling do + require "bundler/version" + end + return if require_error.nil? && Gem::Requirement.new(bundler_requirement).satisfied_by?(Gem::Version.new(Bundler::VERSION)) + warn("Activating bundler (#{bundler_requirement}) failed:\n#{gem_error.message}\n\nTo install the version of bundler this project requires, run `gem install bundler -v '#{bundler_requirement}'`") + exit(42) + end + + def activation_error_handling + yield + nil + rescue StandardError, LoadError => e + e + end +end + +m.load_bundler! + +if m.invoked_as_script? + load Gem.bin_path("bundler", "bundle") +end diff --git a/bin/byebug b/bin/byebug new file mode 100755 index 0000000..abc90db --- /dev/null +++ b/bin/byebug @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'byebug' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("byebug", "byebug") diff --git a/bin/checksums b/bin/checksums new file mode 100755 index 0000000..5498152 --- /dev/null +++ b/bin/checksums @@ -0,0 +1,67 @@ +#!/usr/bin/env ruby + +# Script from https://github.com/rubygems/guides/pull/325 +require "digest/sha2" + +# Final clause of Regex `(?=\.gem)` is a positive lookahead assertion +# See: https://learnbyexample.github.io/Ruby_Regexp/lookarounds.html#positive-lookarounds +# Used to pattern match against a gem package name, which always ends with .gem. +# The positive lookahead ensures it is present, and prevents it from being captured. +VERSION_REGEX = /((\d+\.\d+\.\d+)([-.][0-9A-Za-z-]+)*)(?=\.gem)/ + +gem_path_parts = ARGV.first&.split("/") + +if gem_path_parts&.any? + gem_name = gem_path_parts.last + gem_pkg = File.join(gem_path_parts) + puts "Looking for: #{gem_pkg.inspect}" + gems = Dir[gem_pkg] + puts "Found: #{gems.inspect}" +else + gem_pkgs = File.join("pkg", "*.gem") + puts "Looking for: #{gem_pkgs.inspect}" + gems = Dir[gem_pkgs] + raise "Unable to find gems #{gem_pkgs}" if gems.empty? + + # Sort by newest last + # [ "my_gem-2.3.9.gem", "my_gem-2.3.11.pre.alpha.4.gem", "my_gem-2.3.15.gem", ... ] + gems.sort_by! { |gem| Gem::Version.new(gem[VERSION_REGEX]) } + gem_pkg = gems.last + gem_path_parts = gem_pkg.split("/") + gem_name = gem_path_parts.last + puts "Found: #{gems.length} gems; latest is #{gem_name}" +end + +checksum512 = Digest::SHA512.new.hexdigest(File.read(gem_pkg)) +checksum512_path = "checksums/#{gem_name}.sha512" +File.write(checksum512_path, checksum512) + +checksum256 = Digest::SHA256.new.hexdigest(File.read(gem_pkg)) +checksum256_path = "checksums/#{gem_name}.sha256" +File.write(checksum256_path, checksum256) + +version = gem_name[VERSION_REGEX] + +git_cmd = <<~GIT_MSG + git add checksums/* && \ + git commit -m "🔒️ Checksums for v#{version}" +GIT_MSG + +puts <<~RESULTS + [ GEM: #{gem_name} ] + [ VERSION: #{version} ] + [ GEM PKG LOCATION: #{gem_pkg} ] + [ CHECKSUM SHA-256: #{checksum256} ] + [ CHECKSUM SHA-512: #{checksum512} ] + [ CHECKSUM SHA-256 PATH: #{checksum256_path} ] + [ CHECKSUM SHA-512 PATH: #{checksum512_path} ] + + ... Running ... + + #{git_cmd} +RESULTS + +# This will replace the current process with the git process, and exit. +# Any command placed after this will not be run: +# See: https://www.akshaykhot.com/call-shell-commands-in-ruby +exec(git_cmd) diff --git a/bin/code_climate_reek b/bin/code_climate_reek new file mode 100755 index 0000000..afe0d79 --- /dev/null +++ b/bin/code_climate_reek @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'code_climate_reek' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("reek", "code_climate_reek") diff --git a/bin/coderay b/bin/coderay new file mode 100755 index 0000000..b13b22e --- /dev/null +++ b/bin/coderay @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'coderay' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("coderay", "coderay") diff --git a/bin/github-markup b/bin/github-markup new file mode 100755 index 0000000..5cb4793 --- /dev/null +++ b/bin/github-markup @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'github-markup' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("github-markup", "github-markup") diff --git a/bin/guard b/bin/guard new file mode 100755 index 0000000..ff444e0 --- /dev/null +++ b/bin/guard @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'guard' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("guard", "guard") diff --git a/bin/htmldiff b/bin/htmldiff new file mode 100755 index 0000000..0aeaec8 --- /dev/null +++ b/bin/htmldiff @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'htmldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "htmldiff") diff --git a/bin/httpclient b/bin/httpclient new file mode 100755 index 0000000..3e27b26 --- /dev/null +++ b/bin/httpclient @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'httpclient' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("httpclient", "httpclient") diff --git a/bin/ldiff b/bin/ldiff new file mode 100755 index 0000000..8173ede --- /dev/null +++ b/bin/ldiff @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'ldiff' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("diff-lcs", "ldiff") diff --git a/bin/listen b/bin/listen new file mode 100755 index 0000000..613171d --- /dev/null +++ b/bin/listen @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'listen' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("listen", "listen") diff --git a/bin/mongo_console b/bin/mongo_console new file mode 100755 index 0000000..1945b97 --- /dev/null +++ b/bin/mongo_console @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'mongo_console' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("mongo", "mongo_console") diff --git a/bin/pry b/bin/pry new file mode 100755 index 0000000..eb53052 --- /dev/null +++ b/bin/pry @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'pry' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("pry", "pry") diff --git a/bin/racc b/bin/racc new file mode 100755 index 0000000..8190015 --- /dev/null +++ b/bin/racc @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'racc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("racc", "racc") diff --git a/bin/rackup b/bin/rackup new file mode 100755 index 0000000..0af6faf --- /dev/null +++ b/bin/rackup @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rackup' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rack", "rackup") diff --git a/bin/rake b/bin/rake new file mode 100755 index 0000000..4eb7d7b --- /dev/null +++ b/bin/rake @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rake' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rake", "rake") diff --git a/bin/redcarpet b/bin/redcarpet new file mode 100755 index 0000000..76a1cb8 --- /dev/null +++ b/bin/redcarpet @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'redcarpet' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("redcarpet", "redcarpet") diff --git a/bin/reek b/bin/reek new file mode 100755 index 0000000..2ec4592 --- /dev/null +++ b/bin/reek @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'reek' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("reek", "reek") diff --git a/bin/rspec b/bin/rspec new file mode 100755 index 0000000..cb53ebe --- /dev/null +++ b/bin/rspec @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rspec' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rspec-core", "rspec") diff --git a/bin/rubocop b/bin/rubocop new file mode 100755 index 0000000..369a05b --- /dev/null +++ b/bin/rubocop @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop", "rubocop") diff --git a/bin/rubocop-gradual b/bin/rubocop-gradual new file mode 100755 index 0000000..0752005 --- /dev/null +++ b/bin/rubocop-gradual @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'rubocop-gradual' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("rubocop-gradual", "rubocop-gradual") diff --git a/bin/ruby-parse b/bin/ruby-parse new file mode 100755 index 0000000..d8ebc68 --- /dev/null +++ b/bin/ruby-parse @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'ruby-parse' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-parse") diff --git a/bin/ruby-rewrite b/bin/ruby-rewrite new file mode 100755 index 0000000..b4574ab --- /dev/null +++ b/bin/ruby-rewrite @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'ruby-rewrite' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("parser", "ruby-rewrite") diff --git a/bin/sequel b/bin/sequel new file mode 100755 index 0000000..d83a3d1 --- /dev/null +++ b/bin/sequel @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'sequel' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("sequel", "sequel") diff --git a/bin/setup b/bin/setup new file mode 100755 index 0000000..dce67d8 --- /dev/null +++ b/bin/setup @@ -0,0 +1,8 @@ +#!/usr/bin/env bash +set -euo pipefail +IFS=$'\n\t' +set -vx + +bundle install + +# Do any other automated setup that you need to do here diff --git a/bin/standardrb b/bin/standardrb new file mode 100755 index 0000000..b329561 --- /dev/null +++ b/bin/standardrb @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'standardrb' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("standard", "standardrb") diff --git a/bin/thor b/bin/thor new file mode 100755 index 0000000..ec40115 --- /dev/null +++ b/bin/thor @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'thor' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("thor", "thor") diff --git a/bin/yard b/bin/yard new file mode 100755 index 0000000..ea9daf5 --- /dev/null +++ b/bin/yard @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yard' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard", "yard") diff --git a/bin/yard-junk b/bin/yard-junk new file mode 100755 index 0000000..be420a5 --- /dev/null +++ b/bin/yard-junk @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yard-junk' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard-junk", "yard-junk") diff --git a/bin/yardoc b/bin/yardoc new file mode 100755 index 0000000..e1324dc --- /dev/null +++ b/bin/yardoc @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yardoc' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard", "yardoc") diff --git a/bin/yri b/bin/yri new file mode 100755 index 0000000..f968fde --- /dev/null +++ b/bin/yri @@ -0,0 +1,27 @@ +#!/usr/bin/env ruby +# frozen_string_literal: true + +# +# This file was generated by Bundler. +# +# The application 'yri' is installed as part of a gem, and +# this file is here to facilitate running it. +# + +ENV["BUNDLE_GEMFILE"] ||= File.expand_path("../Gemfile", __dir__) + +bundle_binstub = File.expand_path("bundle", __dir__) + +if File.file?(bundle_binstub) + if File.read(bundle_binstub, 300).include?("This file was generated by Bundler") + load(bundle_binstub) + else + abort("Your `bin/bundle` was not generated by Bundler, so this binstub cannot run. +Replace `bin/bundle` by running `bundle binstubs bundler --force`, then run this command again.") + end +end + +require "rubygems" +require "bundler/setup" + +load Gem.bin_path("yard", "yri") diff --git a/lib/omniauth/identity/model.rb b/lib/omniauth/identity/model.rb index 4e37f60..8559f80 100644 --- a/lib/omniauth/identity/model.rb +++ b/lib/omniauth/identity/model.rb @@ -2,7 +2,7 @@ module OmniAuth module Identity - # This module provides an includable interface for implementing the + # This module provides an include-able interface for implementing the # necessary API for OmniAuth Identity to properly locate identities # and provide all necessary information. # @@ -23,20 +23,22 @@ module Identity module Model SCHEMA_ATTRIBUTES = %w[name email nickname first_name last_name location description image phone].freeze - def self.included(base) - base.extend(ClassMethods) - base.extend(ClassCreateApi) unless base.respond_to?(:create) - im = base.instance_methods - base.include(InstanceSaveApi) unless im.include?(:save) - base.include(InstancePersistedApi) unless im.include?(:persisted?) + class << self + def included(base) + base.extend(ClassMethods) + base.extend(ClassCreateApi) unless base.respond_to?(:create) + i_methods = base.instance_methods + base.include(InstanceSaveApi) unless i_methods.include?(:save) + base.include(InstancePersistedApi) unless i_methods.include?(:persisted?) + end end module ClassMethods # Authenticate a user with the given key and password. # - # @param [String] key The unique login key provided for a given identity. + # @param [String] conditions The unique login key provided for a given identity. # @param [String] password The presumed password for the identity. - # @return [Model] An instance of the identity model class. + # @return [Model, false] An instance of the identity model class. def authenticate(conditions, password) instance = locate(conditions) return false unless instance @@ -57,7 +59,7 @@ def auth_key(method = false) # Locate an identity given its unique login key. # # @abstract - # @param [String] key The unique login key. + # @param [String] _key The unique login key. # @return [Model] An instance of the identity model class. def locate(_key) raise NotImplementedError @@ -71,7 +73,7 @@ module ClassCreateApi # # @deprecated v4.0 will begin using {#new} with {#save} instead. # @abstract - # @param [Hash] args Attributes of the new instance. + # @param [Hash] _args Attributes of the new instance. # @return [Model] An instance of the identity model class. # @since 3.0.5 def create(*_args) @@ -109,7 +111,7 @@ def persisted? # otherwise. # # @abstract - # @param [String] password The password to check. + # @param [String] _password The password to check. # @return [self or false] Self if authenticated, false if not. def authenticate(_password) raise NotImplementedError