twilio-wrapper 0.0.3 → 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- data/Gemfile.lock +2 -2
- data/VERSION +1 -1
- data/lib/twilio-wrapper.rb +16 -10
- data/twilio-wrapper.gemspec +70 -0
- metadata +11 -10
data/Gemfile.lock
CHANGED
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0
|
1
|
+
0.1.0
|
data/lib/twilio-wrapper.rb
CHANGED
@@ -1,15 +1,15 @@
|
|
1
1
|
require 'twiliolib'
|
2
2
|
|
3
|
-
|
3
|
+
module TwilioWrapper
|
4
|
+
|
5
|
+
extend self
|
6
|
+
|
4
7
|
API_VERSION = '2010-04-01'
|
5
|
-
|
8
|
+
attr_accessor :account_sid, :account_token, :caller_id, :caller_pin, :twilio_response, :logger
|
6
9
|
|
7
|
-
def
|
8
|
-
|
9
|
-
|
10
|
-
@caller_id = caller_id
|
11
|
-
@caller_pin = caller_pin
|
12
|
-
|
10
|
+
def configure
|
11
|
+
yield self
|
12
|
+
|
13
13
|
@account = Twilio::RestAccount.new(@account_sid, @account_token)
|
14
14
|
end
|
15
15
|
|
@@ -23,8 +23,14 @@ class TwilioWrapper
|
|
23
23
|
resp = @account.request("/#{API_VERSION}/Accounts/#{@account_sid}/SMS/Messages", 'POST', payload)
|
24
24
|
|
25
25
|
send_success = resp.is_a?(Net::HTTPSuccess)
|
26
|
-
|
27
|
-
|
26
|
+
|
27
|
+
if(logger)
|
28
|
+
if(send_success)
|
29
|
+
logger.debug("Twilio SMS Sent")
|
30
|
+
else
|
31
|
+
logger.warn("Twilio SMS Failed: #{resp.inspect}")
|
32
|
+
end
|
33
|
+
end
|
28
34
|
|
29
35
|
return send_success
|
30
36
|
end
|
@@ -0,0 +1,70 @@
|
|
1
|
+
# Generated by jeweler
|
2
|
+
# DO NOT EDIT THIS FILE DIRECTLY
|
3
|
+
# Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
|
4
|
+
# -*- encoding: utf-8 -*-
|
5
|
+
|
6
|
+
Gem::Specification.new do |s|
|
7
|
+
s.name = %q{twilio-wrapper}
|
8
|
+
s.version = "0.1.0"
|
9
|
+
|
10
|
+
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
|
+
s.authors = ["Mike Emery"]
|
12
|
+
s.date = %q{2011-08-07}
|
13
|
+
s.description = %q{Aims to provide a cleaner interface for developers to interact with the Twilio API.}
|
14
|
+
s.email = %q{mike@sparqcode.com}
|
15
|
+
s.extra_rdoc_files = [
|
16
|
+
"LICENSE.txt",
|
17
|
+
"README",
|
18
|
+
"README.rdoc"
|
19
|
+
]
|
20
|
+
s.files = [
|
21
|
+
".document",
|
22
|
+
".rspec",
|
23
|
+
"Gemfile",
|
24
|
+
"Gemfile.lock",
|
25
|
+
"LICENSE.txt",
|
26
|
+
"README",
|
27
|
+
"README.rdoc",
|
28
|
+
"Rakefile",
|
29
|
+
"VERSION",
|
30
|
+
"lib/twilio-wrapper.rb",
|
31
|
+
"spec/VERSION",
|
32
|
+
"spec/spec_helper.rb",
|
33
|
+
"spec/twilio-wrapper_spec.rb",
|
34
|
+
"twilio-wrapper.gemspec"
|
35
|
+
]
|
36
|
+
s.homepage = %q{http://github.com/MikeEmery/twilio-wrapper}
|
37
|
+
s.licenses = ["MIT"]
|
38
|
+
s.require_paths = ["lib"]
|
39
|
+
s.rubygems_version = %q{1.6.2}
|
40
|
+
s.summary = %q{Thin wrapper around the twiliolib gem to provide a simpler interface}
|
41
|
+
s.test_files = [
|
42
|
+
"spec/spec_helper.rb",
|
43
|
+
"spec/twilio-wrapper_spec.rb"
|
44
|
+
]
|
45
|
+
|
46
|
+
if s.respond_to? :specification_version then
|
47
|
+
s.specification_version = 3
|
48
|
+
|
49
|
+
if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
|
50
|
+
s.add_runtime_dependency(%q<twiliolib>, ["~> 2.0.7"])
|
51
|
+
s.add_development_dependency(%q<rspec>, ["~> 2.3.0"])
|
52
|
+
s.add_development_dependency(%q<bundler>, ["~> 1.0.0"])
|
53
|
+
s.add_development_dependency(%q<jeweler>, ["~> 1.5.2"])
|
54
|
+
s.add_development_dependency(%q<rcov>, [">= 0"])
|
55
|
+
else
|
56
|
+
s.add_dependency(%q<twiliolib>, ["~> 2.0.7"])
|
57
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
58
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
59
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
60
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
61
|
+
end
|
62
|
+
else
|
63
|
+
s.add_dependency(%q<twiliolib>, ["~> 2.0.7"])
|
64
|
+
s.add_dependency(%q<rspec>, ["~> 2.3.0"])
|
65
|
+
s.add_dependency(%q<bundler>, ["~> 1.0.0"])
|
66
|
+
s.add_dependency(%q<jeweler>, ["~> 1.5.2"])
|
67
|
+
s.add_dependency(%q<rcov>, [">= 0"])
|
68
|
+
end
|
69
|
+
end
|
70
|
+
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: twilio-wrapper
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 27
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
|
+
- 1
|
8
9
|
- 0
|
9
|
-
|
10
|
-
version: 0.0.3
|
10
|
+
version: 0.1.0
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Mike Emery
|
@@ -15,10 +15,11 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-
|
18
|
+
date: 2011-08-07 00:00:00 -04:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|
22
|
+
prerelease: false
|
22
23
|
type: :runtime
|
23
24
|
requirement: &id001 !ruby/object:Gem::Requirement
|
24
25
|
none: false
|
@@ -33,8 +34,8 @@ dependencies:
|
|
33
34
|
version: 2.0.7
|
34
35
|
name: twiliolib
|
35
36
|
version_requirements: *id001
|
36
|
-
prerelease: false
|
37
37
|
- !ruby/object:Gem::Dependency
|
38
|
+
prerelease: false
|
38
39
|
type: :development
|
39
40
|
requirement: &id002 !ruby/object:Gem::Requirement
|
40
41
|
none: false
|
@@ -49,8 +50,8 @@ dependencies:
|
|
49
50
|
version: 2.3.0
|
50
51
|
name: rspec
|
51
52
|
version_requirements: *id002
|
52
|
-
prerelease: false
|
53
53
|
- !ruby/object:Gem::Dependency
|
54
|
+
prerelease: false
|
54
55
|
type: :development
|
55
56
|
requirement: &id003 !ruby/object:Gem::Requirement
|
56
57
|
none: false
|
@@ -65,8 +66,8 @@ dependencies:
|
|
65
66
|
version: 1.0.0
|
66
67
|
name: bundler
|
67
68
|
version_requirements: *id003
|
68
|
-
prerelease: false
|
69
69
|
- !ruby/object:Gem::Dependency
|
70
|
+
prerelease: false
|
70
71
|
type: :development
|
71
72
|
requirement: &id004 !ruby/object:Gem::Requirement
|
72
73
|
none: false
|
@@ -81,8 +82,8 @@ dependencies:
|
|
81
82
|
version: 1.5.2
|
82
83
|
name: jeweler
|
83
84
|
version_requirements: *id004
|
84
|
-
prerelease: false
|
85
85
|
- !ruby/object:Gem::Dependency
|
86
|
+
prerelease: false
|
86
87
|
type: :development
|
87
88
|
requirement: &id005 !ruby/object:Gem::Requirement
|
88
89
|
none: false
|
@@ -95,7 +96,6 @@ dependencies:
|
|
95
96
|
version: "0"
|
96
97
|
name: rcov
|
97
98
|
version_requirements: *id005
|
98
|
-
prerelease: false
|
99
99
|
description: Aims to provide a cleaner interface for developers to interact with the Twilio API.
|
100
100
|
email: mike@sparqcode.com
|
101
101
|
executables: []
|
@@ -120,6 +120,7 @@ files:
|
|
120
120
|
- spec/VERSION
|
121
121
|
- spec/spec_helper.rb
|
122
122
|
- spec/twilio-wrapper_spec.rb
|
123
|
+
- twilio-wrapper.gemspec
|
123
124
|
has_rdoc: true
|
124
125
|
homepage: http://github.com/MikeEmery/twilio-wrapper
|
125
126
|
licenses:
|
@@ -150,7 +151,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
150
151
|
requirements: []
|
151
152
|
|
152
153
|
rubyforge_project:
|
153
|
-
rubygems_version: 1.
|
154
|
+
rubygems_version: 1.6.2
|
154
155
|
signing_key:
|
155
156
|
specification_version: 3
|
156
157
|
summary: Thin wrapper around the twiliolib gem to provide a simpler interface
|