-
-
Notifications
You must be signed in to change notification settings - Fork 86
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
add YARD docs for all files in lib/ and app/ #6
Conversation
lib/passwordless/router_helpers.rb
Outdated
# Generates passwordless routes for a Model that is connected to Passwordless. | ||
# @param resource [Symbol] the pluralized symbol of your Model (e.g - :users). | ||
# @param at [string] Optional - provide custom path (i.e controller) for routes (e.g "users"). | ||
# @param as [string] Optional - provide custom url for routes (e.g "special-users"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [88/80]
lib/passwordless/router_helpers.rb
Outdated
module RouterHelpers | ||
# Generates passwordless routes for a Model that is connected to Passwordless. | ||
# @param resource [Symbol] the pluralized symbol of your Model (e.g - :users). | ||
# @param at [string] Optional - provide custom path (i.e controller) for routes (e.g "users"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [98/80]
lib/passwordless/router_helpers.rb
Outdated
module RouterHelpers | ||
# Generates passwordless routes for a Model that is connected to Passwordless. | ||
# @param resource [Symbol] the pluralized symbol of your Model (e.g - :users). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
lib/passwordless/router_helpers.rb
Outdated
module RouterHelpers | ||
# Generates passwordless routes for a Model that is connected to Passwordless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
lib/passwordless/model_helpers.rb
Outdated
module ModelHelpers | ||
# Adds passwordless sign_in for SomeModel (examples: User, Admin). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
@@ -1,7 +1,17 @@ | |||
# frozen_string_literal: true | |||
|
|||
module Passwordless | |||
# Some helpers for controllers that are connected to passswordless Models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
app/models/passwordless/session.rb
Outdated
@@ -1,7 +1,7 @@ | |||
# frozen_string_literal: true | |||
|
|||
module Passwordless | |||
# The session responsible holding the connection between the record trying to | |||
# The session responsible for holding the connection between the record trying to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [83/80]
app/mailers/passwordless/mailer.rb
Outdated
class Mailer < ActionMailer::Base | ||
default from: Passwordless.default_from_address | ||
|
||
|
||
# Sends a magic link (secret token) email to allow sign in with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
app/mailers/passwordless/mailer.rb
Outdated
class Mailer < ActionMailer::Base | ||
default from: Passwordless.default_from_address | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
@@ -45,7 +58,11 @@ def show | |||
redirect_to main_app.root_path | |||
end | |||
end | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
lib/passwordless/router_helpers.rb
Outdated
# Generates passwordless routes for a Model that is connected to Passwordless. | ||
# @param resource [Symbol] the pluralized symbol of your Model (e.g - :users). | ||
# @param at [string] Optional - provide custom path (i.e controller) for routes (e.g "users"). | ||
# @param as [string] Optional - provide custom url for routes (e.g "special-users"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [88/80]
lib/passwordless/router_helpers.rb
Outdated
module RouterHelpers | ||
# Generates passwordless routes for a Model that is connected to Passwordless. | ||
# @param resource [Symbol] the pluralized symbol of your Model (e.g - :users). | ||
# @param at [string] Optional - provide custom path (i.e controller) for routes (e.g "users"). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [98/80]
lib/passwordless/router_helpers.rb
Outdated
module RouterHelpers | ||
# Generates passwordless routes for a Model that is connected to Passwordless. | ||
# @param resource [Symbol] the pluralized symbol of your Model (e.g - :users). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
lib/passwordless/router_helpers.rb
Outdated
module RouterHelpers | ||
# Generates passwordless routes for a Model that is connected to Passwordless. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [82/80]
lib/passwordless/model_helpers.rb
Outdated
module ModelHelpers | ||
# Adds passwordless sign_in for SomeModel (examples: User, Admin). |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
@@ -1,7 +1,17 @@ | |||
# frozen_string_literal: true | |||
|
|||
module Passwordless | |||
# Some helpers for controllers that are connected to passswordless Models. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
app/models/passwordless/session.rb
Outdated
@@ -1,7 +1,7 @@ | |||
# frozen_string_literal: true | |||
|
|||
module Passwordless | |||
# The session responsible holding the connection between the record trying to | |||
# The session responsible for holding the connection between the record trying to |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Line is too long. [83/80]
app/mailers/passwordless/mailer.rb
Outdated
class Mailer < ActionMailer::Base | ||
default from: Passwordless.default_from_address | ||
|
||
|
||
# Sends a magic link (secret token) email to allow sign in with |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
app/mailers/passwordless/mailer.rb
Outdated
class Mailer < ActionMailer::Base | ||
default from: Passwordless.default_from_address | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
@@ -45,7 +58,11 @@ def show | |||
redirect_to main_app.root_path | |||
end | |||
end | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Trailing whitespace detected.
You can check all those Hound warnings locally using |
Awesome, good to know 😄 |
class UrlSafeBase64Generator | ||
# Generates a url safe base64 secure random number. :-) | ||
# @param _session [Object] some Object that contains this class. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikker I wasn't sure if I fully understood how to use this param. Maybe there is a better way to describe it?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We pass the session to the generator so that if you wanted to use it in any way in your custom token generator you can. Say your user has a name, you could make a custom generator that uses that for the tokens:
class NameTokenGenerator
def self.call(session)
"#{session.authenticatable.name}-gets-a-token"
end
end
Happens here:
https://github.com/mikker/passwordless/blob/master/app/models/passwordless/session.rb#L25
lib/passwordless/router_helpers.rb
Outdated
module RouterHelpers | ||
# Generates passwordless routes for any Model connected to Passwordless. | ||
# @param resource [Symbol] the pluralized symbol of a Model (e.g - :users). | ||
# @param at [string] Optional - provide custom path (i.e controller) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@mikker I also wasn't sure if I understood what could be provided for at
and as
.
Can you review these lines as well?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Perhaps it's best shown with examples:
passwordless_for :users, at: 'session_stuff', as: :user_session_things
The passwordless engine get's mounted at at
, eg your urls end up like:
/session_stuff/sign_in
Your url helpers get scoped under as
, eg in a view:
<%= link_to 'Sign in', user_session_things.sign_in_path %>
@mikker Okay, I made those changes 😃 thanks for clarifying |
Merged in #7 |
😃 If I can ever be of service again, please feel free to reach out. |
Sure, how about this: #8 😃 |
No description provided.