textutils 0.6.2 → 0.6.3

Sign up to get free protection for your applications and to get access to all the features.
@@ -12,13 +12,28 @@ class HashReaderV2
12
12
  def initialize( name, include_path )
13
13
  @name = name
14
14
  @include_path = include_path
15
+
16
+ # map name to name_real_path
17
+ # name might include !/ for virtual path (gets cut off)
18
+ # e.g. at-austria!/w-wien/beers becomse w-wien/beers
19
+
20
+ pos = @name.index( '!/')
21
+ if pos.nil?
22
+ @name_real_path = @name # not found; real path is the same as name
23
+ else
24
+ # cut off everything until !/ e.g.
25
+ # at-austria!/w-wien/beers becomes
26
+ # w-wien/beers
27
+ @name_real_path = @name[ (pos+2)..-1 ]
28
+ end
15
29
  end
16
30
 
17
31
  attr_reader :name
32
+ attr_reader :name_real_path
18
33
  attr_reader :include_path
19
34
 
20
35
  def each
21
- path = "#{include_path}/#{name}.yml"
36
+ path = "#{include_path}/#{name_real_path}.yml"
22
37
  reader = HashReader.new( path )
23
38
 
24
39
  logger.info "parsing data '#{name}' (#{path})..."
@@ -11,14 +11,29 @@ class ValuesReaderV2
11
11
  @name = name
12
12
  @include_path = include_path
13
13
  @more_attribs = more_attribs
14
+
15
+ # map name to name_real_path
16
+ # name might include !/ for virtual path (gets cut off)
17
+ # e.g. at-austria!/w-wien/beers becomse w-wien/beers
18
+
19
+ pos = @name.index( '!/')
20
+ if pos.nil?
21
+ @name_real_path = @name # not found; real path is the same as name
22
+ else
23
+ # cut off everything until !/ e.g.
24
+ # at-austria!/w-wien/beers becomes
25
+ # w-wien/beers
26
+ @name_real_path = @name[ (pos+2)..-1 ]
27
+ end
14
28
  end
15
29
 
16
30
  attr_reader :name
31
+ attr_reader :name_real_path
17
32
  attr_reader :include_path
18
33
  attr_reader :more_attribs
19
34
 
20
35
  def each_line
21
- path = "#{include_path}/#{name}.txt"
36
+ path = "#{include_path}/#{name_real_path}.txt"
22
37
  reader = ValuesReader.new( path, more_attribs )
23
38
 
24
39
  logger.info "parsing data '#{name}' (#{path})..."
@@ -1,6 +1,6 @@
1
1
 
2
2
  module TextUtils
3
3
 
4
- VERSION = '0.6.2'
4
+ VERSION = '0.6.3'
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.2
4
+ version: 0.6.3
5
5
  prerelease:
6
6
  platform: ruby
7
7
  authors:
@@ -13,7 +13,7 @@ date: 2013-05-20 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: logutils
16
- requirement: &77968240 !ruby/object:Gem::Requirement
16
+ requirement: &77627020 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ~>
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0.5'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *77968240
24
+ version_requirements: *77627020
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: rdoc
27
- requirement: &77968020 !ruby/object:Gem::Requirement
27
+ requirement: &77626800 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ~>
@@ -32,10 +32,10 @@ dependencies:
32
32
  version: '3.10'
33
33
  type: :development
34
34
  prerelease: false
35
- version_requirements: *77968020
35
+ version_requirements: *77626800
36
36
  - !ruby/object:Gem::Dependency
37
37
  name: hoe
38
- requirement: &77967800 !ruby/object:Gem::Requirement
38
+ requirement: &77626580 !ruby/object:Gem::Requirement
39
39
  none: false
40
40
  requirements:
41
41
  - - ~>
@@ -43,7 +43,7 @@ dependencies:
43
43
  version: '3.3'
44
44
  type: :development
45
45
  prerelease: false
46
- version_requirements: *77967800
46
+ version_requirements: *77626580
47
47
  description: textutils - Text Filters, Helpers, Readers and More
48
48
  email: webslideshow@googlegroups.com
49
49
  executables: []