Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

The official ruby wrapper for Jaconda API

branch: master

Fetching latest commit…

Octocat-spinner-32-eaf2f5

Cannot retrieve the latest commit at this time

Octocat-spinner-32 lib
Octocat-spinner-32 test
Octocat-spinner-32 .gitignore
Octocat-spinner-32 .rvmrc
Octocat-spinner-32 Gemfile
Octocat-spinner-32 LICENSE
Octocat-spinner-32 README.markdown
Octocat-spinner-32 Rakefile
Octocat-spinner-32 jaconda.gemspec
README.markdown

Jaconda API

The official ruby wrapper for working with the Jaconda REST API's JSON interface.

Installation

gem install jaconda

Requirements

ActiveResource

Usage

Sending notifications

Jaconda::Notification.authenticate(:subdomain => "JACONDA_SUBDOMAIN",
                                   :room_id => "ROOM_ID",
                                   :room_token => "ROOM_TOKEN")

Jaconda::Notification.notify(:text => "146 tests, 1399 assertions, 0 failures, 0 errors",
                             :sender_name => "Build Server")

Using API

Jaconda::API.authenticate(:subdomain => "JACONDA_SUBDOMAIN",
                          :token => "API_TOKEN")

Jaconda::API.authenticate(:subdomain => "JACONDA_SUBDOMAIN",
                          :email => "EMAIL",
                          :password => "PASSWORD")

Finding rooms

Jaconda::API::Room.find(:all)
Jaconda::API::Room.find("support")

Finding who's available in the room

room = Jaconda::API::Room.find("support")
room.available_users

Finding who has access to the room

room = Jaconda::API::Room.find("support")
room.presences

Creating a Room

Jaconda::API::Room.create(:jid => "awesome.project",
                          :title => "Awesome Project Room")

Updating a Room

room = Jaconda::API::Room.find("support")
room.topic = "Deadline: 3 apr"
room.save

Finding messages

room = Jaconda::API::Room.find("support")
room.messages
room.messages(:page => 2)

Jaconda::API::Message.find(:all, :params => { :room_id => "support",
                                              :per_page => 100,
                                              :page => 2 })

Finding messages on date

room = Jaconda::API::Room.find("support")
room.transcript
room.transcript(:date => Date.yesterday)

Jaconda::API::Message.transcript(:room_id => "support",
                                 :date => Date.today - 1.month)

Searching for messages

room = Jaconda::API::Room.find("support")
room.search(:text => "bug")
room.search(:text => "commit", :per_page => 5)

Jaconda::API::Message.search(:room_id => "support",
                             :text => "issue",
                             :page => 2)

Saying something

Jaconda::API::Message.create(:room_id => "support",
                             :text => "Hello from the API!")

Jaconda::API::Message.create(:room_id => "support",
                             :text => "is loving Jaconda!",
                             :kind => "me")

Jaconda::API::Message.create(:room_id => "support",
                             :text => "Hello from the API!",
                             :kind => "voice")

Finding members

Jaconda::API::Member.find(:all)
Jaconda::API::Member.find(123)

Inviting new member

Jaconda::API::Member.create(:name => "Anton",
                            :email => "developer@gmail.com")

Finding uploads

room = Jaconda::API::Room.find("support")
room.uploads

member = Jaconda::API::Member.find(123)
member.uploads
Something went wrong with that request. Please try again.