Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Ruby to JavaScript conversion

License

NotificationsYou must be signed in to change notification settings

ruby2js/ruby2js

 
 

Repository files navigation

Minimal yet extensible Ruby to JavaScript conversion.

Gem Version

Documentation


Synopsis

Basic:

require'ruby2js'putsRuby2JS.convert("a={age:3}\na.age+=1")

With filter:

require'ruby2js/filter/functions'putsRuby2JS.convert('"2A".to_i(16)')

Host variable substitution:

putsRuby2JS.convert("@name",ivars:{:@name=>"Joe"})

Enable ES2015 support:

putsRuby2JS.convert('"#{a}"',eslevel:2015)

Testing

  1. Runbundle install
  2. Runbundle exec rake test_all

Release Process for Maintainers

  1. Update the version in bothpackages/ruby2js/package.json andlib/ruby2js/version, ensuring they match.
  2. Runbundle exec rake release_core

License

(The MIT License)

Copyright (c) 2009, 2020 Macario Ortega, Sam Ruby, Jared White

Permission is hereby granted, free of charge, to any person obtaininga copy of this software and associated documentation files (the'Software'), to deal in the Software without restriction, includingwithout limitation the rights to use, copy, modify, merge, publish,distribute, sublicense, and/or sell copies of the Software, and topermit persons to whom the Software is furnished to do so, subject tothe following conditions:

The above copyright notice and this permission notice shall beincluded in all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND,EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OFMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANYCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THESOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.

About

Ruby to JavaScript conversion

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors15


[8]ページ先頭

©2009-2025 Movatter.jp