bandwidth 0.0.2 → 0.0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/VERSION +1 -1
- data/bandwidth.gemspec +2 -2
- data/lib/bandwidth/bandwidth.rb +8 -6
- data/spec/bandwidth_spec.rb +4 -4
- metadata +4 -4
data/VERSION
CHANGED
@@ -1 +1 @@
|
|
1
|
-
0.0.
|
1
|
+
0.0.3
|
data/bandwidth.gemspec
CHANGED
@@ -5,11 +5,11 @@
|
|
5
5
|
|
6
6
|
Gem::Specification.new do |s|
|
7
7
|
s.name = %q{bandwidth}
|
8
|
-
s.version = "0.0.
|
8
|
+
s.version = "0.0.3"
|
9
9
|
|
10
10
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
11
11
|
s.authors = ["Jason Goecke"]
|
12
|
-
s.date = %q{2011-03-
|
12
|
+
s.date = %q{2011-03-21}
|
13
13
|
s.description = %q{More detail here: https://my.bandwidth.com/portal/apidoc/welcome.htm}
|
14
14
|
s.email = %q{jason@goecke.net}
|
15
15
|
s.extra_rdoc_files = [
|
data/lib/bandwidth/bandwidth.rb
CHANGED
@@ -65,16 +65,18 @@ class Bandwidth
|
|
65
65
|
:attributes! => xml_namespaces(method_name) })
|
66
66
|
|
67
67
|
response = HTTPI.post @cdrs_request
|
68
|
+
Hashie::Mash.new({ :code => response.code,
|
69
|
+
:body => response.raw_body,
|
70
|
+
:headers => response.headers })
|
68
71
|
else
|
69
72
|
@numbers_request.body = Gyoku.xml({ method_name => params.merge({ :developer_key => @developer_key }),
|
70
73
|
:attributes! => xml_namespaces(method_name) })
|
71
74
|
|
72
75
|
response = HTTPI.post @numbers_request
|
76
|
+
Hashie::Mash.new({ :code => response.code,
|
77
|
+
:body => Crack::XML.parse(response.raw_body),
|
78
|
+
:headers => response.headers })
|
73
79
|
end
|
74
|
-
|
75
|
-
Hashie::Mash.new({ :code => response.code,
|
76
|
-
:body => Crack::XML.parse(response.raw_body),
|
77
|
-
:headers => response.headers })
|
78
80
|
end
|
79
81
|
|
80
82
|
private
|
@@ -105,9 +107,9 @@ class Bandwidth
|
|
105
107
|
end
|
106
108
|
elsif type == :cdrs
|
107
109
|
if @use_labs_uris == true
|
108
|
-
request.url = 'http://labs.bandwidth.com/api/public/v2/
|
110
|
+
request.url = 'http://labs.bandwidth.com/api/public/v2/cdr.api'
|
109
111
|
else
|
110
|
-
request.url = 'https://api.bandwidth.com/public/v2/cdrs.api'
|
112
|
+
request.url = 'https://api.bandwidth.com/api/public/v2/cdrs.api'
|
111
113
|
end
|
112
114
|
end
|
113
115
|
|
data/spec/bandwidth_spec.rb
CHANGED
@@ -2,8 +2,8 @@ require File.expand_path(File.dirname(__FILE__) + '/spec_helper')
|
|
2
2
|
|
3
3
|
describe "Bandwidth" do
|
4
4
|
before(:each) do
|
5
|
-
# You will need to set the
|
6
|
-
@bandwidth = Bandwidth.new({ :developer_key => '
|
5
|
+
# You will need to set the environment variable BANDWIDTH_DEVELPOR_KEY to a valid one from Bandwidth in order to run a test
|
6
|
+
@bandwidth = Bandwidth.new({ :developer_key => ENV['BANDWIDTH_DEVELOPER_KEY'],
|
7
7
|
:use_lab_uris => true,
|
8
8
|
:log_level => :debug })
|
9
9
|
end
|
@@ -55,9 +55,9 @@ describe "Bandwidth" do
|
|
55
55
|
|
56
56
|
describe "cdrs" do
|
57
57
|
it "should get a resopnse when retrieving cdrs" do
|
58
|
-
pending('It appears Bandwidth has not provided access to this just yet.')
|
58
|
+
#pending('It appears Bandwidth has not provided access to this just yet.')
|
59
59
|
result = @bandwidth.get_cdr_archive(:get_type => 'Daily', :get_value => '20110221')
|
60
|
-
result.should == nil
|
60
|
+
result['Content-Type'].should == nil
|
61
61
|
end
|
62
62
|
end
|
63
63
|
end
|
metadata
CHANGED
@@ -1,13 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: bandwidth
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
hash:
|
4
|
+
hash: 25
|
5
5
|
prerelease:
|
6
6
|
segments:
|
7
7
|
- 0
|
8
8
|
- 0
|
9
|
-
-
|
10
|
-
version: 0.0.
|
9
|
+
- 3
|
10
|
+
version: 0.0.3
|
11
11
|
platform: ruby
|
12
12
|
authors:
|
13
13
|
- Jason Goecke
|
@@ -15,7 +15,7 @@ autorequire:
|
|
15
15
|
bindir: bin
|
16
16
|
cert_chain: []
|
17
17
|
|
18
|
-
date: 2011-03-
|
18
|
+
date: 2011-03-21 00:00:00 -07:00
|
19
19
|
default_executable:
|
20
20
|
dependencies:
|
21
21
|
- !ruby/object:Gem::Dependency
|