-
Notifications
You must be signed in to change notification settings - Fork 0
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
Change client to webclient #15
Open
jwright
wants to merge
5
commits into
master
Choose a base branch
from
change-client-to-webclient
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
Changes from all commits
Commits
Show all changes
5 commits
Select commit
Hold shift + click to select a range
913d0f3
Change Slack.client to Slack.web_client
jwright 707cdb1
Change Slack::Client to Slack::WebClient
jwright 2367e32
Fix Hound issues
jwright d365b84
Custom style guide for Hound
jwright f234ea0
Use no space around default parameters
jwright File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
ruby: | ||
config_file: .ruby-style.yml | ||
|
||
fail_on_violations: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,248 @@ | ||
AllCops: | ||
Exclude: | ||
- "vendor/**/*" | ||
- "db/schema.rb" | ||
UseCache: false | ||
Style/CollectionMethods: | ||
Description: Preferred collection methods. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#map-find-select-reduce-size | ||
Enabled: true | ||
PreferredMethods: | ||
collect: map | ||
collect!: map! | ||
find: detect | ||
find_all: select | ||
reduce: inject | ||
Style/DotPosition: | ||
Description: Checks the position of the dot in multi-line method calls. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-multi-line-chains | ||
Enabled: true | ||
EnforcedStyle: trailing | ||
SupportedStyles: | ||
- leading | ||
- trailing | ||
Style/FileName: | ||
Description: Use snake_case for source file names. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#snake-case-files | ||
Enabled: false | ||
Exclude: [] | ||
Style/GuardClause: | ||
Description: Check for conditionals that can be replaced with guard clauses | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-nested-conditionals | ||
Enabled: false | ||
MinBodyLength: 1 | ||
Style/IfUnlessModifier: | ||
Description: Favor modifier if/unless usage when you have a single-line body. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#if-as-a-modifier | ||
Enabled: false | ||
MaxLineLength: 80 | ||
Style/OptionHash: | ||
Description: Don't use option hashes when you can use keyword arguments. | ||
Enabled: false | ||
Style/PercentLiteralDelimiters: | ||
Description: Use `%`-literal delimiters consistently | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#percent-literal-braces | ||
Enabled: false | ||
PreferredDelimiters: | ||
"%": "()" | ||
"%i": "()" | ||
"%q": "()" | ||
"%Q": "()" | ||
"%r": "{}" | ||
"%s": "()" | ||
"%w": "()" | ||
"%W": "()" | ||
"%x": "()" | ||
Style/PredicateName: | ||
Description: Check the names of predicate methods. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#bool-methods-qmark | ||
Enabled: true | ||
NamePrefix: | ||
- is_ | ||
- has_ | ||
- have_ | ||
NamePrefixBlacklist: | ||
- is_ | ||
Exclude: | ||
- spec/**/* | ||
Style/RaiseArgs: | ||
Description: Checks the arguments passed to raise/fail. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#exception-class-messages | ||
Enabled: false | ||
EnforcedStyle: exploded | ||
SupportedStyles: | ||
- compact | ||
- exploded | ||
Style/SignalException: | ||
Description: Checks for proper usage of fail and raise. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#fail-method | ||
Enabled: false | ||
EnforcedStyle: semantic | ||
SupportedStyles: | ||
- only_raise | ||
- only_fail | ||
- semantic | ||
Style/SingleLineBlockParams: | ||
Description: Enforces the names of some block params. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#reduce-blocks | ||
Enabled: false | ||
Methods: | ||
- reduce: | ||
- a | ||
- e | ||
- inject: | ||
- a | ||
- e | ||
Style/SingleLineMethods: | ||
Description: Avoid single-line methods. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-single-line-methods | ||
Enabled: false | ||
AllowIfMethodIsEmpty: true | ||
Style/SpaceAroundEqualsInParameterDefault: | ||
Description: Use a space around equals in parameter defaults | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#spaces-around-equals | ||
Enabled: true | ||
EnforcedStyle: no_space | ||
Style/StringLiterals: | ||
Description: Checks if uses of quotes match the configured preference. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#consistent-string-literals | ||
Enabled: true | ||
EnforcedStyle: double_quotes | ||
SupportedStyles: | ||
- single_quotes | ||
- double_quotes | ||
Style/StringLiteralsInInterpolation: | ||
Description: Checks if uses of quotes inside expressions in interpolated strings | ||
match the configured preference. | ||
Enabled: true | ||
EnforcedStyle: single_quotes | ||
SupportedStyles: | ||
- single_quotes | ||
- double_quotes | ||
Style/TrailingCommaInArguments: | ||
Description: 'Checks for trailing comma in argument lists.' | ||
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' | ||
Enabled: false | ||
EnforcedStyleForMultiline: no_comma | ||
SupportedStyles: | ||
- comma | ||
- consistent_comma | ||
- no_comma | ||
Style/TrailingCommaInLiteral: | ||
Description: 'Checks for trailing comma in array and hash literals.' | ||
StyleGuide: 'https://github.com/bbatsov/ruby-style-guide#no-trailing-array-commas' | ||
Enabled: false | ||
EnforcedStyleForMultiline: no_comma | ||
SupportedStyles: | ||
- comma | ||
- consistent_comma | ||
- no_comma | ||
Metrics/AbcSize: | ||
Description: A calculated magnitude based on number of assignments, branches, and | ||
conditions. | ||
Enabled: false | ||
Max: 15 | ||
Metrics/ClassLength: | ||
Description: Avoid classes longer than 100 lines of code. | ||
Enabled: false | ||
CountComments: false | ||
Max: 100 | ||
Metrics/ModuleLength: | ||
CountComments: false | ||
Max: 100 | ||
Description: Avoid modules longer than 100 lines of code. | ||
Enabled: false | ||
Metrics/CyclomaticComplexity: | ||
Description: A complexity metric that is strongly correlated to the number of test | ||
cases needed to validate a method. | ||
Enabled: false | ||
Max: 6 | ||
Metrics/MethodLength: | ||
Description: Avoid methods longer than 10 lines of code. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#short-methods | ||
Enabled: false | ||
CountComments: false | ||
Max: 10 | ||
Metrics/ParameterLists: | ||
Description: Avoid parameter lists longer than three or four parameters. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#too-many-params | ||
Enabled: false | ||
Max: 5 | ||
CountKeywordArgs: true | ||
Metrics/PerceivedComplexity: | ||
Description: A complexity metric geared towards measuring complexity for a human | ||
reader. | ||
Enabled: false | ||
Max: 7 | ||
Lint/AssignmentInCondition: | ||
Description: Don't use assignment in conditions. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#safe-assignment-in-condition | ||
Enabled: false | ||
AllowSafeAssignment: true | ||
Style/InlineComment: | ||
Description: Avoid inline comments. | ||
Enabled: false | ||
Style/AccessorMethodName: | ||
Description: Check the naming of accessor methods for get_/set_. | ||
Enabled: false | ||
Style/Alias: | ||
Description: Use alias_method instead of alias. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#alias-method | ||
Enabled: false | ||
Style/Documentation: | ||
Description: Document classes and non-namespace modules. | ||
Enabled: false | ||
Style/DoubleNegation: | ||
Description: Checks for uses of double negation (!!). | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-bang-bang | ||
Enabled: false | ||
Style/EachWithObject: | ||
Description: Prefer `each_with_object` over `inject` or `reduce`. | ||
Enabled: false | ||
Style/EmptyLiteral: | ||
Description: Prefer literals to Array.new/Hash.new/String.new. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#literal-array-hash | ||
Enabled: false | ||
Style/ModuleFunction: | ||
Description: Checks for usage of `extend self` in modules. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#module-function | ||
Enabled: false | ||
Style/OneLineConditional: | ||
Description: Favor the ternary operator(?:) over if/then/else/end constructs. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#ternary-operator | ||
Enabled: false | ||
Style/PerlBackrefs: | ||
Description: Avoid Perl-style regex back references. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-perl-regexp-last-matchers | ||
Enabled: false | ||
Style/Send: | ||
Description: Prefer `Object#__send__` or `Object#public_send` to `send`, as `send` | ||
may overlap with existing methods. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#prefer-public-send | ||
Enabled: false | ||
Style/SpecialGlobalVars: | ||
Description: Avoid Perl-style global variables. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#no-cryptic-perlisms | ||
Enabled: false | ||
Style/VariableInterpolation: | ||
Description: Don't interpolate global, instance and class variables directly in | ||
strings. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#curlies-interpolate | ||
Enabled: false | ||
Style/WhenThen: | ||
Description: Use when x then ... for one-line cases. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#one-line-cases | ||
Enabled: false | ||
Lint/EachWithObjectArgument: | ||
Description: Check for immutable argument given to each_with_object. | ||
Enabled: true | ||
Lint/HandleExceptions: | ||
Description: Don't suppress exception. | ||
StyleGuide: https://github.com/bbatsov/ruby-style-guide#dont-hide-exceptions | ||
Enabled: false | ||
Lint/LiteralInCondition: | ||
Description: Checks of literals used in conditions. | ||
Enabled: false | ||
Lint/LiteralInInterpolation: | ||
Description: Checks for literals used in interpolation. | ||
Enabled: false |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,24 +1,24 @@ | ||
require 'laziness/version' | ||
require 'laziness/api' | ||
require 'laziness/base' | ||
require 'laziness/auth' | ||
require 'laziness/channel' | ||
require 'laziness/chat' | ||
require 'laziness/client' | ||
require 'laziness/errors' | ||
require 'laziness/group' | ||
require 'laziness/message' | ||
require 'laziness/oauth' | ||
require 'laziness/observer' | ||
require 'laziness/real_time_client' | ||
require 'laziness/registry' | ||
require 'laziness/session' | ||
require 'laziness/user' | ||
require "laziness/version" | ||
require "laziness/api" | ||
require "laziness/base" | ||
require "laziness/auth" | ||
require "laziness/channel" | ||
require "laziness/chat" | ||
require "laziness/web_client" | ||
require "laziness/errors" | ||
require "laziness/group" | ||
require "laziness/message" | ||
require "laziness/oauth" | ||
require "laziness/observer" | ||
require "laziness/real_time_client" | ||
require "laziness/registry" | ||
require "laziness/session" | ||
require "laziness/user" | ||
|
||
module Slack | ||
class << self | ||
def client(attributes={}) | ||
Slack::Client.new(attributes[:access_token]) | ||
def web_client(attributes={}) | ||
Slack::WebClient.new(attributes[:access_token]) | ||
end | ||
end | ||
end |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,5 @@ | ||
module Slack | ||
class Client | ||
class WebClient | ||
attr_reader :access_token | ||
|
||
def initialize(access_token=nil) | ||
|
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
describe Slack::WebClient do | ||
it "returns a new client" do | ||
expect(Slack.web_client(access_token: "blah")).to \ | ||
be_instance_of Slack::WebClient | ||
end | ||
|
||
it "assigns the access token" do | ||
expect(Slack.web_client(access_token: "blah").access_token).to eq "blah" | ||
end | ||
end |
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
Surrounding space missing in default value assignment.