oas 2.1.0 → 2.1.1

Sign up to get free protection for your applications and to get access to all the features.
data/lib/oas/adxml.rb CHANGED
@@ -43,7 +43,7 @@ module OAS
43
43
  def initialize(doc)
44
44
  @doc = doc
45
45
  @error_code = @error_text = nil
46
- error = @doc.xpath('/Response//Exception').first rescue nil
46
+ error = @doc.xpath('.//Exception').first rescue nil
47
47
  if error
48
48
  @error_code = error['errorCode'].to_i
49
49
  @error_text = error.text
data/lib/oas/version.rb CHANGED
@@ -1,3 +1,3 @@
1
1
  module OAS
2
- VERSION = '2.1.0'
2
+ VERSION = '2.1.1'
3
3
  end
data/oas.gemspec CHANGED
@@ -11,6 +11,7 @@ Gem::Specification.new do |s|
11
11
  s.homepage = "http://github.com/realmedia/oas-ruby-client"
12
12
  s.summary = %q{Ruby client for the OpenAdstream API}
13
13
  s.description = %q{Ruby client for the OpenAdstream API}
14
+ s.licenses = ['MIT']
14
15
 
15
16
  s.rubyforge_project = "oas"
16
17
 
@@ -3,15 +3,17 @@ require 'helper'
3
3
  class TestAdXMLResponse < MiniTest::Unit::TestCase
4
4
  def test_successful_response
5
5
  node = <<-EOXML
6
- <Response>
7
- <Campaign>
8
- <Overview>
9
- <Id>DPtestcampaign-01</Id>
10
- </Overview>
11
- </Campaign>
12
- </Response>
6
+ <AdXML>
7
+ <Response>
8
+ <Campaign>
9
+ <Overview>
10
+ <Id>DPtestcampaign-01</Id>
11
+ </Overview>
12
+ </Campaign>
13
+ </Response>
14
+ </AdXML>
13
15
  EOXML
14
- res = OAS::AdXML::Response.new Nokogiri.XML(node)
16
+ res = OAS::AdXML::Response.new Nokogiri.XML(node).xpath('/AdXML/Response').first
15
17
  assert res.to_hash.has_key?(:Response)
16
18
  assert res.success?
17
19
  assert_nil res.error_code
@@ -20,13 +22,15 @@ class TestAdXMLResponse < MiniTest::Unit::TestCase
20
22
 
21
23
  def test_unsuccessful_response
22
24
  node = <<-EOXML
23
- <Response>
24
- <Campaign>
25
- <Exception errorCode="512">Campaign ID already exists in Open AdStream</Exception>
26
- </Campaign>
27
- </Response>
25
+ <AdXML>
26
+ <Response>
27
+ <Campaign>
28
+ <Exception errorCode="512">Campaign ID already exists in Open AdStream</Exception>
29
+ </Campaign>
30
+ </Response>
31
+ </AdXML>
28
32
  EOXML
29
- res = OAS::AdXML::Response.new Nokogiri.XML(node)
33
+ res = OAS::AdXML::Response.new Nokogiri.XML(node).xpath('/AdXML/Response').first
30
34
  refute res.success?
31
35
  assert_equal 512, res.error_code
32
36
  assert_equal 'Campaign ID already exists in Open AdStream', res.error_text
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: oas
3
3
  version: !ruby/object:Gem::Version
4
- version: 2.1.0
4
+ version: 2.1.1
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-07-16 00:00:00.000000000 Z
12
+ date: 2013-08-01 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: nokogiri
@@ -118,7 +118,8 @@ files:
118
118
  - test/test_configuration.rb
119
119
  - test/test_response.rb
120
120
  homepage: http://github.com/realmedia/oas-ruby-client
121
- licenses: []
121
+ licenses:
122
+ - MIT
122
123
  post_install_message:
123
124
  rdoc_options: []
124
125
  require_paths:
@@ -129,12 +130,18 @@ required_ruby_version: !ruby/object:Gem::Requirement
129
130
  - - ! '>='
130
131
  - !ruby/object:Gem::Version
131
132
  version: '0'
133
+ segments:
134
+ - 0
135
+ hash: 271148847
132
136
  required_rubygems_version: !ruby/object:Gem::Requirement
133
137
  none: false
134
138
  requirements:
135
139
  - - ! '>='
136
140
  - !ruby/object:Gem::Version
137
141
  version: '0'
142
+ segments:
143
+ - 0
144
+ hash: 271148847
138
145
  requirements: []
139
146
  rubyforge_project: oas
140
147
  rubygems_version: 1.8.24
@@ -142,4 +149,3 @@ signing_key:
142
149
  specification_version: 3
143
150
  summary: Ruby client for the OpenAdstream API
144
151
  test_files: []
145
- has_rdoc: