asterisk_manager 0.2.0 → 0.2.1

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: 28c86c4ef2ed94a4023c9fe1a1c5245c1dd6444d
4
- data.tar.gz: 212000fd410995fc4570635b52bcb9170e3adec9
3
+ metadata.gz: 8a825fbbc9688e754bd5c71f5d08c3f884d86493
4
+ data.tar.gz: bff903f44c29bfa85f6a953d31deb994768b1147
5
5
  SHA512:
6
- metadata.gz: ed23e41f58af140006c6ad8b4362ba092f7b05f6db56aa096cc63346510637a01dc61134ef741edd40257ef9b6508362ce5b0c25bf8fc0969e5bc3e883e87fea
7
- data.tar.gz: de51250b37c273f3bc9778959e2ac5ac44b71f79feb04417254570844ca65e0f208c8f0b14255661e40d410f0953a426ab4382d0bdc246beeac28a96005c9c91
6
+ metadata.gz: fef843db972fda8cc6dc2af48e9351c326a4624c4cccf6f1236d3ffc3a300040a9df32b92b9226adfa5e306b91310084d07b63ef3bf85c974535812345d649fe
7
+ data.tar.gz: e4482ff2fc59e58b6ead5368cbdd4c710c2af358f45567de18403348c5707b9a3a232fdf5a336c397af36b04fa461e00a456056230d5abb267211e9837019c2b
data/README.md CHANGED
@@ -4,6 +4,7 @@
4
4
  [![Code Climate](https://codeclimate.com/github/kieranj/asterisk_manager/badges/gpa.svg)](https://codeclimate.com/github/kieranj/asterisk_manager)
5
5
  [![Coverage Status](https://coveralls.io/repos/kieranj/asterisk_manager/badge.png)](https://coveralls.io/r/kieranj/asterisk_manager)
6
6
  [![Dependency Status](https://gemnasium.com/kieranj/asterisk_manager.svg)](https://gemnasium.com/kieranj/asterisk_manager)
7
+ [![Gem Version](https://badge.fury.io/rb/asterisk_manager.svg)](http://badge.fury.io/rb/asterisk_manager)
7
8
 
8
9
  ## Overview
9
10
 
@@ -78,6 +78,20 @@ module AsteriskManager
78
78
  }
79
79
  end
80
80
 
81
+ # Stores the given value for the key in the Asterisk database
82
+ #
83
+ # <tt>family</tt>:: Your Asterisk device.
84
+ # <tt>key</tt>:: Your Asterisk device.
85
+ # <tt>value</tt>:: The number to dial.
86
+
87
+ def dbput(family, key, value)
88
+ send_action "DBPut", {
89
+ :family => family,
90
+ :key => key,
91
+ :val => value
92
+ }
93
+ end
94
+
81
95
  protected
82
96
 
83
97
  # <tt>username</tt>:: Asterisk manager username.
@@ -1,3 +1,3 @@
1
1
  module AsteriskManager
2
- VERSION = '0.2.0'
2
+ VERSION = '0.2.1'
3
3
  end
@@ -63,4 +63,17 @@ describe AsteriskManager::Client do
63
63
  end
64
64
  end
65
65
 
66
+ describe 'dbput' do
67
+ let(:socket) { instance_double('TCPSocket', print: true, close: true) }
68
+
69
+ before do
70
+ allow(TCPSocket).to receive(:new).and_return(socket)
71
+ end
72
+
73
+ it 'sends a dbput command' do
74
+ expect(socket).to receive(:print).with("Action: DBPut\r\nFamily: diverts\r\nKey: 0160\r\nVal: 299\r\n\r\n")
75
+ AsteriskManager::Client.start('127.0.0.1', 'tester', 'secret') { |asterisk| asterisk.dbput('diverts', '0160', '299') }
76
+ end
77
+ end
78
+
66
79
  end
@@ -4,5 +4,8 @@ SimpleCov.start
4
4
  require 'coveralls'
5
5
  Coveralls.wear!
6
6
 
7
+ require "codeclimate-test-reporter"
8
+ CodeClimate::TestReporter.start
9
+
7
10
  require 'rspec'
8
11
  require 'asterisk_manager'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: asterisk_manager
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.2.0
4
+ version: 0.2.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Kieran Johnson
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2014-09-09 00:00:00.000000000 Z
11
+ date: 2014-09-11 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: rake
@@ -136,6 +136,20 @@ dependencies:
136
136
  - - ">="
137
137
  - !ruby/object:Gem::Version
138
138
  version: '0'
139
+ - !ruby/object:Gem::Dependency
140
+ name: codeclimate-test-reporter
141
+ requirement: !ruby/object:Gem::Requirement
142
+ requirements:
143
+ - - ">="
144
+ - !ruby/object:Gem::Version
145
+ version: '0'
146
+ type: :development
147
+ prerelease: false
148
+ version_requirements: !ruby/object:Gem::Requirement
149
+ requirements:
150
+ - - ">="
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
139
153
  description:
140
154
  email:
141
155
  - hello@invisiblelines.com