Ruby 2 JavaScript
CoffeeScript is a programming language that transcompiles to JavaScript. It adds syntactic sugar inspired by Ruby, Python and Haskell in an effort to enhance JavaScript's brevity and readability.
Here a quick how to if CoffeeScript in general
- Install CoffeScript libnpm install -g coffee-script
- For live conversioncoffee --watch --compile script.coffee
Ruby CoffeeScript gem is a bridge to the official CoffeeScript compiler.
- Install CoffeeScript gemgem install coffee-script
- Convert CoffeeScript file to JavaScript
#!/usr/bin/env ruby
require 'coffee-script'
if ARGF
file = File.open("#{ARGV[0]}.js", 'a')
file.write CoffeeScript.compile(ARGF.read)
end
Run it
ruby coffee2js.rb exploit.coffee
Opal is a Ruby to JavaScript source-to-source compiler. It also has an implementation of the Ruby corelib.
- Install Opal gemgem install opal opal-jquery
Last modified 5yr ago