twiliolib 2.0.3 → 2.0.4
Sign up to get free protection for your applications and to get access to all the features.
- data/README.markdown +17 -20
- data/lib/twiliolib.rb +13 -1
- metadata +20 -9
data/README.markdown
CHANGED
@@ -1,39 +1,36 @@
|
|
1
1
|
## Ruby Twilio Helper Library
|
2
2
|
|
3
|
-
###
|
3
|
+
### Description
|
4
4
|
The Twilio REST SDK simplifies the process of makes calls to the Twilio REST.
|
5
5
|
The Twilio REST API lets to you initiate outgoing calls, list previous call,
|
6
6
|
and much more. See http://www.twilio.com/docs for more information.
|
7
7
|
|
8
|
-
###
|
9
|
-
To install the Twilio GEM, follow these steps. Note: RubyGems 1.2.0 or greater required
|
8
|
+
### Gemcutter
|
10
9
|
|
11
|
-
$ gem
|
12
|
-
|
13
|
-
|
14
|
-
|
10
|
+
$ sudo gem install twiliolib -s http://gemcutter.org
|
11
|
+
|
12
|
+
### Manual Installation
|
13
|
+
To use the rake command to build the gem and
|
15
14
|
|
16
|
-
|
17
|
-
|
18
|
-
|
19
|
-
"twiliorest.rb" in the controller or code file you wish to use the Twilio REST
|
20
|
-
API from.
|
15
|
+
$ sudo gem install /path/to/twiliolib/gem
|
16
|
+
|
17
|
+
to finish the installation
|
21
18
|
|
22
|
-
###
|
23
|
-
As shown in
|
19
|
+
### Usage
|
20
|
+
As shown in examples, you will need to specify the ACCOUNT_ID and
|
24
21
|
ACCOUNT_TOKEN given to you by Twilio before you can make REST requests. In
|
25
22
|
addition, you will need to choose a 'Caller' and 'Called' before making
|
26
23
|
outgoing calls. See http://www.twilio.com/docs for more information.
|
27
24
|
|
28
|
-
###
|
25
|
+
### Files
|
29
26
|
* **lib/twilio.rb**: include this library in your code
|
30
|
-
* **example-rest.rb**: example usage of REST
|
31
|
-
* **example-twiml.rb**: example usage of the TwiML generator
|
32
|
-
* **example-utils.rb**: example usage of utilities
|
27
|
+
* **examples/example-rest.rb**: example usage of REST
|
28
|
+
* **examples/example-twiml.rb**: example usage of the TwiML generator
|
29
|
+
* **examples/example-utils.rb**: example usage of utilities
|
33
30
|
|
34
|
-
###
|
31
|
+
### License
|
35
32
|
The Twilio Ruby Helper Library is distributed under the MIT License
|
36
33
|
|
37
|
-
###
|
34
|
+
### Thanks
|
38
35
|
* Jay Philips (@adhearsion) for some great advice
|
39
36
|
* Michael Ansel (@michaelansel) for a great starting point <http://github.com/michaelansel/twilio-rails/tree/master>
|
data/lib/twiliolib.rb
CHANGED
@@ -213,6 +213,8 @@ module Twilio
|
|
213
213
|
opts[:builder] ||= Builder::XmlMarkup.new(:indent => opts[:indent])
|
214
214
|
b = opts[:builder]
|
215
215
|
attrs = {}
|
216
|
+
#attributes.sort! {|a,b| a.to_s <=> b.to_s}
|
217
|
+
#attributes.each {|a| a.to_sym}
|
216
218
|
attributes.each {|a| attrs[a] = send(a) unless send(a).nil? } unless attributes.nil?
|
217
219
|
|
218
220
|
if @children and @body.nil?
|
@@ -283,6 +285,10 @@ module Twilio
|
|
283
285
|
def addConference(room, opts = {})
|
284
286
|
append Twilio::Conference.new(room, opts)
|
285
287
|
end
|
288
|
+
|
289
|
+
def addSms(msg, opts = {})
|
290
|
+
append Twilio::Sms.new(msg, opts)
|
291
|
+
end
|
286
292
|
|
287
293
|
end
|
288
294
|
|
@@ -346,11 +352,17 @@ module Twilio
|
|
346
352
|
include Twilio::Verb
|
347
353
|
attributes :muted, :beep, :startConferenceOnEnter, :endConferenceOnExit, :waitUrl, :waitMethod
|
348
354
|
end
|
355
|
+
|
356
|
+
class Sms
|
357
|
+
extend Twilio::Verb::ClassMethods
|
358
|
+
include Twilio::Verb
|
359
|
+
attributes :to, :from, :statusCallback, :action, :method
|
360
|
+
end
|
349
361
|
|
350
362
|
class Response
|
351
363
|
extend Twilio::Verb::ClassMethods
|
352
364
|
include Twilio::Verb
|
353
|
-
allowed_verbs :say, :play, :gather, :record, :dial, :redirect, :pause, :hangup
|
365
|
+
allowed_verbs :say, :play, :gather, :record, :dial, :redirect, :pause, :hangup, :sms
|
354
366
|
end
|
355
367
|
|
356
368
|
# Twilio Utility function and Request Validation class
|
metadata
CHANGED
@@ -1,7 +1,12 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twiliolib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
prerelease: false
|
5
|
+
segments:
|
6
|
+
- 2
|
7
|
+
- 0
|
8
|
+
- 4
|
9
|
+
version: 2.0.4
|
5
10
|
platform: ruby
|
6
11
|
authors:
|
7
12
|
- Twilio
|
@@ -9,19 +14,23 @@ autorequire:
|
|
9
14
|
bindir: bin
|
10
15
|
cert_chain: []
|
11
16
|
|
12
|
-
date: 2010-
|
17
|
+
date: 2010-03-11 00:00:00 -08:00
|
13
18
|
default_executable:
|
14
19
|
dependencies:
|
15
20
|
- !ruby/object:Gem::Dependency
|
16
21
|
name: builder
|
17
|
-
|
18
|
-
|
19
|
-
version_requirements: !ruby/object:Gem::Requirement
|
22
|
+
prerelease: false
|
23
|
+
requirement: &id001 !ruby/object:Gem::Requirement
|
20
24
|
requirements:
|
21
25
|
- - ">="
|
22
26
|
- !ruby/object:Gem::Version
|
27
|
+
segments:
|
28
|
+
- 2
|
29
|
+
- 1
|
30
|
+
- 2
|
23
31
|
version: 2.1.2
|
24
|
-
|
32
|
+
type: :runtime
|
33
|
+
version_requirements: *id001
|
25
34
|
description: A Ruby gem for communicating with the Twilio API and generating TwiML
|
26
35
|
email: help@twilio.com
|
27
36
|
executables: []
|
@@ -46,18 +55,20 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
46
55
|
requirements:
|
47
56
|
- - ">="
|
48
57
|
- !ruby/object:Gem::Version
|
58
|
+
segments:
|
59
|
+
- 0
|
49
60
|
version: "0"
|
50
|
-
version:
|
51
61
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
52
62
|
requirements:
|
53
63
|
- - ">="
|
54
64
|
- !ruby/object:Gem::Version
|
65
|
+
segments:
|
66
|
+
- 0
|
55
67
|
version: "0"
|
56
|
-
version:
|
57
68
|
requirements: []
|
58
69
|
|
59
70
|
rubyforge_project:
|
60
|
-
rubygems_version: 1.3.
|
71
|
+
rubygems_version: 1.3.6
|
61
72
|
signing_key:
|
62
73
|
specification_version: 3
|
63
74
|
summary: A Ruby gem for communicating with the Twilio API and generating TwiML
|