Termlib-helper is a helper based on termlib.js to use on ruby on rails applications; Thinked to be used integrated with ace-helper.
Add this line to your application's Gemfile:
gem 'termlib-helper'
And then execute:
$ bundle
Or install it yourself as:
$ gem install termlib-helper
In your helpers, import:
require termlib/helper
and use in your own functions:
include Termlib::Helper::Builder
def create_terminal(opt)
js = termlib(opt)
content_tag(:div, js, :id => opt[:id])
end
in your view files add ace, your mode and theme, as well the code;
<%= create_terminal :rows=> 10, :id=> "termDiv", :editor => "coffee_editor", :custom_commands => {
:run => {
:help => "run",
:exec => "console.log('Hello World!')"
}
} %>
- Fork it ( https://github.com/[my-github-username]/termlib-helper/fork )
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create a new Pull Request