obelisk 0.2.4 → 0.2.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/obelisk.rb +5 -3
- data/lib/obelisk/version.rb +1 -1
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7e19232e251e92483db63c5f53f5233f61244e6a
|
4
|
+
data.tar.gz: 154d1d8edc71f655ac822b152ba29bf7d2f36213
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 6674fa7644ef8d921777c03b202f422bcdc9cc5b71d5418d272eee1d715d8517c09391e88d7ef03d080467f10ed93e0efb2234057ee68c0286e32dec1b788fc7
|
7
|
+
data.tar.gz: df3553de411898362c1277e57ac94df58750b866bfb014184c8838786df998621d4983699257de6d1be4d97b2fd0d6034972e28bb7346d1c2cd459a54eada3f5
|
data/lib/obelisk.rb
CHANGED
@@ -43,6 +43,7 @@ module Obelisk
|
|
43
43
|
$conf = {}
|
44
44
|
|
45
45
|
def self.make_erb_conf(params = {})
|
46
|
+
load_conf
|
46
47
|
params[:conf_dir] ||= $conf[:asterisk_conf_dir]
|
47
48
|
params[:force] ||= false
|
48
49
|
params[:restart] ||= false
|
@@ -50,7 +51,8 @@ module Obelisk
|
|
50
51
|
FileUtils.mkdir_p params[:conf_dir]
|
51
52
|
b = binding
|
52
53
|
up = false
|
53
|
-
|
54
|
+
all_users = get_ad_users
|
55
|
+
users = all_users.select{ |u| u[:secret] && u[:extension] }
|
54
56
|
Dir[File.expand_path "*.erb", $conf[:erb_file_dir]].each do |erb|
|
55
57
|
conf_file = File.expand_path File.basename(erb, ".erb"), params[:conf_dir]
|
56
58
|
File.open(conf_file, File.exists?(conf_file) ? "r+" : "w+") do |file|
|
@@ -64,7 +66,7 @@ module Obelisk
|
|
64
66
|
end
|
65
67
|
end
|
66
68
|
system $conf[:asterisk_restart_command] if up && params[:restart]
|
67
|
-
update_rails_db
|
69
|
+
update_rails_db all_users if up && params[:updb]
|
68
70
|
up
|
69
71
|
end
|
70
72
|
|
@@ -89,7 +91,7 @@ module Obelisk
|
|
89
91
|
}
|
90
92
|
}
|
91
93
|
ActiveDirectory::Base.setup(settings)
|
92
|
-
ActiveDirectory::User.find(:all).
|
94
|
+
ActiveDirectory::User.find(:all).map do |u|
|
93
95
|
k = $conf[:mapping].values
|
94
96
|
v = $conf[:mapping].keys.map { |attr| u.valid_attribute?(attr) ? u.send(attr).force_encoding("UTF-8") : $conf[:defaults][attr] }
|
95
97
|
Hash[k.zip v]
|
data/lib/obelisk/version.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: obelisk
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- goredar
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-02-
|
11
|
+
date: 2015-02-03 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|