cfa_grub2 0.6.1 → 0.6.2

Sign up to get free protection for your applications and to get access to all the features.
Files changed (3) hide show
  1. checksums.yaml +4 -4
  2. data/lib/cfa/grub2/grub_cfg.rb +5 -4
  3. metadata +2 -2
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 93cc348d9e1a1dd06316140467707b47da506f72
4
- data.tar.gz: 73f5149f68c8d695c80eb1f6c1a716f217c06095
3
+ metadata.gz: a60eb146945a4ae05b7e509bad70449658672833
4
+ data.tar.gz: 7e6156243b4226fa7d03854e438dabe9e8ed50f4
5
5
  SHA512:
6
- metadata.gz: c31fba86ee7ee5bd067b7de229e4e9c08f289ec8ded40565832d851605c1bcbbe67dd56a913bf0967d9a0267e26aa4c66247107b6cbc6ae14ee9ec7affd680a9
7
- data.tar.gz: dadb5317fe00cfa0bf8b3004c42b6262286f4af74ec947d0deaf02018b1d727d61ca874c6dbaff178451d48d662fd472928b943b926881e7fb87adf661a126a1
6
+ metadata.gz: ee49030b6c3d2607d41a7bbed201f971485931e295acad5a15073bb26527a5c91270ebef2546e49f6a64635d3673f63e08b6596244b92c4375fcb92afac866ad
7
+ data.tar.gz: 0aaa5993b75ccbe6ea8fe77698abaefff2b923f2d238d399bf8508f944dbb04f0a3a7aceab6024cd6fbd32c088673fc3ce1ba19f11b09f9e9b879233ad2297ec
@@ -12,13 +12,13 @@ module CFA
12
12
  # @private only internal parser
13
13
  class Parser
14
14
  def self.parse(string)
15
- submenu = ""
15
+ submenu = []
16
16
  string.lines.each_with_object([]) do |line, result|
17
17
  case line
18
18
  when /menuentry\s+'/ then result << parse_entry(line, submenu)
19
- when /^}\s*\n/ then submenu = ""
19
+ when /^\s*}\s*\n/ then submenu.pop
20
20
  when /submenu\s+'/
21
- submenu = line[/\s*submenu\s+'([^']+)'.*/, 1]
21
+ submenu.push(line[/\s*submenu\s+'([^']+)'.*/, 1])
22
22
  end
23
23
  end
24
24
  end
@@ -34,9 +34,10 @@ module CFA
34
34
 
35
35
  def self.parse_entry(line, submenu)
36
36
  entry = line[/\s*menuentry\s+'([^']+)'.*/, 1]
37
+ submenu.push(entry)
37
38
  {
38
39
  title: entry,
39
- path: submenu.empty? ? entry : "#{submenu}>#{entry}"
40
+ path: submenu.join(">")
40
41
  }
41
42
  end
42
43
  private_class_method :parse_entry
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.6.1
4
+ version: 0.6.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: 2017-03-29 00:00:00.000000000 Z
11
+ date: 2017-04-19 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: cfa