Skip to content

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

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

Merged
merged 2 commits into from
Oct 24, 2017

Conversation

gobijan
Copy link
Contributor

@gobijan gobijan commented Oct 22, 2017

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.

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
Copy link

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.

git checkout "$VERSION"

npm install

mkdir -p lib/coffee_script

MINIFY=false ./bin/cake build:browser
mv docs/v1/browser-compiler/coffee-script.js lib/coffee_script/coffee-script.js
mv docs/v2/browser-compiler/coffeescript.js lib/coffee_script/coffee-script.js
Copy link
Member

Choose a reason for hiding this comment

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

This also needs to keep supporting the version 1.

@rafaelfranca rafaelfranca merged commit 4126ff2 into rails:master Oct 24, 2017
@MatrixFr
Copy link

@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
Copy link

ghost commented May 25, 2018

@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

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.

5 participants