0.0
No commit activity in last 3 years
No release in over 3 years
Helper for termlib.js for Rails
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Development

~> 1.6
~> 10.3
 Project Readme

Termlib::Helper

Termlib-helper is a helper based on termlib.js to use on ruby on rails applications; Thinked to be used integrated with ace-helper.

Installation

Add this line to your application's Gemfile:

gem 'termlib-helper'

And then execute:

$ bundle

Or install it yourself as:

$ gem install termlib-helper

Usage

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!')"
    }
 } %>

Contributing

  1. Fork it ( https://github.com/[my-github-username]/termlib-helper/fork )
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create a new Pull Request