dboyles-restful_adhearsion 0.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ The MIT License
2
+
3
+ Copyright (c) 2009 Jay Phillips & Jason Goecke
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in
13
+ all copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
21
+ THE SOFTWARE.
data/README.textile ADDED
@@ -0,0 +1,32 @@
1
+ h1. RESTfulAdhearsion
2
+
3
+ h2. Description
4
+
5
+ Ruby library for consuming the Adhearsion RESTful RPC API.
6
+
7
+ h2. Example
8
+ <pre>
9
+ <code>
10
+ Adhearsion = RESTfulAdhearsion.new(:host => "localhost",
11
+ :port => 5000,
12
+ :user => "jicksta",
13
+ :password => "roflcopterz")
14
+
15
+ options = { :channel => "SIP/3000",
16
+ :priority => 1,
17
+ :exten => "1000",
18
+ :context => "adhearsion",
19
+ :async => "true",
20
+ :variable => "bill_this=true" }
21
+
22
+ Adhearsion.originate options
23
+ </code>
24
+ </pre>
25
+ h2. Dependencies
26
+
27
+ * json v1.1.3+
28
+ * rest-client v0.8.2+
29
+
30
+ h2. Installation
31
+
32
+ sudo gem install jsgoecke-restful_adhearsion --source=http://gems.github.com/
@@ -0,0 +1,27 @@
1
+ require 'json'
2
+ require 'rest_client'
3
+
4
+ class RESTfulAdhearsion
5
+
6
+ DEFAULT_OPTIONS = {
7
+ # Note: :user and :password are non-existent by default
8
+ :host => "localhost",
9
+ :port => "5000",
10
+ :path_nesting => "/"
11
+ }
12
+
13
+ def initialize(options={})
14
+ @options = DEFAULT_OPTIONS.merge options
15
+
16
+ @path_nesting = @options.delete :path_nesting
17
+ @host = @options.delete :host
18
+ @port = @options.delete :port
19
+
20
+ @url_beginning = "http://#{@host}:#{@port}#{@path_nesting}"
21
+ end
22
+
23
+ def method_missing(method_name, *args)
24
+ JSON.parse RestClient::Resource.new(@url_beginning + method_name.to_s, @options).post(args.to_json)
25
+ end
26
+
27
+ end
@@ -0,0 +1,14 @@
1
+ Gem::Specification.new do |s|
2
+ s.name = "dboyles-restful_adhearsion"
3
+ s.version = "0.1.1"
4
+ s.summary = "Ruby Library for the Adhearsion RESTful RPC API"
5
+ s.description = "Ruby library for consuming the Adhearsion RESTful RPC API"
6
+ s.authors = ["Jason Goecke", "Jay Phillips"]
7
+ s.email = ["jason@goecke.net"]
8
+
9
+ s.files = ["lib/restful_adhearsion.rb", "LICENSE", "README.textile", "restful_adhearsion.gemspec"]
10
+ s.require_paths = ["lib"]
11
+
12
+ s.add_dependency("json", ">=", "1.1.3")
13
+ s.add_dependency("rest-client", ">=", "0.8.2")
14
+ end
metadata ADDED
@@ -0,0 +1,85 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: dboyles-restful_adhearsion
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.1
5
+ platform: ruby
6
+ authors:
7
+ - Jason Goecke
8
+ - Jay Phillips
9
+ autorequire:
10
+ bindir: bin
11
+ cert_chain: []
12
+
13
+ date: 2009-11-21 00:00:00 +02:00
14
+ default_executable:
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
17
+ name: json
18
+ type: :runtime
19
+ version_requirement:
20
+ version_requirements: !ruby/object:Gem::Requirement
21
+ requirements:
22
+ - - ">="
23
+ - !ruby/object:Gem::Version
24
+ version: "0"
25
+ - - "="
26
+ - !ruby/object:Gem::Version
27
+ version: 1.1.3
28
+ version:
29
+ - !ruby/object:Gem::Dependency
30
+ name: rest-client
31
+ type: :runtime
32
+ version_requirement:
33
+ version_requirements: !ruby/object:Gem::Requirement
34
+ requirements:
35
+ - - ">="
36
+ - !ruby/object:Gem::Version
37
+ version: "0"
38
+ - - "="
39
+ - !ruby/object:Gem::Version
40
+ version: 0.8.2
41
+ version:
42
+ description: Ruby library for consuming the Adhearsion RESTful RPC API
43
+ email:
44
+ - jason@goecke.net
45
+ executables: []
46
+
47
+ extensions: []
48
+
49
+ extra_rdoc_files: []
50
+
51
+ files:
52
+ - lib/restful_adhearsion.rb
53
+ - LICENSE
54
+ - README.textile
55
+ - restful_adhearsion.gemspec
56
+ has_rdoc: true
57
+ homepage:
58
+ licenses: []
59
+
60
+ post_install_message:
61
+ rdoc_options: []
62
+
63
+ require_paths:
64
+ - lib
65
+ required_ruby_version: !ruby/object:Gem::Requirement
66
+ requirements:
67
+ - - ">="
68
+ - !ruby/object:Gem::Version
69
+ version: "0"
70
+ version:
71
+ required_rubygems_version: !ruby/object:Gem::Requirement
72
+ requirements:
73
+ - - ">="
74
+ - !ruby/object:Gem::Version
75
+ version: "0"
76
+ version:
77
+ requirements: []
78
+
79
+ rubyforge_project:
80
+ rubygems_version: 1.3.5
81
+ signing_key:
82
+ specification_version: 3
83
+ summary: Ruby Library for the Adhearsion RESTful RPC API
84
+ test_files: []
85
+