/octoshell-extend

DEPRECATED: please note, this project is no longer being maintained

Primary LanguageRubyMIT LicenseMIT

PLEASE NOTE, THIS PROJECT IS NO LONGER BEING MAINTAINED

Octoshell extend

Sponsored by Evrone

Getting Started

Prerequisites

Install PostgreSQL 9 and setup db

createdb octoshell_developement
createuser octoshell

Install rvm and ruby

https://rvm.io/rvm/install/

rvm install 1.9.3

Usage

For add new procedure you should add new_procedure.rb file to app/procedures with the following code:

class NewProcedure < Procedure
  def perform
    # executed code here
  end
end

perform method should return a boolean result.

For add new helper you should add new_script.rb file to app/scripts with the following code:

class NewScript
  attr_reader :result
  
  def run
    # get result
    @result = "255 Tb"
  end
end

Class should respond to run method.

Slim users for create js and html. About slim

Then add a view file to app/views/new_script.slim.

In new_script.slim you will have a @script variable.

$("#extend").html("Free space: <%= @script.result %>");

Output file will be a javascript.

You can also use partials:

First you should add a new partial to app/views/partials/your_partial.slim and render it in new_script.slim.

h4 Partial:

div class="extend"
  = hello

table class="table table-bordered"
  tr
    th Foo
    th Bar
  - items.each do |item|
    tr
      td = item
      td = item

h4 Template:

- template = escape_javascript(slim :'partials/example', locals: { items: [1,2,3], hello: @script.result })
| $("#extend").html('#{{template}}');

That's it!

Running the tests

Testing procedures

irb -I.
require 'init'
procedure = AddUser.new(task)
procedure.perform 

Testing helper scripts

unicorn
open http://0.0.0.0:8080

Deployment

cap deploy

Contributing

Please read Code of Conduct and Contributing Guidelines for submitting pull requests to us.

Versioning

We use SemVer for versioning. For the versions available, see the tags on this repository.

Authors

See also the list of contributors who participated in this project.

License

This project is licensed under the MIT License.