twilio 2.9.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (81) hide show
  1. data/.gitignore +4 -1
  2. data/CHANGELOG.rdoc +27 -0
  3. data/Gemfile +4 -0
  4. data/README.rdoc +16 -6
  5. data/Rakefile +6 -46
  6. data/lib/twilio.rb +21 -6
  7. data/lib/twilio/account.rb +1 -1
  8. data/lib/twilio/available_phone_numbers.rb +56 -0
  9. data/lib/twilio/call.rb +4 -4
  10. data/lib/twilio/conference.rb +6 -6
  11. data/lib/twilio/incoming_phone_number.rb +16 -2
  12. data/lib/twilio/notification.rb +2 -2
  13. data/lib/twilio/outgoing_caller_id.rb +5 -4
  14. data/lib/twilio/recording.rb +2 -2
  15. data/lib/twilio/sms.rb +2 -2
  16. data/lib/twilio/twilio_object.rb +8 -5
  17. data/lib/twilio/version.rb +3 -0
  18. data/spec/fixtures/xml/account.xml +23 -0
  19. data/{test → spec}/fixtures/xml/account_renamed.xml +0 -0
  20. data/spec/fixtures/xml/available_phone_numbers_local.xml +26 -0
  21. data/spec/fixtures/xml/available_phone_numbers_local_search.xml +15 -0
  22. data/spec/fixtures/xml/available_phone_numbers_toll_free.xml +14 -0
  23. data/spec/fixtures/xml/available_phone_numbers_toll_free_search.xml +10 -0
  24. data/{test → spec}/fixtures/xml/call.xml +0 -0
  25. data/{test → spec}/fixtures/xml/call_new.xml +0 -0
  26. data/{test → spec}/fixtures/xml/call_redirected.xml +0 -0
  27. data/{test → spec}/fixtures/xml/calls.xml +0 -0
  28. data/{test → spec}/fixtures/xml/conference.xml +1 -1
  29. data/{test → spec}/fixtures/xml/conference_participant.xml +0 -0
  30. data/{test → spec}/fixtures/xml/conference_participant_muted.xml +0 -0
  31. data/{test → spec}/fixtures/xml/conference_participants.xml +0 -0
  32. data/{test → spec}/fixtures/xml/conferences.xml +0 -0
  33. data/{test → spec}/fixtures/xml/incoming_phone_number.xml +0 -0
  34. data/{test → spec}/fixtures/xml/incoming_phone_numbers.xml +0 -0
  35. data/{test → spec}/fixtures/xml/notification.xml +0 -0
  36. data/{test → spec}/fixtures/xml/notifications.xml +0 -0
  37. data/{test → spec}/fixtures/xml/outgoing_caller_id.xml +0 -0
  38. data/{test → spec}/fixtures/xml/outgoing_caller_id_new.xml +0 -0
  39. data/{test → spec}/fixtures/xml/outgoing_caller_ids.xml +0 -0
  40. data/{test → spec}/fixtures/xml/recording.xml +0 -0
  41. data/{test → spec}/fixtures/xml/recordings.xml +0 -0
  42. data/{test → spec}/fixtures/xml/sms.xml +0 -0
  43. data/{test → spec}/fixtures/xml/sms_messages.xml +0 -0
  44. data/{test → spec}/fixtures/xml/sms_new.xml +0 -0
  45. data/{test → spec}/fixtures/xml/sms_new_with_callback.xml +0 -0
  46. data/{test → spec}/fixtures/xml/transcription.xml +0 -0
  47. data/{test → spec}/fixtures/xml/transcriptions.xml +0 -0
  48. data/{test → spec}/fixtures/yml/verb_responses.yml +0 -0
  49. data/spec/spec_helper.rb +17 -0
  50. data/spec/support/twilio_helpers.rb +52 -0
  51. data/spec/twilio/account_spec.rb +21 -0
  52. data/spec/twilio/available_phone_numbers_spec.rb +53 -0
  53. data/spec/twilio/call_spec.rb +64 -0
  54. data/spec/twilio/conference_spec.rb +58 -0
  55. data/spec/twilio/incoming_phone_number_spec.rb +42 -0
  56. data/spec/twilio/live_connection_spec.rb +21 -0
  57. data/spec/twilio/notification_spec.rb +29 -0
  58. data/spec/twilio/outgoing_caller_id_spec.rb +43 -0
  59. data/spec/twilio/recording_spec.rb +44 -0
  60. data/spec/twilio/sms_spec.rb +36 -0
  61. data/spec/twilio/verb_spec.rb +235 -0
  62. data/twilio.gemspec +23 -111
  63. metadata +164 -82
  64. data/VERSION.yml +0 -5
  65. data/lib/twilio/connection.rb +0 -24
  66. data/lib/twilio/local_phone_number.rb +0 -26
  67. data/lib/twilio/toll_free_phone_number.rb +0 -26
  68. data/test/fixtures/xml/account.xml +0 -11
  69. data/test/test_helper.rb +0 -33
  70. data/test/twilio/account_test.rb +0 -28
  71. data/test/twilio/call_test.rb +0 -66
  72. data/test/twilio/conference_test.rb +0 -46
  73. data/test/twilio/connection_test.rb +0 -25
  74. data/test/twilio/incoming_phone_number_test.rb +0 -31
  75. data/test/twilio/local_phone_number_test.rb +0 -37
  76. data/test/twilio/notification_test.rb +0 -35
  77. data/test/twilio/outgoing_caller_id_test.rb +0 -45
  78. data/test/twilio/recording_test.rb +0 -47
  79. data/test/twilio/sms_test.rb +0 -27
  80. data/test/twilio/toll_free_phone_number_test.rb +0 -38
  81. data/test/twilio/verb_test.rb +0 -244
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: twilio
3
3
  version: !ruby/object:Gem::Version
4
- hash: 43
5
- prerelease: false
4
+ hash: 7
5
+ prerelease:
6
6
  segments:
7
- - 2
8
- - 9
7
+ - 3
8
+ - 0
9
9
  - 0
10
- version: 2.9.0
10
+ version: 3.0.0
11
11
  platform: ruby
12
12
  authors:
13
13
  - Phil Misiowiec
@@ -20,7 +20,7 @@ autorequire:
20
20
  bindir: bin
21
21
  cert_chain: []
22
22
 
23
- date: 2010-10-27 00:00:00 -07:00
23
+ date: 2011-03-26 00:00:00 -07:00
24
24
  default_executable:
25
25
  dependencies:
26
26
  - !ruby/object:Gem::Dependency
@@ -29,14 +29,13 @@ dependencies:
29
29
  requirement: &id001 !ruby/object:Gem::Requirement
30
30
  none: false
31
31
  requirements:
32
- - - ">="
32
+ - - ~>
33
33
  - !ruby/object:Gem::Version
34
- hash: 15
34
+ hash: 7
35
35
  segments:
36
- - 2
37
- - 1
38
- - 2
39
- version: 2.1.2
36
+ - 3
37
+ - 0
38
+ version: "3.0"
40
39
  type: :runtime
41
40
  version_requirements: *id001
42
41
  - !ruby/object:Gem::Dependency
@@ -45,93 +44,145 @@ dependencies:
45
44
  requirement: &id002 !ruby/object:Gem::Requirement
46
45
  none: false
47
46
  requirements:
48
- - - ">="
47
+ - - ~>
49
48
  - !ruby/object:Gem::Version
50
- hash: 9
49
+ hash: 11
51
50
  segments:
52
51
  - 0
52
+ - 7
53
53
  - 4
54
- - 3
55
- version: 0.4.3
54
+ version: 0.7.4
56
55
  type: :runtime
57
56
  version_requirements: *id002
57
+ - !ruby/object:Gem::Dependency
58
+ name: rake
59
+ prerelease: false
60
+ requirement: &id003 !ruby/object:Gem::Requirement
61
+ none: false
62
+ requirements:
63
+ - - ~>
64
+ - !ruby/object:Gem::Version
65
+ hash: 49
66
+ segments:
67
+ - 0
68
+ - 8
69
+ - 7
70
+ version: 0.8.7
71
+ type: :development
72
+ version_requirements: *id003
73
+ - !ruby/object:Gem::Dependency
74
+ name: rspec
75
+ prerelease: false
76
+ requirement: &id004 !ruby/object:Gem::Requirement
77
+ none: false
78
+ requirements:
79
+ - - ~>
80
+ - !ruby/object:Gem::Version
81
+ hash: 27
82
+ segments:
83
+ - 2
84
+ - 5
85
+ - 0
86
+ version: 2.5.0
87
+ type: :development
88
+ version_requirements: *id004
89
+ - !ruby/object:Gem::Dependency
90
+ name: webmock
91
+ prerelease: false
92
+ requirement: &id005 !ruby/object:Gem::Requirement
93
+ none: false
94
+ requirements:
95
+ - - ~>
96
+ - !ruby/object:Gem::Version
97
+ hash: 11
98
+ segments:
99
+ - 1
100
+ - 6
101
+ - 2
102
+ version: 1.6.2
103
+ type: :development
104
+ version_requirements: *id005
58
105
  description: Twilio API wrapper
59
- email: github@webficient.com
106
+ email:
107
+ - github@webficient.com
60
108
  executables: []
61
109
 
62
110
  extensions: []
63
111
 
64
- extra_rdoc_files:
65
- - LICENSE
66
- - README.rdoc
112
+ extra_rdoc_files: []
113
+
67
114
  files:
68
115
  - .gitignore
116
+ - CHANGELOG.rdoc
117
+ - Gemfile
69
118
  - LICENSE
70
119
  - README.rdoc
71
120
  - Rakefile
72
- - VERSION.yml
73
121
  - lib/twilio.rb
74
122
  - lib/twilio/account.rb
123
+ - lib/twilio/available_phone_numbers.rb
75
124
  - lib/twilio/call.rb
76
125
  - lib/twilio/conference.rb
77
- - lib/twilio/connection.rb
78
126
  - lib/twilio/incoming_phone_number.rb
79
- - lib/twilio/local_phone_number.rb
80
127
  - lib/twilio/notification.rb
81
128
  - lib/twilio/outgoing_caller_id.rb
82
129
  - lib/twilio/recording.rb
83
130
  - lib/twilio/sms.rb
84
- - lib/twilio/toll_free_phone_number.rb
85
131
  - lib/twilio/twilio_object.rb
86
132
  - lib/twilio/verb.rb
87
- - test/fixtures/xml/account.xml
88
- - test/fixtures/xml/account_renamed.xml
89
- - test/fixtures/xml/call.xml
90
- - test/fixtures/xml/call_new.xml
91
- - test/fixtures/xml/call_redirected.xml
92
- - test/fixtures/xml/calls.xml
93
- - test/fixtures/xml/conference.xml
94
- - test/fixtures/xml/conference_participant.xml
95
- - test/fixtures/xml/conference_participant_muted.xml
96
- - test/fixtures/xml/conference_participants.xml
97
- - test/fixtures/xml/conferences.xml
98
- - test/fixtures/xml/incoming_phone_number.xml
99
- - test/fixtures/xml/incoming_phone_numbers.xml
100
- - test/fixtures/xml/notification.xml
101
- - test/fixtures/xml/notifications.xml
102
- - test/fixtures/xml/outgoing_caller_id.xml
103
- - test/fixtures/xml/outgoing_caller_id_new.xml
104
- - test/fixtures/xml/outgoing_caller_ids.xml
105
- - test/fixtures/xml/recording.xml
106
- - test/fixtures/xml/recordings.xml
107
- - test/fixtures/xml/sms.xml
108
- - test/fixtures/xml/sms_messages.xml
109
- - test/fixtures/xml/sms_new.xml
110
- - test/fixtures/xml/sms_new_with_callback.xml
111
- - test/fixtures/xml/transcription.xml
112
- - test/fixtures/xml/transcriptions.xml
113
- - test/fixtures/yml/verb_responses.yml
114
- - test/test_helper.rb
115
- - test/twilio/account_test.rb
116
- - test/twilio/call_test.rb
117
- - test/twilio/conference_test.rb
118
- - test/twilio/connection_test.rb
119
- - test/twilio/incoming_phone_number_test.rb
120
- - test/twilio/local_phone_number_test.rb
121
- - test/twilio/notification_test.rb
122
- - test/twilio/outgoing_caller_id_test.rb
123
- - test/twilio/recording_test.rb
124
- - test/twilio/sms_test.rb
125
- - test/twilio/toll_free_phone_number_test.rb
126
- - test/twilio/verb_test.rb
133
+ - lib/twilio/version.rb
134
+ - spec/fixtures/xml/account.xml
135
+ - spec/fixtures/xml/account_renamed.xml
136
+ - spec/fixtures/xml/available_phone_numbers_local.xml
137
+ - spec/fixtures/xml/available_phone_numbers_local_search.xml
138
+ - spec/fixtures/xml/available_phone_numbers_toll_free.xml
139
+ - spec/fixtures/xml/available_phone_numbers_toll_free_search.xml
140
+ - spec/fixtures/xml/call.xml
141
+ - spec/fixtures/xml/call_new.xml
142
+ - spec/fixtures/xml/call_redirected.xml
143
+ - spec/fixtures/xml/calls.xml
144
+ - spec/fixtures/xml/conference.xml
145
+ - spec/fixtures/xml/conference_participant.xml
146
+ - spec/fixtures/xml/conference_participant_muted.xml
147
+ - spec/fixtures/xml/conference_participants.xml
148
+ - spec/fixtures/xml/conferences.xml
149
+ - spec/fixtures/xml/incoming_phone_number.xml
150
+ - spec/fixtures/xml/incoming_phone_numbers.xml
151
+ - spec/fixtures/xml/notification.xml
152
+ - spec/fixtures/xml/notifications.xml
153
+ - spec/fixtures/xml/outgoing_caller_id.xml
154
+ - spec/fixtures/xml/outgoing_caller_id_new.xml
155
+ - spec/fixtures/xml/outgoing_caller_ids.xml
156
+ - spec/fixtures/xml/recording.xml
157
+ - spec/fixtures/xml/recordings.xml
158
+ - spec/fixtures/xml/sms.xml
159
+ - spec/fixtures/xml/sms_messages.xml
160
+ - spec/fixtures/xml/sms_new.xml
161
+ - spec/fixtures/xml/sms_new_with_callback.xml
162
+ - spec/fixtures/xml/transcription.xml
163
+ - spec/fixtures/xml/transcriptions.xml
164
+ - spec/fixtures/yml/verb_responses.yml
165
+ - spec/spec_helper.rb
166
+ - spec/support/twilio_helpers.rb
167
+ - spec/twilio/account_spec.rb
168
+ - spec/twilio/available_phone_numbers_spec.rb
169
+ - spec/twilio/call_spec.rb
170
+ - spec/twilio/conference_spec.rb
171
+ - spec/twilio/incoming_phone_number_spec.rb
172
+ - spec/twilio/live_connection_spec.rb
173
+ - spec/twilio/notification_spec.rb
174
+ - spec/twilio/outgoing_caller_id_spec.rb
175
+ - spec/twilio/recording_spec.rb
176
+ - spec/twilio/sms_spec.rb
177
+ - spec/twilio/verb_spec.rb
127
178
  - twilio.gemspec
128
179
  has_rdoc: true
129
- homepage: http://github.com/webficient/twilio
180
+ homepage: ""
130
181
  licenses: []
131
182
 
132
183
  post_install_message:
133
- rdoc_options:
134
- - --charset=UTF-8
184
+ rdoc_options: []
185
+
135
186
  require_paths:
136
187
  - lib
137
188
  required_ruby_version: !ruby/object:Gem::Requirement
@@ -154,22 +205,53 @@ required_rubygems_version: !ruby/object:Gem::Requirement
154
205
  version: "0"
155
206
  requirements: []
156
207
 
157
- rubyforge_project:
158
- rubygems_version: 1.3.7
208
+ rubyforge_project: twilio
209
+ rubygems_version: 1.6.2
159
210
  signing_key:
160
211
  specification_version: 3
161
212
  summary: Twilio API Client
162
213
  test_files:
163
- - test/test_helper.rb
164
- - test/twilio/account_test.rb
165
- - test/twilio/call_test.rb
166
- - test/twilio/conference_test.rb
167
- - test/twilio/connection_test.rb
168
- - test/twilio/incoming_phone_number_test.rb
169
- - test/twilio/local_phone_number_test.rb
170
- - test/twilio/notification_test.rb
171
- - test/twilio/outgoing_caller_id_test.rb
172
- - test/twilio/recording_test.rb
173
- - test/twilio/sms_test.rb
174
- - test/twilio/toll_free_phone_number_test.rb
175
- - test/twilio/verb_test.rb
214
+ - spec/fixtures/xml/account.xml
215
+ - spec/fixtures/xml/account_renamed.xml
216
+ - spec/fixtures/xml/available_phone_numbers_local.xml
217
+ - spec/fixtures/xml/available_phone_numbers_local_search.xml
218
+ - spec/fixtures/xml/available_phone_numbers_toll_free.xml
219
+ - spec/fixtures/xml/available_phone_numbers_toll_free_search.xml
220
+ - spec/fixtures/xml/call.xml
221
+ - spec/fixtures/xml/call_new.xml
222
+ - spec/fixtures/xml/call_redirected.xml
223
+ - spec/fixtures/xml/calls.xml
224
+ - spec/fixtures/xml/conference.xml
225
+ - spec/fixtures/xml/conference_participant.xml
226
+ - spec/fixtures/xml/conference_participant_muted.xml
227
+ - spec/fixtures/xml/conference_participants.xml
228
+ - spec/fixtures/xml/conferences.xml
229
+ - spec/fixtures/xml/incoming_phone_number.xml
230
+ - spec/fixtures/xml/incoming_phone_numbers.xml
231
+ - spec/fixtures/xml/notification.xml
232
+ - spec/fixtures/xml/notifications.xml
233
+ - spec/fixtures/xml/outgoing_caller_id.xml
234
+ - spec/fixtures/xml/outgoing_caller_id_new.xml
235
+ - spec/fixtures/xml/outgoing_caller_ids.xml
236
+ - spec/fixtures/xml/recording.xml
237
+ - spec/fixtures/xml/recordings.xml
238
+ - spec/fixtures/xml/sms.xml
239
+ - spec/fixtures/xml/sms_messages.xml
240
+ - spec/fixtures/xml/sms_new.xml
241
+ - spec/fixtures/xml/sms_new_with_callback.xml
242
+ - spec/fixtures/xml/transcription.xml
243
+ - spec/fixtures/xml/transcriptions.xml
244
+ - spec/fixtures/yml/verb_responses.yml
245
+ - spec/spec_helper.rb
246
+ - spec/support/twilio_helpers.rb
247
+ - spec/twilio/account_spec.rb
248
+ - spec/twilio/available_phone_numbers_spec.rb
249
+ - spec/twilio/call_spec.rb
250
+ - spec/twilio/conference_spec.rb
251
+ - spec/twilio/incoming_phone_number_spec.rb
252
+ - spec/twilio/live_connection_spec.rb
253
+ - spec/twilio/notification_spec.rb
254
+ - spec/twilio/outgoing_caller_id_spec.rb
255
+ - spec/twilio/recording_spec.rb
256
+ - spec/twilio/sms_spec.rb
257
+ - spec/twilio/verb_spec.rb
@@ -1,5 +0,0 @@
1
- ---
2
- :major: 2
3
- :build:
4
- :minor: 9
5
- :patch: 0
@@ -1,24 +0,0 @@
1
- module Twilio
2
- include HTTParty
3
- TWILIO_URL = "https://api.twilio.com/2010-04-01/Accounts"
4
-
5
- # The connect method caches your Twilio account id and authentication token
6
- # Example:
7
- # Twilio.connect('AC309475e5fede1b49e100272a8640f438', '3a2630a909aadbf60266234756fb15a0')
8
- def self.connect(account_sid, auth_token)
9
- self.base_uri "#{TWILIO_URL}/#{account_sid}"
10
- self.basic_auth account_sid, auth_token
11
- end
12
-
13
- # DEPRECATED - use Twilio.connect
14
- class Connection
15
- include HTTParty
16
- TWILIO_URL = "https://api.twilio.com/2008-08-01/Accounts"
17
-
18
- def initialize(account_sid, auth_token)
19
- self.class.base_uri "#{TWILIO_URL}/#{account_sid}"
20
- self.class.basic_auth account_sid, auth_token
21
- end
22
- end
23
-
24
- end
@@ -1,26 +0,0 @@
1
- module Twilio
2
- # This sub-resource represents only Local phone numbers, or in other words, not toll-free numbers.
3
- # Also allows you to request a new local phone number be added to your account.
4
- # Example:
5
- # Twilio.connect('my_twilio_sid', 'my_auth_token')
6
- # Twilio::LocalPhoneNumber.list
7
- class LocalPhoneNumber < TwilioObject
8
- def create(url, area_code = nil, method = 'POST', friendly_name = nil, options = {})
9
- Twilio.post("/IncomingPhoneNumbers/Local", :body => {
10
- :VoiceUrl => url,
11
- :AreaCode => area_code,
12
- :VoiceMethod => method,
13
- :FriendlyName => friendly_name
14
- }.merge(options))
15
- end
16
-
17
- def list
18
- Twilio.get("/IncomingPhoneNumbers/Local")
19
- end
20
-
21
- def delete(phone_number_sid)
22
- Twilio.delete("/IncomingPhoneNumbers/#{phone_number_sid}")
23
- end
24
-
25
- end
26
- end
@@ -1,26 +0,0 @@
1
- module Twilio
2
- # This sub-resource represents only Toll Free phone numbers, or in other words, not local numbers.
3
- # Also allows you to request a new toll free phone number be added to your account.
4
- # Example:
5
- # Twilio.connect('my_twilio_sid', 'my_auth_token')
6
- # Twilio::TollFreePhoneNumber.list
7
- class TollFreePhoneNumber < TwilioObject
8
- def create(url, area_code = nil, method = 'POST', friendly_name = nil)
9
- Twilio.post("/IncomingPhoneNumbers/TollFree", :body => {
10
- :VoiceUrl => url,
11
- :AreaCode => area_code,
12
- :VoiceMethod => method,
13
- :FriendlyName => friendly_name
14
- })
15
- end
16
-
17
- def list
18
- Twilio.get("/IncomingPhoneNumbers/TollFree")
19
- end
20
-
21
- def delete(phone_number_sid)
22
- Twilio.delete("/IncomingPhoneNumbers/#{phone_number_sid}")
23
- end
24
-
25
- end
26
- end
@@ -1,11 +0,0 @@
1
- <TwilioResponse>
2
- <Account>
3
- <Sid>mysid</Sid>
4
- <FriendlyName>My Nice Twilio Account</FriendlyName>
5
- <Status>2</Status>
6
- <StatusText>Active</StatusText>
7
- <DateCreated>Wed, 02 Apr 2008 17:33:38 -0700</DateCreated>
8
- <DateUpdated>Wed, 02 Apr 2008 17:34:18 -0700</DateUpdated>
9
- <AuthToken>mytoken</AuthToken>
10
- </Account>
11
- </TwilioResponse>
@@ -1,33 +0,0 @@
1
- require 'test/unit'
2
- require 'fakeweb'
3
- require 'shoulda'
4
- require 'yaml'
5
- require 'twilio'
6
-
7
- FakeWeb.allow_net_connect = false
8
-
9
- class Test::Unit::TestCase #:nodoc: all
10
- end
11
-
12
- def fixture(filename) #:nodoc:
13
- path = File.join(File.dirname(__FILE__), "fixtures/xml/#{filename}.xml")
14
- File.read path
15
- end
16
-
17
- def stub_response(verb, fixture_name, options = {}) #:nodoc:
18
- fake_response = fixture(fixture_name)
19
- resource = options.delete(:resource)
20
- options = { :body => fake_response }.merge(options)
21
- FakeWeb.register_uri(verb, twilio_url(resource), options)
22
-
23
- fake_response
24
- end
25
-
26
- def twilio_url(url=nil) #:nodoc:
27
- "https://mysid:mytoken@api.twilio.com:443/2010-04-01/Accounts/mysid#{'/' + url if url}"
28
- end
29
-
30
- def verb_response(verb) #:nodoc:
31
- path = File.join(File.dirname(__FILE__), "fixtures/yml/verb_responses.yml")
32
- YAML.load_file(path)[verb.to_s]['response']
33
- end