p4util 0.1.6 → 0.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/README.md +2 -0
- data/lib/commands/init/group_model.rb +59 -0
- data/lib/commands/init.rb +9 -3
- data/lib/p4util/version.rb +1 -1
- data/p4init/test_groups.rb +7 -0
- data/p4init/test_users.rb +7 -0
- metadata +4 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4fd37ebdc24b5bcfb77f66ddd30e5c91cfbfca5a
|
4
|
+
data.tar.gz: f201b07ddaa262063a9b0078b1ae884dea7814ee
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9214db3922784dc505ecce1a13bbca7e759ef0b67289872996a17db61a46e64d6bfa06ef35c7fc65cf50505dca7bc7f31000297234072a7d20ff6f161a7affbc
|
7
|
+
data.tar.gz: fbe5ec5af147dd85e44451cb331334b051319996d55a66605d388f8f224041a0181d89ef1119c3483a6618c11983c554d443a5bd2a5d67426ea90d72de7ede84
|
data/README.md
CHANGED
@@ -0,0 +1,59 @@
|
|
1
|
+
require 'commands/init/init_model'
|
2
|
+
|
3
|
+
module Commands
|
4
|
+
module Init
|
5
|
+
class GroupModel < InitModel
|
6
|
+
inheritable_attributes :group, :max_results, :max_scan_rows,
|
7
|
+
:max_lock_time, :password_timeout, :timeout,
|
8
|
+
:users, :subgroups, :owners
|
9
|
+
|
10
|
+
|
11
|
+
@group = nil
|
12
|
+
@max_results = nil
|
13
|
+
@max_scan_rows = nil
|
14
|
+
@max_lock_time = nil
|
15
|
+
@timeout = nil
|
16
|
+
@password_timeout = nil
|
17
|
+
@users = nil
|
18
|
+
@subgroups = nil
|
19
|
+
@owners = nil
|
20
|
+
|
21
|
+
def self.abstract
|
22
|
+
true
|
23
|
+
end
|
24
|
+
|
25
|
+
def initialize
|
26
|
+
@group = self.class.group
|
27
|
+
@max_results = self.class.max_results
|
28
|
+
@max_scan_rows = self.class.max_scan_rows
|
29
|
+
@timeout = self.class.timeout
|
30
|
+
@password_timeout = self.class.password_timeout
|
31
|
+
@users = self.class.users
|
32
|
+
@subgroups = self.class.subgroups
|
33
|
+
@owners = self.class.owners
|
34
|
+
end
|
35
|
+
|
36
|
+
def to_spec
|
37
|
+
spec = {
|
38
|
+
'Group' => @group
|
39
|
+
}
|
40
|
+
|
41
|
+
spec['MaxResults'] = @max_results unless @max_results.nil?
|
42
|
+
spec['MaxScanRows'] = @max_scan_rows unless @max_scan_rows.nil?
|
43
|
+
spec['MaxLockTime'] = @max_lock_time unless @max_lock_time.nil?
|
44
|
+
spec['Timeout'] = @timeout unless @timeout.nil?
|
45
|
+
spec['PasswordTimeout'] = @password_timeout unless @password_timeout.nil?
|
46
|
+
spec['Users'] = @users unless @users.nil?
|
47
|
+
spec['Subgroups'] = @subgroups unless @subgroups.nil?
|
48
|
+
spec['Owners'] = @owners unless @owners.nil?
|
49
|
+
|
50
|
+
spec
|
51
|
+
end
|
52
|
+
|
53
|
+
def execute(p4, models=nil, super_user=nil)
|
54
|
+
puts "group: #{to_spec}"
|
55
|
+
p4.save_group(to_spec)
|
56
|
+
end
|
57
|
+
end
|
58
|
+
end
|
59
|
+
end
|
data/lib/commands/init.rb
CHANGED
@@ -4,6 +4,7 @@ require 'commands/init/init_model'
|
|
4
4
|
require 'commands/init/changelist_model'
|
5
5
|
require 'commands/init/depot_model'
|
6
6
|
require 'commands/init/file_definition'
|
7
|
+
require 'commands/init/group_model'
|
7
8
|
require 'commands/init/system_settings_model'
|
8
9
|
require 'commands/init/user_model'
|
9
10
|
|
@@ -171,9 +172,14 @@ module Commands
|
|
171
172
|
def Commands.initialize_p4d(init_dir, p4port, auto)
|
172
173
|
# Go through our init_dir, and evaluate each script as if it were defined
|
173
174
|
# in the Commands::Init module.
|
174
|
-
|
175
|
-
|
176
|
-
|
175
|
+
if File.directory?(init_dir)
|
176
|
+
Dir.glob("#{init_dir}/**/*.rb") do |file|
|
177
|
+
contents = IO.read(file)
|
178
|
+
Commands::Init.class_eval(contents, file)
|
179
|
+
end
|
180
|
+
elsif File.file?(init_dir)
|
181
|
+
contents = IO.read(init_dir)
|
182
|
+
Commands::Init.class_eval(contents, init_dir)
|
177
183
|
end
|
178
184
|
|
179
185
|
# Note that nothing is actually done until this line. This allows classes
|
data/lib/p4util/version.rb
CHANGED
data/p4init/test_users.rb
CHANGED
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: p4util
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: '0.2'
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tristan Juricek
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-05-
|
11
|
+
date: 2015-05-26 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|
@@ -74,6 +74,7 @@ files:
|
|
74
74
|
- "./lib/commands/init/changelist_model.rb"
|
75
75
|
- "./lib/commands/init/depot_model.rb"
|
76
76
|
- "./lib/commands/init/file_definition.rb"
|
77
|
+
- "./lib/commands/init/group_model.rb"
|
77
78
|
- "./lib/commands/init/init_model.rb"
|
78
79
|
- "./lib/commands/init/p4_helpers.rb"
|
79
80
|
- "./lib/commands/init/system_settings_model.rb"
|
@@ -91,6 +92,7 @@ files:
|
|
91
92
|
- "./lib/random_util.rb"
|
92
93
|
- "./p4init/287.jpg"
|
93
94
|
- "./p4init/test_changelists.rb"
|
95
|
+
- "./p4init/test_groups.rb"
|
94
96
|
- "./p4init/test_system_settings.rb"
|
95
97
|
- "./p4init/test_users.rb"
|
96
98
|
- "./p4util.gemspec"
|