rails / ruby-coffee-script

Ruby CoffeeScript Compiler
http://coffeescript.org/
MIT License
28 stars 49 forks source link

Update build-source-gem script to support v2. #23

Closed gobijan closed 7 years ago

gobijan commented 7 years ago

As far as I understood the coffee-script integration for rails depends on coffee-script-source gem which is built via this script. I modified the script to use version 2 of the CoffeeScript compiler instead of version 1. Also I make sure that if no version is set I get the latest tag for the build.

rails-bot commented 7 years ago

Thanks for the pull request, and welcome! The Rails team is excited to review your changes, and you should hear from @schneems (or someone else) soon.

If any changes to this PR are deemed necessary, please add them as extra commits. This ensures that the reviewer can see what has changed since they last reviewed the code. Due to the way GitHub handles out-of-date commits, this should also make it reasonably obvious what issues have or haven't been addressed. Large or tricky changes may require several passes of review and changes.

Please see the contribution instructions for more information.

MatrixFr commented 6 years ago

@gobijan can you explain how to use it and specify V2 in rails app ? (who using "gem 'coffee-rails'" only, by default when create new rails app and not "ruby-coffee-script"). What we have to added to gem file?

ghost commented 6 years ago

@Argorate After investigation, I made coffeescript2 worked with sprockets together, hope this answer helps .

  1. Install latest coffee-script gem.
  2. Add COFFEESCRIPT_SOURCE_PATH to your operation system's variables.
  3. Set COFFEESCRIPT_SOURCE_PATH value to your coffeescript.js path. Please make sure you use a standalone file, you can get it from https://coffeescript.org/v2/browser-compiler/coffeescript.js.

Everything done, enjoy! 1

FYI https://github.com/rails/ruby-coffee-script#installation