opensips-pi 0.0.4 → 0.0.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -0,0 +1,15 @@
1
+ ---
2
+ !binary "U0hBMQ==":
3
+ metadata.gz: !binary |-
4
+ MzBhOTQ1ZjJjOTUwYjYwMzAwYTM4MDE2YjZlNzcyNjQ4Mjc0ZDg5Nw==
5
+ data.tar.gz: !binary |-
6
+ YmNkZmI2MWQyMDU0ZjNlMTRiZDkzMTZkZDk3NDNmN2VhNGQzMzY2ZA==
7
+ !binary "U0hBNTEy":
8
+ metadata.gz: !binary |-
9
+ MjRjYTQyOTQ1NTBhMjA5ZGY0ZjIyZDVhNjUzZmQ5OTg1YmZmNmYzNTE4ZTUy
10
+ YTE5YWNmZjU1ODJlZDEyMjE2ZDA4MmU3NjVjMDhmZjEzOTkwZjEyYjVhODUz
11
+ NDY0N2NmYWUwNWE3ZDI1ZmQxZmY4MmZkYTkxYTQwODM0NDBiZDA=
12
+ data.tar.gz: !binary |-
13
+ MGU2ZGI3Nzg3Mzc5Y2M4MDljMjMxMTE0Zjg5OTEyYWVjN2YwNTU4ODI4YWJl
14
+ NTVkNjBjZTU3ZTFkYjk2NWVhZTAyOTY5MDQ0OGZmYWZhYzc4YTliMGFhZDA1
15
+ MTE5OTg1M2I4NDBlNzdhMjY5NjlhMTA3OGY3MDY2ZmU3YzY5NDM=
@@ -8,30 +8,63 @@ module Opensips
8
8
  @@logger = nil
9
9
  @@bin = nil
10
10
 
11
+ # Returns the OpenSIPS control tool, that is "opensipsctl" by default.
12
+ # You can customize this with {.bin=}.
13
+ #
14
+ # @return [String]
11
15
  def self.bin
12
16
  @@bin || "opensipsctl"
13
17
  end
14
18
 
19
+ # Customize the OpenSIPS control tool. See {.bin} for more information.
20
+ #
21
+ # @example
22
+ # Opensips::Pi.bin = "/usr/sbin/opensipsctl"
23
+ # Opensips::Pi.bin #=> "/usr/sbin/opensipsctl"
24
+ # @param cmd [String] Path to OpenSIPS control tool.
15
25
  def self.bin=(cmd)
16
26
  @@bin = cmd
17
27
  end
18
28
 
29
+ # Returns an instance of Ruby's {http://www.ruby-doc.org/stdlib-1.9.3/libdoc/logger/rdoc/Logger.html Logger} (by default)
30
+ # or a logger set with {.logger=}.
31
+ #
32
+ # @return [Logger]
19
33
  def self.logger
20
34
  @@logger ||= Logger.new(STDOUT)
21
35
  end
22
36
 
37
+ # Customize the logger. See {.logger} for more information.
38
+ #
39
+ # @example
40
+ # Opensips::Pi.logger = Rails.logger
41
+ # @param [Logger]
23
42
  def self.logger=(klass)
24
43
  @@logger = klass
25
44
  end
26
45
 
46
+ # Add a new OpenSIPS user.
47
+ #
48
+ # @param user [String]
49
+ # @param pass [String]
50
+ # @param domain [String]
27
51
  def self.add(user, pass, domain=nil)
28
52
  call("#{bin} add #{identifier(user,domain).shellescape} #{pass.shellescape}")
29
53
  end
30
54
 
55
+ # Remove an user from OpenSIPS.
56
+ #
57
+ # @param user [String]
58
+ # @param domain [String]
31
59
  def self.remove(user, domain=nil)
32
60
  call("#{bin} rm #{identifier(user,domain).shellescape}")
33
61
  end
34
62
 
63
+ # Change user's password.
64
+ #
65
+ # @param user [String]
66
+ # @param pass [String] New password
67
+ # @param domain [String]
35
68
  def self.password(user, pass, domain=nil)
36
69
  call("#{bin} passwd #{identifier(user,domain).shellescape} #{pass.shellescape}")
37
70
  end
@@ -1,5 +1,5 @@
1
1
  module Opensips
2
2
  module Pi
3
- VERSION = "0.0.4"
3
+ VERSION = "0.0.5"
4
4
  end
5
5
  end
metadata CHANGED
@@ -1,8 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: opensips-pi
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.4
5
- prerelease:
4
+ version: 0.0.5
6
5
  platform: ruby
7
6
  authors:
8
7
  - Lenon Marcel
@@ -15,7 +14,6 @@ dependencies:
15
14
  - !ruby/object:Gem::Dependency
16
15
  name: rspec
17
16
  requirement: !ruby/object:Gem::Requirement
18
- none: false
19
17
  requirements:
20
18
  - - ~>
21
19
  - !ruby/object:Gem::Version
@@ -23,7 +21,6 @@ dependencies:
23
21
  type: :development
24
22
  prerelease: false
25
23
  version_requirements: !ruby/object:Gem::Requirement
26
- none: false
27
24
  requirements:
28
25
  - - ~>
29
26
  - !ruby/object:Gem::Version
@@ -51,29 +48,29 @@ files:
51
48
  homepage: https://github.com/locaweb/opensips-pi
52
49
  licenses:
53
50
  - MIT
51
+ metadata: {}
54
52
  post_install_message:
55
53
  rdoc_options: []
56
54
  require_paths:
57
55
  - lib
58
56
  required_ruby_version: !ruby/object:Gem::Requirement
59
- none: false
60
57
  requirements:
61
58
  - - ! '>='
62
59
  - !ruby/object:Gem::Version
63
60
  version: '0'
64
61
  required_rubygems_version: !ruby/object:Gem::Requirement
65
- none: false
66
62
  requirements:
67
63
  - - ! '>='
68
64
  - !ruby/object:Gem::Version
69
65
  version: '0'
70
66
  requirements: []
71
67
  rubyforge_project:
72
- rubygems_version: 1.8.24
68
+ rubygems_version: 2.0.2
73
69
  signing_key:
74
- specification_version: 3
70
+ specification_version: 4
75
71
  summary: Opensips::Pi is an OpenSIPS Provisioning Interface for Ruby.
76
72
  test_files:
77
73
  - spec/opensips_pi_spec.rb
78
74
  - spec/spec_helper.rb
79
75
  - spec/support/shared_examples.rb
76
+ has_rdoc: