Sha256: 9088f9cef1b7e4c4015c0960b40a4582c2cd67bd28c74b7b1f98120401a2e3b0

Contents?: true

Size: 532 Bytes

Versions: 56

Compression:

Stored size: 532 Bytes

Contents

# Example usage:
#
#   Add:
#      gem 'ruby2js'
# to your gemfile and bundle
#  Add:
#  require "ruby2js/haml"
#   to any initializer ot config/application.rb
#
#  Use :ruby2js filter in your templates like
#
#  :ruby2js
#    alert "Hello"
#
# (Note missing brackets: ruby syntax, js sematics)
#
require "haml"

module Ruby2JS
  module Haml::Ruby2JS
    include Haml::Filters::Base
    def render(text)
      converted = Ruby2JS.convert(text).to_s
      "<script type='text/javascript'>\n#{converted}\n</script>"
    end
  end
end

Version data entries

56 entries across 56 versions & 1 rubygems

Version Path
ruby2js-5.0.1 lib/ruby2js/haml.rb
ruby2js-5.0.0 lib/ruby2js/haml.rb
ruby2js-4.2.2 lib/ruby2js/haml.rb
ruby2js-4.2.1 lib/ruby2js/haml.rb
ruby2js-4.2.0 lib/ruby2js/haml.rb
ruby2js-4.1.7 lib/ruby2js/haml.rb
ruby2js-4.1.6 lib/ruby2js/haml.rb
ruby2js-4.1.5 lib/ruby2js/haml.rb
ruby2js-4.1.4 lib/ruby2js/haml.rb
ruby2js-4.1.3 lib/ruby2js/haml.rb
ruby2js-4.1.2 lib/ruby2js/haml.rb
ruby2js-4.1.1 lib/ruby2js/haml.rb
ruby2js-4.1.0 lib/ruby2js/haml.rb
ruby2js-4.0.5 lib/ruby2js/haml.rb
ruby2js-4.0.4 lib/ruby2js/haml.rb
ruby2js-4.0.3 lib/ruby2js/haml.rb
ruby2js-4.0.2 lib/ruby2js/haml.rb
ruby2js-4.0.1 lib/ruby2js/haml.rb
ruby2js-4.0.0 lib/ruby2js/haml.rb
ruby2js-3.6.1 lib/ruby2js/haml.rb