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

Start exposing lists and package results via the API #132 #137

Merged
merged 4 commits into from
Mar 5, 2015

Conversation

Jaykul
Copy link
Contributor

@Jaykul Jaykul commented Mar 2, 2015

This is mostly so you can review and provide feedback ;-)

@gep13
Copy link
Member

gep13 commented Mar 2, 2015

@ferventcoder I gave the Travis build a kick, as it seemed to time out when restoring nuget packages

@Jaykul
Copy link
Contributor Author

Jaykul commented Mar 2, 2015

Let me know what you think -- I have at least one more "list" method to add (on the list command) and probably two (on the install command).

Also -- I stuck your copyright statement on the tops of the three files I had to add, but I noticed all your copyright headers say 2011 (except the three that I just added, ha).

@ferventcoder
Copy link
Member

Also -- I stuck your copyright statement on the tops of the three files I had to add, but I noticed all your copyright headers say 2011 (except the three that I just added, ha).

They say 2011 - Present.

@ferventcoder
Copy link
Member

Value = source.Value,
Disabled = source.Disabled,
Authenticated = string.IsNullOrWhiteSpace(source.Password)
};
Copy link
Member

Choose a reason for hiding this comment

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

One can logresults AND return, which could get interesting if you want it to log all of the results before returning. What benefits do you gain in yielding?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Nothing much -- I'm outputting the members as I receive them. It's a habit from writing PowerShell pipeline stuff, and it also means I don't have to actually create an IEnumerable to return.

It's fine to cache the new objects and output them all at once if you prefer.

@ferventcoder
Copy link
Member

So much prettier

@ferventcoder
Copy link
Member

Okay, you can rebase and drop 524f217


namespace chocolatey.infrastructure.app.configuration
{
public sealed class ChocolateySource
Copy link
Member

Choose a reason for hiding this comment

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

Since this is presented to the outside, would you think sealed or inheritable?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

sure, I'll unseal it.

Jaykul added 4 commits March 3, 2015 22:50
In order to make commands support listing, add a new command interface
 the IListCommand interface is an ICommand with an extra method "list"
Refactor GenericRunner.run to a common find_command and separate the
 run and list methods which call different methods on the underlying
 command (IListCommand).

Previously we only supported GenericRunner.run, this also updates
 GetChocolatey to add a list method that calls GenericRunner.list
@Jaykul
Copy link
Contributor Author

Jaykul commented Mar 5, 2015

Do you want to merge this one and deal with the others separately?

configuration.RegularOuptut = true;
var runner = new GenericRunner();
return runner.list<T>(configuration, _container, isConsole: false, parseArgs: null);
}
Copy link
Member

Choose a reason for hiding this comment

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

👍

Copy link
Member

Choose a reason for hiding this comment

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

I tend to push return statements to have an empty line before. This looks good though.

@ferventcoder
Copy link
Member

Looks great! Next time use a topic branch ;)

ferventcoder added a commit that referenced this pull request Mar 5, 2015
Start exposing lists and package results via the API #132
@ferventcoder ferventcoder merged commit 1d8448c into chocolatey:master Mar 5, 2015
@Jaykul
Copy link
Contributor Author

Jaykul commented Mar 5, 2015

Yeah, you know ... ever since my first github pull request (when I learned that additional commits to the branch become part of the pull request), I usually do that. I don't remember why I didn't in this case, other than the whole "I'm just fixing this one thing" mentality ;-)

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.

3 participants