ruby_ami 1.3.3 → 1.3.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/CHANGELOG.md +3 -0
- data/lib/ruby_ami/agi_result_parser.rb +2 -2
- data/lib/ruby_ami/version.rb +1 -1
- data/spec/ruby_ami/agi_result_parser_spec.rb +9 -0
- metadata +2 -2
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: 87d233c2b2c4e712089b0f2ce6c1f6ef75b877cf
         | 
| 4 | 
            +
              data.tar.gz: f04dff4a31a2b235babc6c8ab3c0ae5561574841
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 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 |  | 
    
        data/lib/ruby_ami/version.rb
    CHANGED
    
    
| @@ -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. | 
| 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- | 
| 11 | 
            +
            date: 2013-04-25 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: celluloid-io
         |