kato-rb 0.0.1 → 0.0.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (4) hide show
  1. data/README.md +2 -2
  2. data/lib/kato.rb +10 -4
  3. data/lib/kato/version.rb +1 -1
  4. metadata +2 -2
data/README.md CHANGED
@@ -8,7 +8,7 @@ No API to read room history at the moment.
8
8
 
9
9
  Add this line to your application's Gemfile:
10
10
 
11
- gem 'kato'
11
+ gem 'kato-rb'
12
12
 
13
13
  And then execute:
14
14
 
@@ -16,7 +16,7 @@ And then execute:
16
16
 
17
17
  Or install it yourself as:
18
18
 
19
- $ gem install kato
19
+ $ gem install kato-rb
20
20
 
21
21
  ## Usage
22
22
 
@@ -7,9 +7,15 @@ module Kato
7
7
  class Room
8
8
  include HTTParty
9
9
 
10
- def initialize(room_id)
11
- @room_id = room_id
12
- self.class.base_uri 'https://api.kato.im/rooms/' + @room_id
10
+ def initialize(room_id, options = {})
11
+ default_options = {
12
+ :api_url => 'https://api.kato.im',
13
+ :integration => 'simple'
14
+ }
15
+ options = default_options.merge options
16
+ url = options[:api_url] + '/rooms/' + room_id + '/' + options[:integration]
17
+ url = options[:full_url] if options[:full_url]
18
+ self.class.base_uri url
13
19
  end
14
20
 
15
21
  def post(from, message, options = {})
@@ -17,7 +23,7 @@ module Kato
17
23
  :from => from,
18
24
  :text => message
19
25
  }.merge options
20
- response = self.class.post('/simple',
26
+ response = self.class.post('',
21
27
  :headers => { 'Content-Type' => 'application/json' },
22
28
  :body => body.to_json )
23
29
  case response.code
@@ -1,3 +1,3 @@
1
1
  module Kato
2
- VERSION = "0.0.1"
2
+ VERSION = "0.0.2"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: kato-rb
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.1
4
+ version: 0.0.2
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-12-16 00:00:00.000000000 Z
12
+ date: 2014-05-23 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: httparty