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

.erb files can proxy others #23

Closed
wants to merge 2 commits into from
Closed

.erb files can proxy others #23

wants to merge 2 commits into from

Conversation

tomfuertes
Copy link

Would help my ruby dev a lot. Have some .erb files that run through a compile/replace:

/**
 * ./app/assets/javascripts/global-vars.js.erb
 * Loaded into the head of a document and responsible for currying global confs
 */

window.SA = window.SA = {
  default_logo_url: '<%= asset_path("default_community_property.jpg") %>'
};

Tested in local project -- happy to come back and add tests if you think this should be merged.

@vkadam
Copy link
Owner

vkadam commented Dec 7, 2013

I was thinking about different approach to handle this. Map the file extensions/end of file with file types.

"fileMapping": {
    "js": ["js", "json", "js.erb"],
    "css": ["css", "less"],
    "html": ["html", "htm", "html.erb"]
}

beautifier will be selected according to above map.

@tomfuertes
Copy link
Author

File mappings might be hard to split on arbitrary "."'s and you'd get false positives in files like jquery.plugin.js, bar.uncompressed.js etc...

Although I guess you could rework it into a loop where you prepended a . to each of the strings and matched to the end of the file. Not a bad idea. This works now as is though if you want to merge in and branch that refractor later.

@vkadam vkadam closed this Dec 8, 2013
@vkadam
Copy link
Owner

vkadam commented Dec 8, 2013

@tomfuertes, I have just published version 0.2.4 with fileTypes. I have selected different approach. Please have a look at new version and let me know if it works out with you.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants