plivo 0.2.5 → 0.2.6
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/{README.rst → README.md} +0 -0
- data/lib/plivo.rb +29 -20
- metadata +48 -68
- data/lib/plivo_call.rb +0 -7
data/{README.rst → README.md}
RENAMED
File without changes
|
data/lib/plivo.rb
CHANGED
@@ -26,18 +26,13 @@ module Plivo
|
|
26
26
|
|
27
27
|
def request(method, path, params=nil)
|
28
28
|
if method == "POST"
|
29
|
-
if params
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
begin
|
37
|
-
r = @rest[path].post
|
38
|
-
rescue => e
|
39
|
-
response = e
|
40
|
-
end
|
29
|
+
if not params
|
30
|
+
params = {}
|
31
|
+
end
|
32
|
+
begin
|
33
|
+
r = @rest[path].post params.to_json, :content_type => 'application/json'
|
34
|
+
rescue => e
|
35
|
+
response = e
|
41
36
|
end
|
42
37
|
if not response
|
43
38
|
code = r.code
|
@@ -435,7 +430,7 @@ module Plivo
|
|
435
430
|
attr_accessor :name, :node
|
436
431
|
|
437
432
|
def initialize(body=nil, attributes={})
|
438
|
-
@name =
|
433
|
+
@name = "Element"
|
439
434
|
@body = body
|
440
435
|
@node = REXML::Element.new @name
|
441
436
|
attributes.each do |k, v|
|
@@ -544,6 +539,7 @@ module Plivo
|
|
544
539
|
|
545
540
|
def initialize()
|
546
541
|
super(nil, {})
|
542
|
+
@name = "Response"
|
547
543
|
end
|
548
544
|
|
549
545
|
def to_xml()
|
@@ -562,9 +558,10 @@ module Plivo
|
|
562
558
|
|
563
559
|
def initialize(body, attributes={})
|
564
560
|
if not body
|
565
|
-
raise PlivoError, 'No text set for '
|
561
|
+
raise PlivoError, 'No text set for Speak'
|
566
562
|
end
|
567
563
|
super(body, attributes)
|
564
|
+
@name = "Speak"
|
568
565
|
end
|
569
566
|
end
|
570
567
|
|
@@ -575,9 +572,10 @@ module Plivo
|
|
575
572
|
|
576
573
|
def initialize(body, attributes={})
|
577
574
|
if not body
|
578
|
-
raise PlivoError 'No url set for '
|
575
|
+
raise PlivoError 'No url set for Play'
|
579
576
|
end
|
580
577
|
super(body, attributes)
|
578
|
+
@name = "Speak"
|
581
579
|
end
|
582
580
|
end
|
583
581
|
|
@@ -588,6 +586,7 @@ module Plivo
|
|
588
586
|
|
589
587
|
def initialize(attributes={})
|
590
588
|
super(nil, attributes)
|
589
|
+
@name = "Wait"
|
591
590
|
end
|
592
591
|
end
|
593
592
|
|
@@ -598,9 +597,10 @@ module Plivo
|
|
598
597
|
|
599
598
|
def initialize(body, attributes={})
|
600
599
|
if not body
|
601
|
-
raise PlivoError 'No url set for '
|
600
|
+
raise PlivoError 'No url set for Redirect'
|
602
601
|
end
|
603
602
|
super(body, attributes)
|
603
|
+
@name = "Redirect"
|
604
604
|
end
|
605
605
|
end
|
606
606
|
|
@@ -611,6 +611,7 @@ module Plivo
|
|
611
611
|
|
612
612
|
def initialize(attributes={})
|
613
613
|
super(nil, attributes)
|
614
|
+
@name = "Hangup"
|
614
615
|
end
|
615
616
|
end
|
616
617
|
|
@@ -623,6 +624,7 @@ module Plivo
|
|
623
624
|
|
624
625
|
def initialize(attributes={})
|
625
626
|
super(nil, attributes)
|
627
|
+
@name = "GetDigits"
|
626
628
|
end
|
627
629
|
end
|
628
630
|
|
@@ -633,9 +635,10 @@ module Plivo
|
|
633
635
|
|
634
636
|
def initialize(body, attributes={})
|
635
637
|
if not body
|
636
|
-
raise PlivoError, 'No number set for '
|
638
|
+
raise PlivoError, 'No number set for Number'
|
637
639
|
end
|
638
640
|
super(body, attributes)
|
641
|
+
@name = "Number"
|
639
642
|
end
|
640
643
|
end
|
641
644
|
|
@@ -646,9 +649,10 @@ module Plivo
|
|
646
649
|
|
647
650
|
def initialize(body, attributes={})
|
648
651
|
if not body
|
649
|
-
raise PlivoError, 'No user set for '
|
652
|
+
raise PlivoError, 'No user set for User'
|
650
653
|
end
|
651
654
|
super(body, attributes)
|
655
|
+
@name = "User"
|
652
656
|
end
|
653
657
|
end
|
654
658
|
|
@@ -662,6 +666,7 @@ module Plivo
|
|
662
666
|
|
663
667
|
def initialize(attributes={})
|
664
668
|
super(nil, attributes)
|
669
|
+
@name = "Dial"
|
665
670
|
end
|
666
671
|
end
|
667
672
|
|
@@ -677,9 +682,10 @@ module Plivo
|
|
677
682
|
|
678
683
|
def initialize(body, attributes={})
|
679
684
|
if not body
|
680
|
-
raise PlivoError, 'No conference name set for '
|
685
|
+
raise PlivoError, 'No conference name set for Conference'
|
681
686
|
end
|
682
687
|
super(body, attributes)
|
688
|
+
@name = "Conference"
|
683
689
|
end
|
684
690
|
end
|
685
691
|
|
@@ -692,6 +698,7 @@ module Plivo
|
|
692
698
|
|
693
699
|
def initialize(attributes={})
|
694
700
|
super(nil, attributes)
|
701
|
+
@name = "Record"
|
695
702
|
end
|
696
703
|
end
|
697
704
|
|
@@ -702,6 +709,7 @@ module Plivo
|
|
702
709
|
|
703
710
|
def initialize(attributes={})
|
704
711
|
super(nil, attributes)
|
712
|
+
@name = "PreAnswer"
|
705
713
|
end
|
706
714
|
end
|
707
715
|
|
@@ -712,9 +720,10 @@ module Plivo
|
|
712
720
|
|
713
721
|
def initialize(body, attributes={})
|
714
722
|
if not body
|
715
|
-
raise PlivoError, 'No text set for '
|
723
|
+
raise PlivoError, 'No text set for Message'
|
716
724
|
end
|
717
725
|
super(body, attributes)
|
726
|
+
@name = "Message"
|
718
727
|
end
|
719
728
|
end
|
720
729
|
end
|
metadata
CHANGED
@@ -1,100 +1,80 @@
|
|
1
|
-
--- !ruby/object:Gem::Specification
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
2
|
name: plivo
|
3
|
-
version: !ruby/object:Gem::Version
|
4
|
-
|
5
|
-
prerelease:
|
6
|
-
segments:
|
7
|
-
- 0
|
8
|
-
- 2
|
9
|
-
- 5
|
10
|
-
version: 0.2.5
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
version: 0.2.6
|
5
|
+
prerelease:
|
11
6
|
platform: ruby
|
12
|
-
authors:
|
7
|
+
authors:
|
13
8
|
- Plivo Inc
|
14
9
|
autorequire:
|
15
10
|
bindir: bin
|
16
11
|
cert_chain: []
|
17
|
-
|
18
|
-
|
19
|
-
|
20
|
-
dependencies:
|
21
|
-
- !ruby/object:Gem::Dependency
|
12
|
+
date: 2012-06-04 00:00:00.000000000 Z
|
13
|
+
dependencies:
|
14
|
+
- !ruby/object:Gem::Dependency
|
22
15
|
name: builder
|
23
|
-
|
24
|
-
requirement: &id001 !ruby/object:Gem::Requirement
|
16
|
+
requirement: &16458960 !ruby/object:Gem::Requirement
|
25
17
|
none: false
|
26
|
-
requirements:
|
27
|
-
- -
|
28
|
-
- !ruby/object:Gem::Version
|
29
|
-
hash: 15
|
30
|
-
segments:
|
31
|
-
- 2
|
32
|
-
- 1
|
33
|
-
- 2
|
18
|
+
requirements:
|
19
|
+
- - ! '>='
|
20
|
+
- !ruby/object:Gem::Version
|
34
21
|
version: 2.1.2
|
35
22
|
type: :runtime
|
36
|
-
version_requirements: *id001
|
37
|
-
- !ruby/object:Gem::Dependency
|
38
|
-
name: rest-client
|
39
23
|
prerelease: false
|
40
|
-
|
24
|
+
version_requirements: *16458960
|
25
|
+
- !ruby/object:Gem::Dependency
|
26
|
+
name: rest-client
|
27
|
+
requirement: &16456560 !ruby/object:Gem::Requirement
|
41
28
|
none: false
|
42
|
-
requirements:
|
43
|
-
- -
|
44
|
-
- !ruby/object:Gem::Version
|
45
|
-
hash: 1
|
46
|
-
segments:
|
47
|
-
- 1
|
48
|
-
- 6
|
49
|
-
- 7
|
29
|
+
requirements:
|
30
|
+
- - ! '>='
|
31
|
+
- !ruby/object:Gem::Version
|
50
32
|
version: 1.6.7
|
51
33
|
type: :runtime
|
52
|
-
|
34
|
+
prerelease: false
|
35
|
+
version_requirements: *16456560
|
36
|
+
- !ruby/object:Gem::Dependency
|
37
|
+
name: json
|
38
|
+
requirement: &16907040 !ruby/object:Gem::Requirement
|
39
|
+
none: false
|
40
|
+
requirements:
|
41
|
+
- - ! '>='
|
42
|
+
- !ruby/object:Gem::Version
|
43
|
+
version: 1.6.6
|
44
|
+
type: :runtime
|
45
|
+
prerelease: false
|
46
|
+
version_requirements: *16907040
|
53
47
|
description: A Ruby gem for interacting with the Plivo Platform
|
54
48
|
email: support@plivo.com
|
55
49
|
executables: []
|
56
|
-
|
57
50
|
extensions: []
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
files:
|
62
|
-
- lib/plivo_call.rb
|
51
|
+
extra_rdoc_files:
|
52
|
+
- README.md
|
53
|
+
files:
|
63
54
|
- lib/plivo.rb
|
64
|
-
- README.
|
65
|
-
has_rdoc: true
|
55
|
+
- README.md
|
66
56
|
homepage: http://www.plivo.com
|
67
57
|
licenses: []
|
68
|
-
|
69
58
|
post_install_message:
|
70
59
|
rdoc_options: []
|
71
|
-
|
72
|
-
require_paths:
|
60
|
+
require_paths:
|
73
61
|
- lib
|
74
|
-
required_ruby_version: !ruby/object:Gem::Requirement
|
62
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
75
63
|
none: false
|
76
|
-
requirements:
|
77
|
-
- -
|
78
|
-
- !ruby/object:Gem::Version
|
79
|
-
|
80
|
-
|
81
|
-
- 0
|
82
|
-
version: "0"
|
83
|
-
required_rubygems_version: !ruby/object:Gem::Requirement
|
64
|
+
requirements:
|
65
|
+
- - ! '>='
|
66
|
+
- !ruby/object:Gem::Version
|
67
|
+
version: '0'
|
68
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
84
69
|
none: false
|
85
|
-
requirements:
|
86
|
-
- -
|
87
|
-
- !ruby/object:Gem::Version
|
88
|
-
|
89
|
-
segments:
|
90
|
-
- 0
|
91
|
-
version: "0"
|
70
|
+
requirements:
|
71
|
+
- - ! '>='
|
72
|
+
- !ruby/object:Gem::Version
|
73
|
+
version: '0'
|
92
74
|
requirements: []
|
93
|
-
|
94
75
|
rubyforge_project:
|
95
|
-
rubygems_version: 1.
|
76
|
+
rubygems_version: 1.8.11
|
96
77
|
signing_key:
|
97
78
|
specification_version: 3
|
98
79
|
summary: A Ruby gem for communicating with the Plivo Platform
|
99
80
|
test_files: []
|
100
|
-
|