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

Implement #2 #13

Merged
merged 5 commits into from
Jan 26, 2015
Merged

Implement #2 #13

merged 5 commits into from
Jan 26, 2015

Conversation

damondouglas
Copy link
Contributor

@seaneagan thank you so much for this opportunity. Even if my PR is not accepted, I appreciate what I've learned from your code and this experience.

var depContents = _yamlMap['dependencies'] != null ? _block('dependencies') : '';
var devdepContents = _yamlMap['dev_dependencies'] != null ? _block('dev_dependencies') : '';;

return "$fieldContents$envContents$depContents$devdepContents";
Copy link
Owner

Choose a reason for hiding this comment

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

I don't think we can assume this order or that there are not other fields to include. I think it needs to go through the contents of the _yamlMap and generically highlight things. I'd be ok with saving the semantic highlighting for later though.

@damondouglas
Copy link
Contributor Author

@seaneagan In a later PR, I would like to then have a property in Pubspec for syntax highlighted contents. Thank you, again.

return new Question("$field (${_yamlMap[field]})");
});

@SubCommand(help: 'Initiate or edit pubspec.yaml file.')
Copy link
Owner

Choose a reason for hiding this comment

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

"pubspec.yaml file" -> "a pubspec"

Copy link
Owner

Choose a reason for hiding this comment

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

"Initiate" -> "Initialize"

@seaneagan
Copy link
Owner

That's all I have for now. It's getting close!

@damondouglas
Copy link
Contributor Author

@seaneagan Thank you for your patience and help! Will keep pushing to make it right!

@damondouglas
Copy link
Contributor Author

@seaneagan , finished edits. Should we add logging to the project and log errors? Also, since we made Pubspec.init async, should we also make Pubpsec.load async as well? I also want to try building tests for each command. Any of these you like, I can create separate issues for tracking. Thank you again for walking me through this. I learned so much and open to more edits/suggestions as well.

@@ -87,6 +108,41 @@ class Pubspec {
this._contents,
this._yamlMap);

static Future<Pubspec> init() {
var completer = new Completer();
Copy link
Owner

Choose a reason for hiding this comment

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

I always implement Future-returning methods with something like:

=> new Future(() { /* code */ })

to ensure all errors are caught, and for readability (clear that a Future is actually returned).

Copy link
Owner

Choose a reason for hiding this comment

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

Most of the time Completers can be avoided, they shouldn't be required here.

@seaneagan
Copy link
Owner

@damondouglas Hey no problem at all, thanks for working on this! Done reviewing this round. Tracking issues for logging, command tests, and async Pubspec.load sound good.

@damondouglas
Copy link
Contributor Author

@seaneagan , Here is this round of edits. I tried to have an elegant parser map but kept having a Segmentation fault (core dumped) error when calling a key: Function map. As always, I'm open to more suggestions if you are willing. Thank you, again.

seaneagan added a commit that referenced this pull request Jan 26, 2015
@seaneagan seaneagan merged commit 42cbb38 into seaneagan:master Jan 26, 2015
@seaneagan
Copy link
Owner

@damondouglas this looks like a good start, merging. Thanks for working on this! There are still a few things that don't work from my testing, so I'm going to fix those shortly. Then I'm going to fix #5 and attempt to integrate den into stagehand before releasing the spec command so I can announce that all together.

@damondouglas
Copy link
Contributor Author

@seaneagan , thank you for kindly letting me try this and for your help. I'm going to start working on #15.

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