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 +4 -4
- data/README.md +1 -0
- data/lib/asterisk_manager/client.rb +14 -0
- data/lib/asterisk_manager/version.rb +1 -1
- data/spec/asterisk_manager/client_spec.rb +13 -0
- data/spec/spec_helper.rb +3 -0
- metadata +16 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 8a825fbbc9688e754bd5c71f5d08c3f884d86493
|
4
|
+
data.tar.gz: bff903f44c29bfa85f6a953d31deb994768b1147
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
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.
|
@@ -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
|
data/spec/spec_helper.rb
CHANGED
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.
|
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-
|
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
|