Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gunpowderlabs/sprockets-traceur
Use Google Traceur in Rails/Sinatra/Rack apps
https://github.com/gunpowderlabs/sprockets-traceur
Last synced: 3 months ago
JSON representation
Use Google Traceur in Rails/Sinatra/Rack apps
- Host: GitHub
- URL: https://github.com/gunpowderlabs/sprockets-traceur
- Owner: gunpowderlabs
- License: mit
- Created: 2014-06-20T19:47:47.000Z (over 10 years ago)
- Default Branch: master
- Last Pushed: 2015-10-07T10:31:46.000Z (about 9 years ago)
- Last Synced: 2024-07-05T13:56:15.715Z (4 months ago)
- Language: Ruby
- Size: 190 KB
- Stars: 24
- Watchers: 5
- Forks: 6
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
- es6-tools - sprockets-traceur
README
# Sprockets::Traceur
[Introductory blog post](http://gunpowderlabs.com/blog/introducing-sprockets-traceur/)
This gem integrates [traceur-rb](https://github.com/gunpowderlabs/traceur-rb) with Sprockets (and through Sprockets, with Rails Asset Pipeline).
## Installation
Add this line to your application's Gemfile:
gem 'sprockets-traceur'
And then execute:
$ bundle
Or install it yourself as:
$ gem install sprockets-traceur
## Usage with Rails
1. Add `sprockets-traceur` to your Gemfile.
2. Add the following line in `app/assets/javascripts/application.js`:```javascript
//= require traceur-runtime
```3. Add `.js.es6` or `.js.next` extension to the files you wish to have transpiled.
4. Profit!## Usage with Sinatra/Rack
1. Add `sprockets-traceur` to your Gemfile.
2. Configure Rack to use Sprockets (in `config.ru`):```ruby
require "my_rack_application"map "/assets" do
root = File.dirname(__FILE__)
environment = Sprockets::Environment.new
environment.append_path root + '/assets/javascripts'
environment.append_path root + '/assets/stylesheets'
run environment
endmap "/" do
run MyRackApplication
end
```3. Add `.js.es6` or `.js.next` extension to the files you wish to have transipled.
4. Add the following line in `assets/javascripts/application.js`:```javascript
//= require traceur-runtime
```5. Reference the JS files in your views
```html
```6. Profit!
## Contributing
1. Fork it ( https://github.com/[my-github-username]/sprockets-traceur/fork )
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create a new Pull Request