textutils 0.6.4 → 0.6.5

Sign up to get free protection for your applications and to get access to all the features.
@@ -46,6 +46,22 @@ class HashReaderV2
46
46
  WorldDb::Models::Prop.create_from_fixture!( name, path )
47
47
  end
48
48
 
49
+
50
+ def each_typed
51
+ path = "#{include_path}/#{name_real_path}.yml"
52
+ reader = HashReader.new( path )
53
+
54
+ logger.info "parsing data '#{name}' (#{path})..."
55
+
56
+ reader.each_typed do |key, value|
57
+ yield( key, value )
58
+ end
59
+
60
+ ## fix: move Prop table to props gem - why? why not??
61
+ WorldDb::Models::Prop.create_from_fixture!( name, path )
62
+ end
63
+
64
+
49
65
  end # class HashReaderV2
50
66
 
51
67
 
@@ -87,7 +103,7 @@ class HashReader
87
103
  ## nb: escape only if key e.g. no: or "free standing" value on its own line e.g.
88
104
  ## no: no
89
105
 
90
- text = text.gsub( /^([ ]*)(ON|On|on|NO|No|no|N|n|Y|y)[ ]*:/ ) do |value|
106
+ text = text.gsub( /^([ ]*)(ON|On|on|OFF|Off|off|YES|Yes|yes|NO|No|no|Y|y|N|n)[ ]*:/ ) do |value|
91
107
  logger.warn "hash reader - found implicit bool (#{$1}#{$2}) for key; adding quotes to turn into string; see yaml.org/refcard.html (path=#{path})"
92
108
  # nb: preserve leading spaces for structure - might be significant
93
109
  "#{$1}'#{$2}':" # add quotes to turn it into a string (not bool e.g. true|false)
@@ -96,8 +112,10 @@ class HashReader
96
112
  ## nb: value must be freestanding (only allow optional eol comment)
97
113
  ## do not escape if part of string sequence e.g.
98
114
  ## key: nb,nn,no,se => nb,nn,'no',se -- avoid!!
115
+ #
116
+ # check: need we add true|false too???
99
117
 
100
- text = text.gsub( /:[ ]+(ON|On|on|NO|No|no|N|n|Y|y)[ ]*($| #.*$)/ ) do |value|
118
+ text = text.gsub( /:[ ]+(ON|On|on|OFF|Off|off|YES|Yes|yes|NO|No|no|Y|y|N|n)[ ]*($| #.*$)/ ) do |value|
101
119
  logger.warn "hash reader - found implicit bool (#{$1}) for value; adding quotes to turn into string; see yaml.org/refcard.html (path=#{path})"
102
120
  ": '#{$1}'" # add quotes to turn it into a string (not bool e.g. true|false)
103
121
  end
@@ -1,6 +1,6 @@
1
1
 
2
2
  module TextUtils
3
3
 
4
- VERSION = '0.6.4'
4
+ VERSION = '0.6.5'
5
5
 
6
6
  end # module TextUtils
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: textutils
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.4
4
+ version: 0.6.5
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2013-05-20 00:00:00.000000000 Z
12
+ date: 2013-06-24 00:00:00.000000000Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logutils
16
- requirement: &83222360 !ruby/object:Gem::Requirement
16
+ requirement: &18184884 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,29 +21,29 @@ dependencies:
21
21
  version: '0.5'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *83222360
24
+ version_requirements: *18184884
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &83222140 !ruby/object:Gem::Requirement
27
+ requirement: &18183684 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
31
31
  - !ruby/object:Gem::Version
32
- version: '3.10'
32
+ version: '4.0'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *83222140
35
+ version_requirements: *18183684
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &83221920 !ruby/object:Gem::Requirement
38
+ requirement: &18183096 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
42
42
  - !ruby/object:Gem::Version
43
- version: '3.3'
43
+ version: '3.6'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *83221920
46
+ version_requirements: *18183096
47
47
  description: textutils - Text Filters, Helpers, Readers and More
48
48
  email: webslideshow@googlegroups.com
49
49
  executables: []
@@ -98,7 +98,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
98
98
  version: '0'
99
99
  requirements: []
100
100
  rubyforge_project: textutils
101
- rubygems_version: 1.8.17
101
+ rubygems_version: 1.7.2
102
102
  signing_key:
103
103
  specification_version: 3
104
104
  summary: textutils - Text Filters, Helpers, Readers and More