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

Chain Concatenation with BONTextables #161

Merged

Conversation

nevillco
Copy link
Contributor

  • Deprecated appendLink with separator string
  • Implemented appendLink with BONTextable
  • Updated example code accordingly
  • Updated readme accordingly

Fixes #160

Connor Neville added 2 commits July 11, 2016 12:20
- Implemented appendLink with BONTextable
- Updated example code accordingly
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

#req whitespace. Do you have clang-format installed as per the readme? It should catch this.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Huh, I thought I did. I'll see what's wrong.


@end

@interface BONChain (Deprecated)

@property (copy, nonatomic, readonly) BONChainColor textColor __attribute__((deprecated("use -color instead")));

- (void)appendLink:(id<BONTextable>)link separator:(BONNullable NSString *)separator __attribute__((deprecated("use -appendLink:link separatorTextable:separator instead")));
Copy link
Collaborator

Choose a reason for hiding this comment

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

#req the way to spell the name of the new method is -appendLink:separatorTextable:.

@ZevEisenberg
Copy link
Collaborator

#nth this all came about because the documentation and the code didn't agree with each other. Was this code tested before you changed it? If so, please add new tests for the new behavior. If not, some tests would be nice to confirm that the new behavior works consistently.

Connor Neville added 3 commits July 12, 2016 09:27
- Added some test classes that did not have target membership in BonMotTests
- Updated existing tests that used deprecated version of appendLink
- testAppendingWithDifferentAttributes: in BONTextableTestCase tests the behavior described in the readme

@end

@interface BONChain (Deprecated)

@property (copy, nonatomic, readonly) BONChainColor textColor __attribute__((deprecated("use -color instead")));

- (void)appendLink:(id<BONTextable>)link separator:(BONNullable NSString *)separator __attribute__((deprecated("use -appendLink: separatorTextable: instead")));
Copy link
Collaborator

Choose a reason for hiding this comment

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

#req no space: -appendLink:separatorTextable:. That wasn't a typo - it's just a quirk of how Obj-C selector names are spelled.

@@ -441,4 +441,14 @@ - (BONChainColor)textColor
return self.color;
}

- (void)appendLink:(id<BONTextable>)link separator:(NSString *)separator
{
if (separator.length > 0) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

#pp I think you can just forward this to appendLink:separatorTextable, and wrap separator in a BONChain. Might be problematic because you modified the tests instead of adding new tests, so they don't test this method any more. Not sure if it's worth keeping the old and new tests, though ¯_(ツ)_/¯

@@ -441,4 +441,9 @@ - (BONChainColor)textColor
return self.color;
}

- (void)appendLink:(id<BONTextable>)link separator:(NSString *)separator
{
[self appendLink:link separatorTextable:BONChain.new.string(separator)];
Copy link
Collaborator

Choose a reason for hiding this comment

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

#req I may have misled you before. I believe, to keep the original behavior, you need to use self.string(separator) here. If you change it, you'll see that some of your test changes result in failing tests.

@ZevEisenberg ZevEisenberg merged commit 43d0d16 into master Jul 15, 2016
@ZevEisenberg ZevEisenberg deleted the feature/connorneville/Chain-Concatenation-Textable-Separator branch July 15, 2016 15:22
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