ruby_ami 1.3.1 → 1.3.2
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/.gitignore +2 -1
- data/CHANGELOG.md +3 -0
- data/lib/ruby_ami/client.rb +2 -2
- data/lib/ruby_ami/stream.rb +5 -1
- data/lib/ruby_ami/version.rb +1 -1
- data/ruby_ami.gemspec +1 -1
- data/spec/ruby_ami/stream_spec.rb +1 -1
- data/spec/support/mock_server.rb +4 -2
- metadata +4 -4
    
        checksums.yaml
    CHANGED
    
    | @@ -1,7 +1,7 @@ | |
| 1 1 | 
             
            ---
         | 
| 2 2 | 
             
            SHA1:
         | 
| 3 | 
            -
              metadata.gz:  | 
| 4 | 
            -
              data.tar.gz:  | 
| 3 | 
            +
              metadata.gz: e8028e8180d0b9f71505465dc8477ecdf2421d1e
         | 
| 4 | 
            +
              data.tar.gz: 5d7cfeb91c314b10e322c4c551ca4e63c3a0f306
         | 
| 5 5 | 
             
            SHA512:
         | 
| 6 | 
            -
              metadata.gz:  | 
| 7 | 
            -
              data.tar.gz:  | 
| 6 | 
            +
              metadata.gz: 689ab93300857dac9f3c898f48ae7a39ea797bc2069befe9b5db706351d65eadb71dcff303030e5d8cadd74b3d06f2347fd6465c9448a734d703437923fdb0ea
         | 
| 7 | 
            +
              data.tar.gz: ba4ba318a93004d0e986f6bd9a3fb8dec068d4e92fa4a93ca01f472b65f0749aa31e380e88c0e09000282764ccb58734563358191f3d9ad98035b846cd81ef96
         | 
    
        data/.gitignore
    CHANGED
    
    
    
        data/CHANGELOG.md
    CHANGED
    
    | @@ -1,5 +1,8 @@ | |
| 1 1 | 
             
            # [develop](https://github.com/adhearsion/ruby_ami)
         | 
| 2 2 |  | 
| 3 | 
            +
            # [1.3.2](https://github.com/adhearsion/ruby_ami/compare/v1.3.1...v1.3.2) - [2013-03-22](https://rubygems.org/gems/ruby_ami/versions/1.3.2)
         | 
| 4 | 
            +
              * CS: Avoid celluloid deprecation warnings
         | 
| 5 | 
            +
             | 
| 3 6 | 
             
            # [1.3.1](https://github.com/adhearsion/ruby_ami/compare/v1.3.0...v1.3.1) - [2013-03-20](https://rubygems.org/gems/ruby_ami/versions/1.3.1)
         | 
| 4 7 | 
             
              * Bugfix: Add support for causal event types `confbridgelist` and `confbridgelistrooms`
         | 
| 5 8 | 
             
              * Bugfix: Loosen celluloid dependency
         | 
    
        data/lib/ruby_ami/client.rb
    CHANGED
    
    | @@ -13,7 +13,7 @@ module RubyAMI | |
| 13 13 | 
             
                  if RubyAMI.rbx?
         | 
| 14 14 | 
             
                    logger.warn 'The "timeout" parameter is not supported when using Rubinius'
         | 
| 15 15 | 
             
                  end
         | 
| 16 | 
            -
             | 
| 16 | 
            +
             | 
| 17 17 | 
             
                  stop_writing_actions
         | 
| 18 18 |  | 
| 19 19 | 
             
                  @pending_actions  = {}
         | 
| @@ -48,7 +48,7 @@ module RubyAMI | |
| 48 48 | 
             
                def start
         | 
| 49 49 | 
             
                  @events_stream  = new_stream lambda { |event| @event_processor << event }
         | 
| 50 50 | 
             
                  @actions_stream = new_stream lambda { |message| @message_processor << message }
         | 
| 51 | 
            -
                  streams.each | 
| 51 | 
            +
                  streams.each { |stream| stream.async.run }
         | 
| 52 52 | 
             
                  @state = :started
         | 
| 53 53 | 
             
                  streams.each { |s| Celluloid::Actor.join s }
         | 
| 54 54 | 
             
                end
         | 
    
        data/lib/ruby_ami/stream.rb
    CHANGED
    
    | @@ -16,6 +16,8 @@ module RubyAMI | |
| 16 16 |  | 
| 17 17 | 
             
                attr_reader :logger
         | 
| 18 18 |  | 
| 19 | 
            +
                finalizer :finalize
         | 
| 20 | 
            +
             | 
| 19 21 | 
             
                def initialize(host, port, event_callback, logger = Logger, timeout = 0)
         | 
| 20 22 | 
             
                  super()
         | 
| 21 23 | 
             
                  @host, @port, @event_callback, @logger, @timeout = host, port, event_callback, logger, timeout
         | 
| @@ -28,7 +30,7 @@ module RubyAMI | |
| 28 30 | 
             
                end
         | 
| 29 31 |  | 
| 30 32 | 
             
                def run
         | 
| 31 | 
            -
                  Timeout::timeout(@timeout) do | 
| 33 | 
            +
                  Timeout::timeout(@timeout) do
         | 
| 32 34 | 
             
                    @socket = TCPSocket.from_ruby_socket ::TCPSocket.new(@host, @port)
         | 
| 33 35 | 
             
                  end
         | 
| 34 36 | 
             
                  post_init
         | 
| @@ -74,6 +76,8 @@ module RubyAMI | |
| 74 76 |  | 
| 75 77 | 
             
                alias :error_received :message_received
         | 
| 76 78 |  | 
| 79 | 
            +
                private
         | 
| 80 | 
            +
             | 
| 77 81 | 
             
                def finalize
         | 
| 78 82 | 
             
                  logger.debug "Finalizing stream"
         | 
| 79 83 | 
             
                  @socket.close if @socket
         | 
    
        data/lib/ruby_ami/version.rb
    CHANGED
    
    
    
        data/ruby_ami.gemspec
    CHANGED
    
    | @@ -18,7 +18,7 @@ Gem::Specification.new do |s| | |
| 18 18 | 
             
              s.executables   = `git ls-files -- bin/*`.split("\n").map{ |f| File.basename(f) }
         | 
| 19 19 | 
             
              s.require_paths = ["lib"]
         | 
| 20 20 |  | 
| 21 | 
            -
              s.add_runtime_dependency %q<celluloid-io>, ["~> 0. | 
| 21 | 
            +
              s.add_runtime_dependency %q<celluloid-io>, ["~> 0.13"]
         | 
| 22 22 | 
             
              s.add_runtime_dependency %q<future-resource>, [">= 0"]
         | 
| 23 23 | 
             
              s.add_runtime_dependency %q<girl_friday>, [">= 0"]
         | 
| 24 24 | 
             
              s.add_runtime_dependency %q<countdownlatch>, ["~> 1.0"]
         | 
| @@ -27,7 +27,7 @@ module RubyAMI | |
| 27 27 | 
             
                  mock_target.expects(:receive_data).send(*(times ? [:times, times] : [:at_least, 1])).with &block
         | 
| 28 28 | 
             
                  s = ServerMock.new '127.0.0.1', server_port, mock_target
         | 
| 29 29 | 
             
                  @stream = Stream.new '127.0.0.1', server_port, lambda { |m| client.message_received m }
         | 
| 30 | 
            -
                  @stream.run | 
| 30 | 
            +
                  @stream.async.run
         | 
| 31 31 | 
             
                  fake_client.call if fake_client.respond_to? :call
         | 
| 32 32 | 
             
                  Celluloid::Actor.join s
         | 
| 33 33 | 
             
                  Celluloid::Actor.join @stream
         | 
    
        data/spec/support/mock_server.rb
    CHANGED
    
    | @@ -4,12 +4,14 @@ MockServer = Class.new | |
| 4 4 | 
             
            class ServerMock
         | 
| 5 5 | 
             
              include Celluloid::IO
         | 
| 6 6 |  | 
| 7 | 
            +
              finalizer :finalize
         | 
| 8 | 
            +
             | 
| 7 9 | 
             
              def initialize(host, port, mock_target = MockServer.new)
         | 
| 8 10 | 
             
                puts "*** Starting echo server on #{host}:#{port}"
         | 
| 9 11 | 
             
                @server = TCPServer.new host, port
         | 
| 10 12 | 
             
                @mock_target = mock_target
         | 
| 11 13 | 
             
                @clients = []
         | 
| 12 | 
            -
                run | 
| 14 | 
            +
                async.run
         | 
| 13 15 | 
             
              end
         | 
| 14 16 |  | 
| 15 17 | 
             
              def finalize
         | 
| @@ -20,7 +22,7 @@ class ServerMock | |
| 20 22 |  | 
| 21 23 | 
             
              def run
         | 
| 22 24 | 
             
                after(0.5) { terminate }
         | 
| 23 | 
            -
                loop { handle_connection | 
| 25 | 
            +
                loop { async.handle_connection @server.accept }
         | 
| 24 26 | 
             
              end
         | 
| 25 27 |  | 
| 26 28 | 
             
              def handle_connection(socket)
         | 
    
        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.2
         | 
| 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-03- | 
| 11 | 
            +
            date: 2013-03-23 00:00:00.000000000 Z
         | 
| 12 12 | 
             
            dependencies:
         | 
| 13 13 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 14 14 | 
             
              name: celluloid-io
         | 
| @@ -16,14 +16,14 @@ dependencies: | |
| 16 16 | 
             
                requirements:
         | 
| 17 17 | 
             
                - - ~>
         | 
| 18 18 | 
             
                  - !ruby/object:Gem::Version
         | 
| 19 | 
            -
                    version: '0. | 
| 19 | 
            +
                    version: '0.13'
         | 
| 20 20 | 
             
              type: :runtime
         | 
| 21 21 | 
             
              prerelease: false
         | 
| 22 22 | 
             
              version_requirements: !ruby/object:Gem::Requirement
         | 
| 23 23 | 
             
                requirements:
         | 
| 24 24 | 
             
                - - ~>
         | 
| 25 25 | 
             
                  - !ruby/object:Gem::Version
         | 
| 26 | 
            -
                    version: '0. | 
| 26 | 
            +
                    version: '0.13'
         | 
| 27 27 | 
             
            - !ruby/object:Gem::Dependency
         | 
| 28 28 | 
             
              name: future-resource
         | 
| 29 29 | 
             
              requirement: !ruby/object:Gem::Requirement
         |