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

Docs shorthand object notation #4356

Merged
merged 4 commits into from
Nov 21, 2016
Merged

Docs shorthand object notation #4356

merged 4 commits into from
Nov 21, 2016

Conversation

danielbayley
Copy link
Contributor

A simple but slightly more imaginative example of shorthand object notation.

Closes #1808.

CoffeeScript has a shortcut for creating objects when you want the key
to be set with a variable of the same name.
</p>
<%= code_for('objects_shorthand') %>
Copy link
Collaborator

Choose a reason for hiding this comment

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

This file (documentation/index.html.erb) was renamed almost three years ago.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Ah, my local commit didn't even have this in the commit, as I had just done git fetch origin pull/1808/head:docs-shorthand-object-notation

@lydell
Copy link
Collaborator

lydell commented Nov 13, 2016

@danielbayley I think it’s easiest to start over from the latest master :)

@danielbayley
Copy link
Contributor Author

danielbayley commented Nov 13, 2016

@lydell You're right 😄 So much for trying to do it the “proper” way…

Fixed now.

Copy link
Collaborator

@GeoffreyBooth GeoffreyBooth left a comment

Choose a reason for hiding this comment

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

The spelling is Michelangelo.

lydell
lydell previously requested changes Nov 13, 2016
@@ -0,0 +1,6 @@
pizzas = 4
Copy link
Collaborator

Choose a reason for hiding this comment

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

No need for pizzas.

Copy link
Collaborator

Choose a reason for hiding this comment

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

Best comment ever.

weapon: weapon
};

output = turtle.name + " wears an " + turtle.mask + " mask.";
Copy link
Collaborator

Choose a reason for hiding this comment

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

Please compile this file from objects_shorthand.coffee. Currently, it is out-of-sync.

Copy link
Contributor Author

@danielbayley danielbayley Nov 13, 2016

Choose a reason for hiding this comment

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

@lydell Hmm, the watch feature of cake doc:site doesn't seem to be working properly for some reason…

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@lydell Hold on… so it watches the documentation/index.html.js… shouldn't it [also] watch documentation/coffee/*.coffee?

mask = "Orange"
weapon = "Nunchuks"
turtle = {name, mask, weapon}
output = "#{turtle.name} wears an #{turtle.mask} mask."
Copy link
Collaborator

Choose a reason for hiding this comment

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

name = "Michelangelo"
mask = "orange"
weapon = "nunchuks"
turtle = {name, mask, weapon}
output = "#{turtle.name} wears an #{turtle.mask} mask. Look out for his #{turtle.weapon}!"

better?

danielbayley and others added 4 commits November 13, 2016 17:05
A simple but slightly more imaginative example of shorthand object notation.

Closes #1808.

Signed-off-by: Daniel Bayley <daniel.bayley@me.com>
@GeoffreyBooth
Copy link
Collaborator

@danielbayley You’re right, cake doc:site should be watching the example source files. I made that update in master, along with some general reorganization, and merged those changes into your branch. I also made the update that @lydell was requesting, so I think this PR should now be good to go?

Copy link
Collaborator

@lydell lydell left a comment

Choose a reason for hiding this comment

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

LGTM

@GeoffreyBooth GeoffreyBooth merged commit 6c759d4 into jashkenas:master Nov 21, 2016
@danielbayley danielbayley deleted the docs-shorthand-object-notation branch November 23, 2016 18:37
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