ruby_ami 1.2.2 → 1.2.3

Sign up to get free protection for your applications and to get access to all the features.
data/CHANGELOG.md CHANGED
@@ -1,5 +1,8 @@
1
1
  # [develop](https://github.com/adhearsion/ruby_ami)
2
2
 
3
+ # [1.2.3](https://github.com/adhearsion/ruby_ami/compare/v1.2.2...v1.2.3) - [2012-09-20](https://rubygems.org/gems/ruby_ami/versions/1.2.3)
4
+ * Streams now inherit the client's logger
5
+
3
6
  # [1.2.2](https://github.com/adhearsion/ruby_ami/compare/v1.2.1...v1.2.2) - [2012-09-05](https://rubygems.org/gems/ruby_ami/versions/1.2.2)
4
7
  * Streams now log syntax errors
5
8
  * Celluloid dependency updated
data/README.md CHANGED
@@ -1,6 +1,8 @@
1
1
  # RubyAMI [![Build Status](https://secure.travis-ci.org/adhearsion/ruby_ami.png?branch=master)](http://travis-ci.org/adhearsion/ruby_ami)
2
2
  RubyAMI is an AMI client library in Ruby and based on EventMachine with the sole purpose of providing an connection to the Asterisk Manager Interface. RubyAMI does not provide any features beyond connection management and protocol parsing. Actions are sent over the wire, and responses come back via callbacks. It's up to you to match these up into something useful. In this regard, RubyAMI is very similar to [Blather](https://github.com/sprsquish/blather) for XMPP or [Punchblock](https://github.com/adhearsion/punchblock), the Ruby 3PCC library. In fact, Punchblock uses RubyAMI under the covers for its Asterisk implementation, including an implementation of AsyncAGI.
3
3
 
4
+ NB: If you're looking to develop an application on Asterisk, you should take a look at the [Adhearsion](http://adhearsion.com) framework first. This library is much lower level.
5
+
4
6
  ## Installation
5
7
  gem install ruby_ami
6
8
 
@@ -15,7 +17,8 @@ client = Client.new :username => 'test',
15
17
  :host => '127.0.0.1',
16
18
  :port => 5038,
17
19
  :event_handler => lambda { |e| handle_event e },
18
- :logger => Logger.new('ruby_ami.log')
20
+ :logger => Logger.new(STDOUT),
21
+ :log_level => Logger::DEBUG
19
22
 
20
23
  def handle_event(event)
21
24
  case event.name
@@ -180,7 +180,7 @@ module RubyAMI
180
180
  end
181
181
 
182
182
  def new_stream(callback)
183
- Stream.new @options[:host], @options[:port], callback
183
+ Stream.new @options[:host], @options[:port], callback, logger
184
184
  end
185
185
 
186
186
  def logger
@@ -13,9 +13,11 @@ module RubyAMI
13
13
 
14
14
  include Celluloid::IO
15
15
 
16
- def initialize(host, port, event_callback)
16
+ attr_reader :logger
17
+
18
+ def initialize(host, port, event_callback, logger = Logger)
17
19
  super()
18
- @host, @port, @event_callback = host, port, event_callback
20
+ @host, @port, @event_callback, @logger = host, port, event_callback, logger
19
21
  logger.debug "Starting up..."
20
22
  @lexer = Lexer.new self
21
23
  end
@@ -72,9 +74,5 @@ module RubyAMI
72
74
  @state = :stopped
73
75
  @event_callback.call Disconnected.new
74
76
  end
75
-
76
- def logger
77
- Logger
78
- end
79
77
  end
80
78
  end
@@ -1,3 +1,3 @@
1
1
  module RubyAMI
2
- VERSION = "1.2.2"
2
+ VERSION = "1.2.3"
3
3
  end
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby_ami
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.2
4
+ version: 1.2.3
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: 2012-09-05 00:00:00.000000000 Z
12
+ date: 2012-09-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: celluloid-io
@@ -330,7 +330,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
330
330
  version: '0'
331
331
  segments:
332
332
  - 0
333
- hash: -4025771816081059304
333
+ hash: -814081533276479548
334
334
  required_rubygems_version: !ruby/object:Gem::Requirement
335
335
  none: false
336
336
  requirements:
@@ -339,7 +339,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
339
339
  version: '0'
340
340
  segments:
341
341
  - 0
342
- hash: -4025771816081059304
342
+ hash: -814081533276479548
343
343
  requirements: []
344
344
  rubyforge_project: ruby_ami
345
345
  rubygems_version: 1.8.23