cfa_grub2 0.3.1 → 0.3.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/cfa/grub2/default.rb +6 -6
- data/lib/cfa/grub2/device_map.rb +1 -1
- data/lib/cfa/grub2/grub_cfg.rb +1 -1
- data/lib/cfa/grub2/install_device.rb +4 -1
- metadata +4 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: c740cd6445c8b6ccca3045ccfb17147e689040b6
|
4
|
+
data.tar.gz: 2caa8d2333dffd4bab18fbac4788c4231a9fc4e6
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: a988fd34899a6ab9d53b09fbacbebc6e2d4d23d3011426ed7dc01758b195739eef47433384b37fda57b2afd766c28252990802248cdf146b8a8901ed3291a7a3
|
7
|
+
data.tar.gz: 9b18bd44dd00342a126e22ad44468354b35f0d02e1e15aafe536544f599d1bf42e9cda1b2f0181954cc4f8ee87dbc90100601073caf1d60cdc0d014197890dd6
|
data/lib/cfa/grub2/default.rb
CHANGED
@@ -24,7 +24,7 @@ module CFA
|
|
24
24
|
)
|
25
25
|
|
26
26
|
PARSER = AugeasParser.new("sysconfig.lns")
|
27
|
-
PATH = "/etc/default/grub"
|
27
|
+
PATH = "/etc/default/grub".freeze
|
28
28
|
|
29
29
|
def initialize(file_handler: nil)
|
30
30
|
super(PARSER, PATH, file_handler: file_handler)
|
@@ -109,7 +109,7 @@ module CFA
|
|
109
109
|
end
|
110
110
|
end
|
111
111
|
|
112
|
-
VALID_TERMINAL_OPTIONS = [:serial, :console, :gfxterm]
|
112
|
+
VALID_TERMINAL_OPTIONS = [:serial, :console, :gfxterm].freeze
|
113
113
|
def terminal=(value)
|
114
114
|
if !VALID_TERMINAL_OPTIONS.include?(value)
|
115
115
|
raise ArgumentError, "invalid value #{value.inspect}"
|
@@ -168,8 +168,8 @@ module CFA
|
|
168
168
|
#
|
169
169
|
def parameter(key)
|
170
170
|
values = @tree.data
|
171
|
-
|
172
|
-
|
171
|
+
.select { |e| e[:key] == key }
|
172
|
+
.map { |e| e[:value] }
|
173
173
|
|
174
174
|
return false if values.empty?
|
175
175
|
return values if values.size > 1
|
@@ -202,8 +202,8 @@ module CFA
|
|
202
202
|
def initialize(line)
|
203
203
|
line ||= ""
|
204
204
|
pairs = line.split(/\s/)
|
205
|
-
|
206
|
-
|
205
|
+
.reject(&:empty?)
|
206
|
+
.map { |e| e.split("=", 2) }
|
207
207
|
|
208
208
|
@data = pairs.map do |k, v|
|
209
209
|
{
|
data/lib/cfa/grub2/device_map.rb
CHANGED
@@ -17,7 +17,7 @@ module CFA
|
|
17
17
|
# device.
|
18
18
|
class DeviceMap < BaseModel
|
19
19
|
PARSER = AugeasParser.new("device_map.lns")
|
20
|
-
PATH = "/etc/grub2/device.map"
|
20
|
+
PATH = "/etc/grub2/device.map".freeze
|
21
21
|
|
22
22
|
def initialize(file_handler: nil)
|
23
23
|
super(PARSER, PATH, file_handler: file_handler)
|
data/lib/cfa/grub2/grub_cfg.rb
CHANGED
@@ -14,6 +14,9 @@ module CFA
|
|
14
14
|
|
15
15
|
# gets list of devices and create file content from it
|
16
16
|
def self.serialize(data)
|
17
|
+
# do not modify original data as serialize is not end of world
|
18
|
+
data = data.dup
|
19
|
+
|
17
20
|
activate = data.delete("activate")
|
18
21
|
generic_mbr = data.delete("generic_mbr")
|
19
22
|
|
@@ -33,7 +36,7 @@ module CFA
|
|
33
36
|
|
34
37
|
# Model representing configuration in file /etc/default/grub_installdevice
|
35
38
|
class InstallDevice < BaseModel
|
36
|
-
PATH = "/etc/default/grub_installdevice"
|
39
|
+
PATH = "/etc/default/grub_installdevice".freeze
|
37
40
|
|
38
41
|
def initialize(file_handler: nil)
|
39
42
|
super(InstallDeviceParser, PATH, file_handler: file_handler)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cfa_grub2
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.3.
|
4
|
+
version: 0.3.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Josef Reidinger
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2016-
|
11
|
+
date: 2016-03-24 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: cfa
|
@@ -37,7 +37,8 @@ files:
|
|
37
37
|
- lib/cfa/grub2/grub_cfg.rb
|
38
38
|
- lib/cfa/grub2/install_device.rb
|
39
39
|
homepage: http://github.com/config-files-api/config_files_api_grub2
|
40
|
-
licenses:
|
40
|
+
licenses:
|
41
|
+
- LGPL-3.0
|
41
42
|
metadata: {}
|
42
43
|
post_install_message:
|
43
44
|
rdoc_options: []
|