producer-stdlib 0.0.4 → 0.0.5
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/producer/stdlib.rb +4 -0
- data/lib/producer/stdlib/freebsd.rb +12 -37
- data/lib/producer/stdlib/version.rb +1 -1
- data/producer-stdlib.gemspec +1 -1
- metadata +5 -5
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 72c4348461bc2a8c12dcd47ee307e8604cc50fa1
|
4
|
+
data.tar.gz: a3ede50542093af7e758db40fbd03404f2d426f5
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 65092fab528abd92d9dda816f860d0a6659bb50c2d649ac55d4b3c163c41c24b9a17068978fa728ce5400b2bb29868ef5450ed663b2a5fc5488fd68e0f6b5d63
|
7
|
+
data.tar.gz: 0dd96d62208c5cc855a39d3c623bbec20f3e2cb28795a3c93f2637f16b226376051ab654416f93fde9233f9f112dade25e66e224a54b2a0ef62083423bf2fffa
|
data/lib/producer/stdlib.rb
CHANGED
@@ -10,14 +10,24 @@ module Producer
|
|
10
10
|
MAKE_CONF_PATH = '/etc/make.conf'.freeze
|
11
11
|
|
12
12
|
|
13
|
-
STDLib.
|
13
|
+
STDLib.compose_macro :loader_conf, :file_write_once, LOADER_CONF_PATH
|
14
|
+
|
15
|
+
STDLib.compose_macro :rc_conf, :file_write_once, RC_CONF_PATH
|
16
|
+
|
17
|
+
STDLib.compose_macro :sysctl_conf, :file_write_once, SYSCTL_CONF_PATH
|
18
|
+
|
19
|
+
STDLib.compose_macro :periodic_conf, :file_write_once, PERIODIC_CONF_PATH
|
20
|
+
|
21
|
+
STDLib.compose_macro :make_conf, :file_write_once, MAKE_CONF_PATH
|
22
|
+
|
23
|
+
STDLib.define_test :rc_enabled? do |service|
|
14
24
|
sh "service #{service} enabled > /dev/null"
|
15
25
|
end
|
16
26
|
|
17
27
|
STDLib.define_macro :rc_enable do |service|
|
18
28
|
condition { no_rc_enabled? service }
|
19
29
|
|
20
|
-
file_append RC_CONF_PATH, %{\n#{service}_enable
|
30
|
+
file_append RC_CONF_PATH, %{\n#{service}_enable="YES"\n}
|
21
31
|
sh "service #{service} start"
|
22
32
|
end
|
23
33
|
|
@@ -29,41 +39,6 @@ module Producer
|
|
29
39
|
file_replace_content RC_CONF_PATH, /^hostname=.+$/, rc_conf_value
|
30
40
|
end
|
31
41
|
|
32
|
-
# FIXME: refactor with file_add macro?
|
33
|
-
STDLib.define_macro :loader_conf do |conf|
|
34
|
-
condition { no_file_contains LOADER_CONF_PATH, conf }
|
35
|
-
|
36
|
-
file_append LOADER_CONF_PATH, "\n%s" % conf
|
37
|
-
end
|
38
|
-
|
39
|
-
# FIXME: refactor with file_add macro?
|
40
|
-
STDLib.define_macro :rc_conf do |conf|
|
41
|
-
condition { no_file_contains RC_CONF_PATH, conf }
|
42
|
-
|
43
|
-
file_append RC_CONF_PATH, "\n%s" % conf
|
44
|
-
end
|
45
|
-
|
46
|
-
# FIXME: refactor with file_add macro?
|
47
|
-
STDLib.define_macro :sysctl_conf do |conf|
|
48
|
-
condition { no_file_contains SYSCTL_CONF_PATH, conf }
|
49
|
-
|
50
|
-
file_append SYSCTL_CONF_PATH, "\n%s" % conf
|
51
|
-
end
|
52
|
-
|
53
|
-
# FIXME: refactor with file_add macro?
|
54
|
-
STDLib.define_macro :periodic_conf do |conf|
|
55
|
-
condition { no_file_contains PERIODIC_CONF_PATH, conf }
|
56
|
-
|
57
|
-
file_append PERIODIC_CONF_PATH, "\n%s" % conf
|
58
|
-
end
|
59
|
-
|
60
|
-
# FIXME: refactor with file_add macro?
|
61
|
-
STDLib.define_macro :ports_config do |config|
|
62
|
-
condition { no_file_contains MAKE_CONF_PATH, config }
|
63
|
-
|
64
|
-
file_write MAKE_CONF_PATH, config
|
65
|
-
end
|
66
|
-
|
67
42
|
STDLib.define_macro :chsh do |shell|
|
68
43
|
condition { no_env? :shell, shell }
|
69
44
|
|
data/producer-stdlib.gemspec
CHANGED
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: producer-stdlib
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.5
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Thibault Jouan
|
@@ -16,20 +16,20 @@ dependencies:
|
|
16
16
|
requirements:
|
17
17
|
- - "~>"
|
18
18
|
- !ruby/object:Gem::Version
|
19
|
-
version: '0.
|
19
|
+
version: '0.3'
|
20
20
|
- - ">="
|
21
21
|
- !ruby/object:Gem::Version
|
22
|
-
version: 0.2
|
22
|
+
version: 0.3.2
|
23
23
|
type: :runtime
|
24
24
|
prerelease: false
|
25
25
|
version_requirements: !ruby/object:Gem::Requirement
|
26
26
|
requirements:
|
27
27
|
- - "~>"
|
28
28
|
- !ruby/object:Gem::Version
|
29
|
-
version: '0.
|
29
|
+
version: '0.3'
|
30
30
|
- - ">="
|
31
31
|
- !ruby/object:Gem::Version
|
32
|
-
version: 0.2
|
32
|
+
version: 0.3.2
|
33
33
|
description: |
|
34
34
|
Standard library for producer (gem: producer-core).
|
35
35
|
email: tj@a13.fr
|