Rubelm

Rubelm is A Opal library for building web applications. Gem URL : https://rubygems.org/gems/rubelm

Installation

Add this line to your application's Gemfile:

gem 'opal-sprockets'
gem 'rubelm'

And then execute:

$ bundle

Usage

Please run on your application directory.

$ mkdir app
$ touch app/app.rb config.ru

your application directory tree shoud be like this.

.
├── Gemfile
├── Gemfile.lock
├── app
│   └── app.rb
└── config

Please edit config.ru

require 'bundler'
Bundler.require

run Opal::Sprockets::Server.new { |s|
  s.append_path 'app'
  s.debug = true
  s.main = 'app'
}

Please edit app/app.rb

require "rubelm"
require "opal-browser"
include Rubelm::Html
view = div({class: "hello"},[
    div({class:"world"}, "hello, world!")
  ])
Rubelm::main(view,$document.body)

Please run.

$ bundle
$ bundle exec rackup

You can see on http://localhost:9292

image

Contributing

Bug reports and pull requests are welcome on GitHub at https://github.com/anharu2394/rubelm.