verboice 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/verboice.rb +31 -0
- metadata +92 -0
data/lib/verboice.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
# Provides access to the Verboice Public API.
|
2
|
+
#
|
3
|
+
# === Install
|
4
|
+
#
|
5
|
+
# gem install verboice
|
6
|
+
#
|
7
|
+
# === Example
|
8
|
+
#
|
9
|
+
# api = Verboice.new 'service_url', 'account_name', 'account_password', 'channel'
|
10
|
+
require 'rubygems'
|
11
|
+
require 'httparty'
|
12
|
+
require 'json'
|
13
|
+
|
14
|
+
# Provides access to the Verboice Public API.
|
15
|
+
class Verboice
|
16
|
+
include HTTParty
|
17
|
+
|
18
|
+
# Creates an application-authenticated Verboice api access.
|
19
|
+
def initialize(url, account, password, default_channel = nil)
|
20
|
+
@url = url
|
21
|
+
@account = account
|
22
|
+
@password = password
|
23
|
+
@default_channel = default_channel
|
24
|
+
@auth = {:username => account, :password => password}
|
25
|
+
end
|
26
|
+
|
27
|
+
def call address, channel = @default_channel
|
28
|
+
self.class.get "#{@url}/api/call", :query => {:channel => channel, :address => address}, :basic_auth => @auth
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,92 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: verboice
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 27
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 1
|
9
|
+
- 0
|
10
|
+
version: 0.1.0
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- InSTEDD
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2011-08-10 00:00:00 Z
|
19
|
+
dependencies:
|
20
|
+
- !ruby/object:Gem::Dependency
|
21
|
+
name: httparty
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
24
|
+
none: false
|
25
|
+
requirements:
|
26
|
+
- - ">="
|
27
|
+
- !ruby/object:Gem::Version
|
28
|
+
hash: 3
|
29
|
+
segments:
|
30
|
+
- 0
|
31
|
+
version: "0"
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
34
|
+
- !ruby/object:Gem::Dependency
|
35
|
+
name: json
|
36
|
+
prerelease: false
|
37
|
+
requirement: &id002 !ruby/object:Gem::Requirement
|
38
|
+
none: false
|
39
|
+
requirements:
|
40
|
+
- - ">="
|
41
|
+
- !ruby/object:Gem::Version
|
42
|
+
hash: 3
|
43
|
+
segments:
|
44
|
+
- 0
|
45
|
+
version: "0"
|
46
|
+
type: :runtime
|
47
|
+
version_requirements: *id002
|
48
|
+
description: Access the Verboice API in ruby.
|
49
|
+
email: aromero@manas.com.ar
|
50
|
+
executables: []
|
51
|
+
|
52
|
+
extensions: []
|
53
|
+
|
54
|
+
extra_rdoc_files: []
|
55
|
+
|
56
|
+
files:
|
57
|
+
- lib/verboice.rb
|
58
|
+
homepage: http://code.google.com/p/verboice-api-ruby
|
59
|
+
licenses: []
|
60
|
+
|
61
|
+
post_install_message:
|
62
|
+
rdoc_options: []
|
63
|
+
|
64
|
+
require_paths:
|
65
|
+
- lib
|
66
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
67
|
+
none: false
|
68
|
+
requirements:
|
69
|
+
- - ">="
|
70
|
+
- !ruby/object:Gem::Version
|
71
|
+
hash: 3
|
72
|
+
segments:
|
73
|
+
- 0
|
74
|
+
version: "0"
|
75
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
76
|
+
none: false
|
77
|
+
requirements:
|
78
|
+
- - ">="
|
79
|
+
- !ruby/object:Gem::Version
|
80
|
+
hash: 3
|
81
|
+
segments:
|
82
|
+
- 0
|
83
|
+
version: "0"
|
84
|
+
requirements: []
|
85
|
+
|
86
|
+
rubyforge_project:
|
87
|
+
rubygems_version: 1.8.6
|
88
|
+
signing_key:
|
89
|
+
specification_version: 3
|
90
|
+
summary: Access the Verboice API in ruby
|
91
|
+
test_files: []
|
92
|
+
|