Skip to content

Instantly share code, notes, and snippets.

@rubys
Created September 19, 2013 20:07
Show Gist options
  • Save rubys/6629119 to your computer and use it in GitHub Desktop.
Save rubys/6629119 to your computer and use it in GitHub Desktop.
#!/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