locale_assistant 0.9.1 → 0.9.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.
Files changed (2) hide show
  1. data/bin/locale_assistant.rb +18 -2
  2. metadata +4 -4
@@ -17,7 +17,7 @@ module LocaleAssistant
17
17
  IgnoreList = []
18
18
  end
19
19
  |
20
- exit
20
+ exit -1
21
21
  end
22
22
 
23
23
  def load_file(fn)
@@ -30,16 +30,32 @@ def load_file(fn)
30
30
 
31
31
  begin
32
32
  f = File.open(fn)
33
+ linecount = 0
33
34
  f.each_line do |line|
35
+ linecount += 1
34
36
  next if line.strip.size == 0 # remove empty lines
35
37
  next if line.lstrip =~ /^#/ # remove full line comments
36
38
 
37
- curr_spaces = (line.size - line.lstrip.size)
38
39
  key,val = line.strip.split(/:/,2)
40
+
41
+ if val.nil?
42
+ puts "ERROR line can not be parsed at #{fn}:#{linecount}"
43
+ f.close
44
+ exit -2
45
+ end
46
+
39
47
  val = val.strip
40
48
 
49
+ if val.strip[0..0] == '|'
50
+ puts "ERROR multiline is not supported at #{fn}:#{linecount}"
51
+ f.close
52
+ exit -3
53
+ end
54
+
41
55
  val = '' if val =~ /^#/ # remove comments from non leaf elements
42
56
 
57
+ curr_spaces = (line.size - line.lstrip.size)
58
+
43
59
  if curr_spaces > spaces
44
60
  indentstore.push(curr_spaces-spaces)
45
61
  spaces = curr_spaces
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: locale_assistant
3
3
  version: !ruby/object:Gem::Version
4
- hash: 57
4
+ hash: 63
5
5
  prerelease: false
6
6
  segments:
7
7
  - 0
8
8
  - 9
9
- - 1
10
- version: 0.9.1
9
+ - 2
10
+ version: 0.9.2
11
11
  platform: ruby
12
12
  authors:
13
13
  - jsaak
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-03-21 00:00:00 +01:00
18
+ date: 2013-03-25 00:00:00 +01:00
19
19
  default_executable:
20
20
  dependencies: []
21
21