gluez 0.2.1 → 0.3
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/gluez/context.rb +131 -0
- data/lib/gluez/resource.rb +209 -0
- data/lib/gluez/resources/bash.rb +11 -0
- data/lib/gluez/resources/bash_once.rb +10 -0
- data/lib/gluez/resources/dir.rb +14 -0
- data/lib/gluez/resources/disable.rb +8 -0
- data/lib/gluez/resources/enable.rb +8 -0
- data/lib/gluez/resources/file.rb +23 -0
- data/lib/gluez/resources/gem.rb +10 -0
- data/lib/gluez/resources/group.rb +10 -0
- data/lib/gluez/resources/link.rb +12 -0
- data/lib/gluez/resources/mount.rb +19 -0
- data/lib/gluez/resources/package.rb +8 -0
- data/lib/gluez/resources/path.rb +13 -0
- data/lib/gluez/resources/restart.rb +6 -0
- data/lib/gluez/resources/source.rb +22 -0
- data/lib/gluez/resources/start.rb +10 -0
- data/lib/gluez/resources/stop.rb +10 -0
- data/lib/gluez/resources/transfer.rb +51 -0
- data/lib/gluez/resources/umount.rb +8 -0
- data/lib/gluez/resources/user.rb +11 -0
- data/lib/gluez.rb +71 -154
- metadata +39 -36
- data/lib/gluez/erb/engine.rb +0 -19
- data/lib/gluez/erb/vars.rb +0 -19
- data/lib/gluez/ext/string.rb +0 -18
- data/lib/gluez/formatter.rb +0 -32
- data/lib/gluez/impl/linux.rb +0 -233
- data/lib/gluez/impl/mac.rb +0 -34
- data/lib/gluez/option_wrapper.rb +0 -24
data/lib/gluez/impl/mac.rb
DELETED
@@ -1,34 +0,0 @@
|
|
1
|
-
# module Gluez
|
2
|
-
# module Impl
|
3
|
-
# class Mac
|
4
|
-
# def self.steps(cfg, task, name, opts)
|
5
|
-
#
|
6
|
-
# setup = nil
|
7
|
-
# steps = []
|
8
|
-
#
|
9
|
-
# case task
|
10
|
-
#
|
11
|
-
# when :group
|
12
|
-
# steps << "$(/usr/bin/dscl . -list Groups | grep ^#{name}$ | wc -l) -eq 1"
|
13
|
-
# steps << "$(/usr/bin/dscl . -create /Groups/#{name} PrimaryGroupID #{opts[:gid]})"
|
14
|
-
#
|
15
|
-
# when :user
|
16
|
-
# steps << "$(/usr/bin/dscl . -list Users | grep ^#{name}$ | wc -l) -eq 1"
|
17
|
-
# steps << "$(/usr/bin/dscl . -create /Users/#{name} UniqueID #{opts[:uid]} PrimaryGroupID #{opts[:gid]} UserShell #{opts[:shell, "/bin/bash"]} NFSHomeDir /Users/#{name})"
|
18
|
-
#
|
19
|
-
# steps << "-d /Users/#{name}"
|
20
|
-
# steps << "mkdir /Users/#{name}"
|
21
|
-
#
|
22
|
-
# steps << "\"$(stat -L -f %Sg:%Su /Users/#{name})\" = \"#{name}:#{name}\""
|
23
|
-
# steps << "chown #{name}:#{name} /Users/#{name}"
|
24
|
-
#
|
25
|
-
# else
|
26
|
-
# raise "unsupported task: #{task}, name: #{name}, opts: #{opts.inspect}"
|
27
|
-
# end
|
28
|
-
#
|
29
|
-
#
|
30
|
-
# [name, setup, steps]
|
31
|
-
# end
|
32
|
-
# end
|
33
|
-
# end
|
34
|
-
# end
|
data/lib/gluez/option_wrapper.rb
DELETED
@@ -1,24 +0,0 @@
|
|
1
|
-
module Gluez
|
2
|
-
class OptionWrapper
|
3
|
-
def initialize(options)
|
4
|
-
@options = options
|
5
|
-
end
|
6
|
-
|
7
|
-
def key?(key)
|
8
|
-
@options.key?(key)
|
9
|
-
end
|
10
|
-
|
11
|
-
def [](name, default=nil)
|
12
|
-
value = @options[name]
|
13
|
-
if value
|
14
|
-
value
|
15
|
-
else
|
16
|
-
if default
|
17
|
-
default
|
18
|
-
else
|
19
|
-
raise "missing option: #{name}"
|
20
|
-
end
|
21
|
-
end
|
22
|
-
end
|
23
|
-
end
|
24
|
-
end
|