WebTheoryLLC / omniauth-twitch

OmniAuth Strategy for Twitch
MIT License
32 stars 22 forks source link

Helix api gem #12

Closed piotrjaworski closed 6 years ago

piotrjaworski commented 6 years ago

Added implementation of the new Helix API

ossareh commented 6 years ago

Hey,

I think you should prefer double quoted strings unless you’re trying to avoid backslashes <_<

On Tue, Feb 6, 2018 at 09:09 Hound notifications@github.com wrote:

@houndci-bot commented on this pull request.

In lib/omniauth/twitch/version.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332572 :

@@ -1,5 +1,5 @@ module OmniAuth module Twitch

  • VERSION = "0.2.0"
  • VERSION = '1.0.0'

Freeze mutable objects assigned to constants. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332575 :

@@ -1,2 +1,2 @@ -require "omniauth/twitch/version" +require 'omniauth/twitch/version'

Missing magic comment # frozen_string_literal: true. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332579 :

@@ -40,31 +42,11 @@ class Twitch < OmniAuth::Strategies::OAuth2 end

   def raw_info
  • @raw_info ||= access_token.get('/kraken/user.json').parsed
  • end
  • def build_access_token
  • super.tap do |token|
  • token.options.merge!(access_token_options)
  • end
  • end
  • def access_token_options
  • options.access_token_options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }
  • @_raw_info ||= access_token.get('/helix/users.json').parsed

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332580 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],
  • nickname: raw_info['data'].first['login'],
  • description: raw_info['data'].first['description'],
  • image_url: raw_info['data'].first['profile_image_url'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332581 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],
  • nickname: raw_info['data'].first['login'],
  • description: raw_info['data'].first['description'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332582 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],
  • nickname: raw_info['data'].first['login'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332583 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332585 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332586 :

   }
  • option :authorize_options, [:scope]
  • uid{ raw_info['_id'] }
  • uid { raw_info['data'].first['id'] }

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332587 :

   option :access_token_options, {

header_format: 'OAuth %s',

  • param_name: 'access_token'
  • param_name: 'code'

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332588 :

     token_url: '/kraken/oauth2/token'

}

  • option :authorize_params, {}
  • option :authorize_options, [:scope, :response_type]
  • option :response_type, 'code'

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332589 :

     token_url: '/kraken/oauth2/token'

}

  • option :authorize_params, {}
  • option :authorize_options, [:scope, :response_type]

Use %i or %I for an array of symbols.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332593 :

option :client_options, { site: 'https://api.twitch.tv',

  • authorize_url: "/kraken/oauth2/authorize",
  • authorize_url: '/kraken/oauth2/authorize',

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#discussion_r166332594 :

  • option :name, "twitch"
  • option :name, 'twitch'

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#pullrequestreview-94377470, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP3r1Q00yGBQ__jOkkvh45AZwc53GOlks5tSGszgaJpZM4R7M2s .

jcgertig commented 6 years ago

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In case you missed it. 😀

On Feb 6, 2018 9:57 AM, "Michael Ossareh" notifications@github.com wrote:

Hey,

I think you should prefer double quoted strings unless you’re trying to avoid backslashes <_<

On Tue, Feb 6, 2018 at 09:09 Hound notifications@github.com wrote:

@houndci-bot commented on this pull request.

In lib/omniauth/twitch/version.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332572 :

@@ -1,5 +1,5 @@ module OmniAuth module Twitch

  • VERSION = "0.2.0"
  • VERSION = '1.0.0'

Freeze mutable objects assigned to constants. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332575 :

@@ -1,2 +1,2 @@ -require "omniauth/twitch/version" +require 'omniauth/twitch/version'

Missing magic comment # frozen_string_literal: true. Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332579 :

@@ -40,31 +42,11 @@ class Twitch < OmniAuth::Strategies::OAuth2 end

def raw_info

  • @raw_info ||= access_token.get('/kraken/user.json').parsed
  • end
  • def build_access_token
  • super.tap do |token|
  • token.options.merge!(access_token_options)
  • end
  • end
  • def access_token_options
  • options.access_token_options.inject({}) { |h,(k,v)| h[k.to_sym] = v; h }
  • @_raw_info ||= access_token.get('/helix/users.json').parsed

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332580 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],
  • nickname: raw_info['data'].first['login'],
  • description: raw_info['data'].first['description'],
  • image_url: raw_info['data'].first['profile_image_url'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332581 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],
  • nickname: raw_info['data'].first['login'],
  • description: raw_info['data'].first['description'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332582 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],
  • nickname: raw_info['data'].first['login'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332583 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],
  • email: raw_info['data'].first['email'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332585 :

info do {

  • name: raw_info['display_name'],
  • email: raw_info['email'],
  • nickname: raw_info['name'],
  • description: raw_info['bio'],
  • image: raw_info['logo'],
  • urls: { Twitch: "http://www.twitch.tv/#{raw_info['name']}" }
  • name: raw_info['data'].first['display_name'],

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332586 :

}

  • option :authorize_options, [:scope]
  • uid{ raw_info['_id'] }
  • uid { raw_info['data'].first['id'] }

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332587 :

option :access_token_options, { header_format: 'OAuth %s',

  • param_name: 'access_token'
  • param_name: 'code'

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332588 :

token_url: '/kraken/oauth2/token' }

  • option :authorize_params, {}
  • option :authorize_options, [:scope, :response_type]
  • option :response_type, 'code'

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332589 :

token_url: '/kraken/oauth2/token' }

  • option :authorize_params, {}
  • option :authorize_options, [:scope, :response_type]

Use %i or %I for an array of symbols.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332593 :

option :client_options, { site: 'https://api.twitch.tv',

  • authorize_url: "/kraken/oauth2/authorize",
  • authorize_url: '/kraken/oauth2/authorize',

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

In lib/omniauth/strategies/twitch.rb https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#discussion_r166332594 :

  • option :name, "twitch"
  • option :name, 'twitch'

Prefer double-quoted strings unless you need single quotes to avoid extra backslashes for escaping.

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WebTheoryLLC/omniauth-twitch/ pull/12#pullrequestreview-94377470, or mute the thread https://github.com/notifications/unsubscribe-auth/AAP3r1Q00yGBQ__ jOkkvh45AZwc53GOlks5tSGszgaJpZM4R7M2s .

— You are receiving this because you are subscribed to this thread. Reply to this email directly, view it on GitHub https://github.com/WebTheoryLLC/omniauth-twitch/pull/12#issuecomment-363467605, or mute the thread https://github.com/notifications/unsubscribe-auth/AAbyu_yQQYjC8no6H1t8v0VsHdBbqe1rks5tSHZbgaJpZM4R7M2s .