erb_asterisk 0.0.17 → 0.0.18
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 -1
- data/lib/erb_asterisk.rb +9 -3
- data/lib/erb_asterisk/arg_parser.rb +2 -0
- data/lib/erb_asterisk/version.rb +1 -1
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 81bcbad0f9e9a0ca9819eb6322729b9a22d5643c
|
4
|
+
data.tar.gz: 6ebe952f5326a7f274d5e1f1d93c7d65c3fbbbb0
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f513f06005122307deff63ef3fccb158b1b3405d4321e2c06f14ecb17a39cc83d07e7e2fe4ea2db40fb74f4c3cb378f4f7c6c50d8a037082598328f491a8852c
|
7
|
+
data.tar.gz: 29a7ae54ff55e40404246628c6df453d49478e901d5652ad631f82eba1eb0b55768f20afbe1a74b42cbb0873ebe51ed899c6d13b50ed2dbd3aa8a44e3d42a6cf
|
data/README.md
CHANGED
@@ -176,7 +176,7 @@ EXTERNAL_HOST = 'no-ip.some.host.eg'
|
|
176
176
|
### Command line arguments
|
177
177
|
|
178
178
|
```
|
179
|
-
usage:
|
179
|
+
usage: erb_asterisk [options] [asterisk_config_path]
|
180
180
|
-t, --templates set templates path (e.g.: ~/.erb_asterisk)
|
181
181
|
-v, --version print the version
|
182
182
|
-h, --help print this help
|
data/lib/erb_asterisk.rb
CHANGED
@@ -21,11 +21,12 @@ module ErbAsterisk
|
|
21
21
|
|
22
22
|
def execute(opts)
|
23
23
|
init_instance(opts)
|
24
|
-
load_project_file
|
25
24
|
|
26
|
-
root = asterisk_root
|
25
|
+
root = asterisk_root(opts)
|
27
26
|
@templates_path = "#{root}templates".freeze
|
28
27
|
|
28
|
+
load_project_file
|
29
|
+
|
29
30
|
render_files(root)
|
30
31
|
end
|
31
32
|
|
@@ -47,7 +48,12 @@ module ErbAsterisk
|
|
47
48
|
@user_templates = File.expand_path("#{user_path}/templates")
|
48
49
|
end
|
49
50
|
|
50
|
-
def asterisk_root
|
51
|
+
def asterisk_root(opts)
|
52
|
+
if opts.arguments.any?
|
53
|
+
custom_root = File.expand_path("#{opts.arguments.first}/")
|
54
|
+
Dir.chdir(custom_root)
|
55
|
+
return custom_root
|
56
|
+
end
|
51
57
|
return './' if File.exist?(ERB_ASTERISK_CONF)
|
52
58
|
return ERB_ASTERISK_DIR if Dir.exist?(ERB_ASTERISK_DIR)
|
53
59
|
raise 'Asterisk configuration not found'
|
@@ -5,6 +5,8 @@ module ErbAsterisk
|
|
5
5
|
class ArgParser
|
6
6
|
def execute
|
7
7
|
Slop.parse do |o|
|
8
|
+
o.banner = 'usage: erb_asterisk [options] [asterisk_config_path]'
|
9
|
+
|
8
10
|
o.string '-t', '--templates',
|
9
11
|
'set templates path (e.g.: ~/.erb_asterisk)'
|
10
12
|
o.bool '-v', '--verbose', 'enable verbose mode'
|
data/lib/erb_asterisk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: erb_asterisk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.18
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Artem Baikuzin
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2017-
|
11
|
+
date: 2017-10-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: slop
|
@@ -141,7 +141,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
141
141
|
version: '0'
|
142
142
|
requirements: []
|
143
143
|
rubyforge_project:
|
144
|
-
rubygems_version: 2.6.
|
144
|
+
rubygems_version: 2.6.13
|
145
145
|
signing_key:
|
146
146
|
specification_version: 4
|
147
147
|
summary: Asterisk configuration with ERB
|