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 CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: dcf222f8fb3da4ac9c3d4d21b0e09279b1b8fbe7
4
- data.tar.gz: 38e54fa9c9f08d7c2a403544577013c2e343147d
3
+ metadata.gz: 7e19232e251e92483db63c5f53f5233f61244e6a
4
+ data.tar.gz: 154d1d8edc71f655ac822b152ba29bf7d2f36213
5
5
  SHA512:
6
- metadata.gz: 77afe9c808414caac1087bc3550d9ff535ddd2e10c3e91b0ff4a290575598a9f80ad55105c985925f4b88bca886a0226694a2bc866e5533212cc6977ff3b9983
7
- data.tar.gz: 76505380856b9e2560abb0d01cfd3a98476393e7a1fa160d1b19dee7ab0eb5d5d2c13e86991c7e13b3075d8045a716ffac40ea5e238f73d1bd5b9e61a27fadff
6
+ metadata.gz: 6674fa7644ef8d921777c03b202f422bcdc9cc5b71d5418d272eee1d715d8517c09391e88d7ef03d080467f10ed93e0efb2234057ee68c0286e32dec1b788fc7
7
+ data.tar.gz: df3553de411898362c1277e57ac94df58750b866bfb014184c8838786df998621d4983699257de6d1be4d97b2fd0d6034972e28bb7346d1c2cd459a54eada3f5
@@ -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
- users = get_ad_users
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 users if up && params[:updb]
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).select{ |u| u.valid_attribute? :info }.map do |u|
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]
@@ -1,3 +1,3 @@
1
1
  module Obelisk
2
- VERSION = "0.2.4"
2
+ VERSION = "0.2.5"
3
3
  end
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
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-02 00:00:00.000000000 Z
11
+ date: 2015-02-03 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler