Skip to content
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

Closed
wants to merge 1 commit into from

Conversation

mftaff
Copy link
Contributor

@mftaff mftaff commented Dec 18, 2017

No description provided.

# 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").

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]

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").

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]

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).

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]

module RouterHelpers
# Generates passwordless routes for a Model that is connected to Passwordless.

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]

module ModelHelpers
# Adds passwordless sign_in for SomeModel (examples: User, Admin).

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.

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,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

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]

class Mailer < ActionMailer::Base
default from: Passwordless.default_from_address


# Sends a magic link (secret token) email to allow sign in with

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected.

class Mailer < ActionMailer::Base
default from: Passwordless.default_from_address


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


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected.

# 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").

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]

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").

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]

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).

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]

module RouterHelpers
# Generates passwordless routes for a Model that is connected to Passwordless.

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]

module ModelHelpers
# Adds passwordless sign_in for SomeModel (examples: User, Admin).

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.

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,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

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]

class Mailer < ActionMailer::Base
default from: Passwordless.default_from_address


# Sends a magic link (secret token) email to allow sign in with

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected.

class Mailer < ActionMailer::Base
default from: Passwordless.default_from_address


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


Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Trailing whitespace detected.

@mikker
Copy link
Owner

mikker commented Dec 18, 2017

You can check all those Hound warnings locally using $ rubocop in the project dir :)

@mftaff
Copy link
Contributor Author

mftaff commented Dec 18, 2017

Awesome, good to know 😄
I will go fix 'em now.

class UrlSafeBase64Generator
# Generates a url safe base64 secure random number. :-)
# @param _session [Object] some Object that contains this class.
Copy link
Contributor Author

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?

Copy link
Owner

@mikker mikker Dec 18, 2017

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

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)
Copy link
Contributor Author

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?

Copy link
Owner

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 %>

@mftaff
Copy link
Contributor Author

mftaff commented Dec 19, 2017

@mikker Okay, I made those changes 😃 thanks for clarifying
How does it look now?
(I just realized that by amending to the old commit to keep the PR down to 1 commit means you can't easily see the new changes.... Whoops)

@mikker
Copy link
Owner

mikker commented Dec 27, 2017

Merged in #7
Thank you for your help! 💙💚💛💜❤️

@mikker mikker closed this Dec 27, 2017
@mftaff
Copy link
Contributor Author

mftaff commented Dec 27, 2017

😃 If I can ever be of service again, please feel free to reach out.

@mikker
Copy link
Owner

mikker commented Dec 27, 2017

Sure, how about this: #8 😃
What do you think?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants