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

#152 - prefix generated files with comment #154

Merged
merged 1 commit into from Jun 26, 2015
Merged

#152 - prefix generated files with comment #154

merged 1 commit into from Jun 26, 2015

Conversation

jordanstephens
Copy link
Contributor

Fixes #152

Prefix generated files with a comment to indicate that the files are generated by the js-routes gem based on Rails routes for the given application.

@@ -1,3 +1,9 @@

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please remove this blank line.

Copy link
Collaborator

Choose a reason for hiding this comment

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

This is important for JS compressors that don't delete a first comment aka banner in a file and that blank line may cause them to assume there is no banner.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@bogdan Curiously, if I remove that line and run the specs, the CoffeeScript compiler continues to output that file with the blank line at the top. If you'd like, I suppose we could pass the output through String#strip here: https://github.com/railsware/js-routes/blob/master/spec/spec_helper.rb#L138

Copy link
Collaborator

Choose a reason for hiding this comment

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

Yes, lets do strip in case it will not delete line break at the last line or lstrip otherwise.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Alright, added lstrip to the spec helper code.

bogdan added a commit that referenced this pull request Jun 26, 2015
#152 - prefix generated files with comment
@bogdan bogdan merged commit 4aad04e into railsware:master Jun 26, 2015
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.

Adding a comment to the top of generated files
2 participants