ruby_ami 1.3.3 → 1.3.4

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2781ad29f7dec234704d7bd3c50181eb1832316f
4
- data.tar.gz: 1c1a3ff6f02c2978af62d08e8132aa853de468a2
3
+ metadata.gz: 87d233c2b2c4e712089b0f2ce6c1f6ef75b877cf
4
+ data.tar.gz: f04dff4a31a2b235babc6c8ab3c0ae5561574841
5
5
  SHA512:
6
- metadata.gz: b454fac0e1c011871b49be9543d8919c598e73bd077716824f752d9d723b935c466915429f5d71d31153317dac79af142015b3d8d7102212c91bc4426dba7201
7
- data.tar.gz: f877bba7372958c350deb29478a5b80a4cac49b75f5a222602a9b555ff98d99cca4acf054ce6228cbffd4b0c51916fb32732a6e158d07e7149fd7389053801a4
6
+ metadata.gz: d462a5e08948fdd719b76929d60da79983bafa4d4b9bc9155bc787a0937ec3ba930fffd91886f344a40944410186ddd6078b2b732e0d1c3356066a3786f23feb
7
+ data.tar.gz: 7e2a487f30a366182462c0301960d864dadfa17235721038d1e261062c79646fde4d16f1c08ce4ff4ad52bdccf648cf2c59b4aa0ab5a74c394d39c8c90fdc973
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # [develop](https://github.com/adhearsion/ruby_ami)
2
2
 
3
+ # [1.3.4](https://github.com/adhearsion/ruby_ami/compare/v1.3.3...v1.3.4) - [2013-04-25](https://rubygems.org/gems/ruby_ami/versions/1.3.4)
4
+ * Bugfix: Handle AGI 5xx responses
5
+
3
6
  # [1.3.3](https://github.com/adhearsion/ruby_ami/compare/v1.3.2...v1.3.3) - [2013-04-09](https://rubygems.org/gems/ruby_ami/versions/1.3.3)
4
7
  * Bugfix: DBGet actions are now not terminated specially
5
8
 
@@ -4,7 +4,7 @@ module RubyAMI
4
4
  class AGIResultParser
5
5
  attr_reader :code, :result, :data
6
6
 
7
- FORMAT = /^(?<code>\d{3}) result=(?<result>-?\d*) ?(?<data>\(?.*\)?)?$/.freeze
7
+ FORMAT = /^(?<code>\d{3})( result=(?<result>-?\d*))? ?(?<data>\(?.*\)?)?$/.freeze
8
8
  DATA_KV_FORMAT = /(?<key>[\w\d]+)=(?<value>[\w\d]*)/.freeze
9
9
  DATA_CLEANER = /(^\()|(\)$)/.freeze
10
10
 
@@ -31,7 +31,7 @@ module RubyAMI
31
31
 
32
32
  def parse
33
33
  @code = match[:code].to_i
34
- @result = match[:result].to_i
34
+ @result = match[:result] ? match[:result].to_i : nil
35
35
  @data = match[:data] ? match[:data].gsub(DATA_CLEANER, '').freeze : nil
36
36
  end
37
37
 
@@ -1,4 +1,4 @@
1
1
  # encoding: utf-8
2
2
  module RubyAMI
3
- VERSION = "1.3.3"
3
+ VERSION = "1.3.4"
4
4
  end
@@ -48,5 +48,14 @@ module RubyAMI
48
48
  its(:data) { should == 'foo=bar' }
49
49
  its(:data_hash) { should == {'foo' => 'bar'} }
50
50
  end
51
+
52
+ context 'with a 5xx error' do
53
+ let(:result_string) { "510%20Invalid%20or%20unknown%20command%0A" }
54
+
55
+ its(:code) { should == 510 }
56
+ its(:result) { should be_nil }
57
+ its(:data) { should == 'Invalid or unknown command' }
58
+ its(:data_hash) { should be_nil }
59
+ end
51
60
  end
52
61
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ami
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.3.3
4
+ version: 1.3.4
5
5
  platform: ruby
6
6
  authors:
7
7
  - Ben Langfeld
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-04-09 00:00:00.000000000 Z
11
+ date: 2013-04-25 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: celluloid-io