Giter Club home page Giter Club logo

ruby-homebus's Introduction

ruby-homebus

Ruby language bindings for the Homebus provisioning and pubsub protocols, as well as a wrapper for building Homebus applications and managing their configuration.

Homebus

This class stores top-level provisioning server information and manages provisioning credentials. It is independent of the other classes and does not save any state or configuration.

Either create a new Hombus object and login to verify credentials and get a token or restore one from saved configuration.

Homebus.new

homebus = Homebus.new(server: "server_url")

server_url is of the form https://homebus.org or http://localhost:3000.

Homebus.login

homebus.login(email_address, password)

attempts to login the user on the stored Homebus provisioning server. Returns authorization token or nil on failure.

Homebus.logout

(to be implemented)

homebus.logout(token)

invalides the given authorization token.

Homebus::Provision

This class implements the Homebus provisioning protocol. It is independent of the other classes and does not save any state or configuration.

Homebus::Provision.new

	provision_request = Homebus::Provision.new(name: 'pr name',
	                                           consumes: [ DDCS], 
	                                           publishes: [ DDCS], 
	                                           devices: [ Homebus::Device ],
	                                           publishes: [ DDCS], 
	                                           server: 'https://homebus.io',
	                                           token: API_TOKEN)

Homebus::App Lifecycle

app = Homebus.App.new

Loads account-wide, Homebus state, app state and app configuration.

app.setup!

The application's configuration and state are available to it.

The application should perform any housekeeping tasks and further initialization. It should set up the devices array. For instance, if interfacing to a cloud based service, this would be the time to read the list of devices in the cloud service and set up the array.

app.work!

Homebus::App creates the Homebus::Provision object before calling the work! method. If the app is already provisioned, work! will be called directly, otherwise provisioning will be requested and work! will not be called until provisioning is accepted.

work! should return the number of seconds to wait before calling it again.

ruby-homebus's People

Contributors

romkey avatar

Watchers

 avatar  avatar

ruby-homebus's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.