Created
September 19, 2013 20:07
-
-
Save rubys/6629119 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/ruby | |
$:.unshift '/home/rubys/git/wunderbar/lib' | |
$:.unshift '/home/rubys/git/opal/lib' | |
$:.unshift '/home/rubys/git/opal-browser/lib' | |
### what "require 'wunderbar/opal-browser'" will ultimately do for you: | |
require 'wunderbar/opal' | |
require 'opal/browser' | |
Wunderbar::Asset.script :name => 'opal-browser.js', | |
:contents => Opal::Builder.build('browser') | |
### | |
_html do | |
_head do | |
_title 'Opal demonstration' | |
end | |
_body do | |
_span 0 | |
_button 'increment' | |
_script do | |
span = $document.at('span') | |
span.content = span.content.to_i+1 | |
end | |
end | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment