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

CommandsHelper class and Help module refactoring #182

Merged
merged 2 commits into from
Mar 30, 2018

Conversation

mdudzinski
Copy link
Collaborator

This is a PR related to the refactoring discussion under #180.

@mdudzinski
Copy link
Collaborator Author

mdudzinski commented Mar 21, 2018

@dblock I took into account your comment about CommandsHelper naming issue.

I think we can cut a release once we agree on this refactoring. I can also take a look into rest of your suggestions before we do this to avoid public interface changes later.

CHANGELOG.md Outdated
@@ -1,6 +1,7 @@
### 0.10.6 (Next)

* Your contribution here.
* [#182](https://github.com/slack-ruby/slack-ruby-bot/pull/182): CommandsHelper class and Help module refactoring - [@mdudzinski](https://github.com/mdudzinski).
Copy link
Collaborator

Choose a reason for hiding this comment

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

Sounds better as Refactored ...

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, I'll change it.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Actually, it should be Refactor ... as commit title/summary should be imperative. Unless you want the pr's title to be different than the commit's one.

@@ -1,5 +1,5 @@
require 'slack-ruby-bot/commands/base'
require 'slack-ruby-bot/commands/about'
require 'slack-ruby-bot/commands/help'
require 'slack-ruby-bot/commands/help_command'
Copy link
Collaborator

Choose a reason for hiding this comment

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

This one should be help, just like about or hi, not _command, no?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Well, I didn't want it to be confusing with SlackRubyBot::Commands::Help from commands/support. And the class name is HelpCommand so I thought its file should match that name.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I'm just thinking either all commands are SomethingCommand or Something. Thoughts?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Just Something seems to be better but then the help command's class should be renamed to Help and we'll have to change the name of Help class in support. Or add a namespace like SlackRubyBot::Commands::Support::Help.

Copy link
Collaborator

Choose a reason for hiding this comment

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

I like the namespace idea.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dblock Okay I'll change it. If there's anything else, let me know. Thanks :)

Michal Dudzinski added 2 commits March 29, 2018 17:29
The 'Help' namespace was renamed to `Support`
and the 'help' directory was renamed to 'support'.

Since 'CommandHelper' was a confusing utility name
(it just handles commands help), it was renamed to 'Help'
and moved to 'commands/support' directory. Now its full name is
'SlackRubyBot::Commands::Support::Help'.
@mdudzinski
Copy link
Collaborator Author

@dblock Updated, please take a look. Thanks!

@dblock dblock merged commit b1b7cb6 into slack-ruby:master Mar 30, 2018
@dblock
Copy link
Collaborator

dblock commented Mar 30, 2018

Perfect, merged.

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.

2 participants