ifmapper 1.2.4 → 1.2.5

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.
@@ -1,3 +1,5 @@
1
+ v1.2.4 Bug fixed for bad release of v1.2.3.
2
+
1
3
  v1.2.3 Fixed SVG Export of room number.
2
4
 
3
5
  v1.2.2 Removed some ruby1.9 warnings.
@@ -2,7 +2,7 @@ require "rubygems"
2
2
 
3
3
  spec = Gem::Specification.new do |spec|
4
4
  spec.name = "ifmapper"
5
- spec.version = '1.2.4'
5
+ spec.version = '1.2.5'
6
6
  spec.author = "Gonzalo Garramuno"
7
7
  spec.email = 'ggarra13@gmail.com'
8
8
  spec.homepage = 'http://www.rubyforge.org/projects/ifmapper/'
@@ -1,6 +1,8 @@
1
1
 
2
2
  begin
3
- require 'iconv'
3
+ if RUBY_VERSION.to_f < 1.9
4
+ require 'iconv'
5
+ end
4
6
  rescue LoadError
5
7
  $stderr.puts 'Iconv could not be loaded. Languages other than English will have problems'
6
8
  class Iconv
@@ -69,8 +69,14 @@ class IFMWriter
69
69
  return @elem[e] if @elem.has_key?(e)
70
70
 
71
71
  tag = t.dup
72
- utf = Iconv.new( 'iso-8859-1', 'utf-8' )
73
- tag = utf.iconv( tag )
72
+
73
+ if RUBY_VERSION < 1.9
74
+ utf = Iconv.new( 'iso-8859-1', 'utf-8' )
75
+ tag = utf.iconv( tag )
76
+ else
77
+ tag = tag.encode( 'utf-8', :invalid => :replace,
78
+ :undef => :replace, :replace => '' )
79
+ end
74
80
 
75
81
  tag.gsub!(/[\-\(\s,\.!'&"#$@\/\\\-\)]+/, '_')
76
82
  tag.gsub!(/__/, '') # remove reduntant __ repetitions
@@ -211,8 +211,13 @@ class Inform7Writer
211
211
  tag = str.dup
212
212
 
213
213
  # Take text from Unicode utf-8 to iso-8859-1
214
- utf = Iconv.new( 'iso-8859-1', 'utf-8' )
215
- tag = utf.iconv( tag )
214
+ if RUBY_VERSION < 1.9
215
+ utf = Iconv.new( 'iso-8859-1', 'utf-8' )
216
+ tag = utf.iconv( tag )
217
+ else
218
+ tag = tag.encode( 'utf-8', :invalid => :replace,
219
+ :undef => :replace, :replace => '' )
220
+ end
216
221
 
217
222
  # Remove redundant spaces
218
223
  tag.sub!(/^\s/, '')
@@ -316,9 +321,14 @@ class Inform7Writer
316
321
  def inform_quote(text)
317
322
  str = text.dup
318
323
 
319
- # Take text from Unicode utf-8 to iso-8859-1
320
- utf = Iconv.new( 'iso-8859-1', 'utf-8' )
321
- str = utf.iconv( str )
324
+ # Take text from Unicode utf-8 to iso-8859-1859-1
325
+ if RUBY_VERSION < 1.9
326
+ utf = Iconv.new( 'iso-8859-1', 'utf-8' )
327
+ str = utf.iconv( str )
328
+ else
329
+ str = str.encode( 'utf-8', :invalid => :replace,
330
+ :undef => :replace, :replace => '' )
331
+ end
322
332
 
323
333
  # Quote special characters
324
334
  # str.gsub!(/@/, '@@64')
@@ -35,8 +35,13 @@ class InformWriter
35
35
 
36
36
  def new_tag(elem, str)
37
37
  tag = str.dup
38
- utf = Iconv.new( 'iso-8859-1', 'utf-8' )
39
- tag = utf.iconv( tag )
38
+ if RUBY_VERSION < 1.9
39
+ utf = Iconv.new( 'iso-8859-1', 'utf-8' )
40
+ tag = utf.iconv( tag )
41
+ else
42
+ tag = tag.encode( 'utf-8', :invalid => :replace,
43
+ :undef => :replace, :replace => '' )
44
+ end
40
45
 
41
46
  # Invalid tag characters, replaced with _
42
47
  tag.gsub!(/[\s"'\/\\\-&#\,.:;!\?\n\(\)]/,'_')
@@ -107,8 +112,13 @@ class InformWriter
107
112
  str = text.dup
108
113
 
109
114
  # Take text from Unicode utf-8 to iso-8859-1
110
- utf = Iconv.new( 'iso-8859-1', 'utf-8' )
111
- str = utf.iconv( str )
115
+ if RUBY_VERSION < 1.9
116
+ utf = Iconv.new( 'iso-8859-1', 'utf-8' )
117
+ str = utf.iconv( str )
118
+ else
119
+ str = str.encode( 'utf-8', :invalid => :replace,
120
+ :undef => :replace, :replace => '' )
121
+ end
112
122
 
113
123
  # Quote special characters
114
124
  str.gsub!(/@/, '@@64')
@@ -1,4 +1,4 @@
1
-
1
+ s
2
2
 
3
3
  class TADSWriter
4
4
 
@@ -38,8 +38,13 @@ class TADSWriter
38
38
  tag = str.dup
39
39
 
40
40
  # Take text from Unicode utf-8 to iso-8859-1
41
- utf = Iconv.new( 'iso-8859-1', 'utf-8' )
42
- tag = utf.iconv( tag )
41
+ if RUBY_VERSION < 1.9
42
+ utf = Iconv.new( 'iso-8859-1', 'utf-8' )
43
+ tag = utf.iconv( tag )
44
+ else
45
+ tag = tag.encode( 'utf-8', :invalid => :replace,
46
+ :undef => :replace, :replace => '' )
47
+ end
43
48
 
44
49
  # Invalid tag characters, replaced with _
45
50
  tag.gsub!(/[\s"'\/\\\-&#\,.:;!\?\n\(\)]/,'_')
@@ -115,8 +120,13 @@ class TADSWriter
115
120
  str = text.dup
116
121
 
117
122
  # Take text from Unicode utf-8 to iso-8859-1
118
- utf = Iconv.new( 'iso-8859-1', 'utf-8' )
119
- str = utf.iconv( str )
123
+ if RUBY_VERSION < 1.9
124
+ utf = Iconv.new( 'iso-8859-1', 'utf-8' )
125
+ str = utf.iconv( str )
126
+ else
127
+ str = str.encode( 'utf-8', :invalid => :replace,
128
+ :undef => :replace, :replace => '' )
129
+ end
120
130
 
121
131
  # Quote special characters
122
132
  str.gsub!(/"/, '\"')
metadata CHANGED
@@ -1,13 +1,13 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ifmapper
3
3
  version: !ruby/object:Gem::Version
4
- hash: 23
4
+ hash: 21
5
5
  prerelease:
6
6
  segments:
7
7
  - 1
8
8
  - 2
9
- - 4
10
- version: 1.2.4
9
+ - 5
10
+ version: 1.2.5
11
11
  platform: ruby
12
12
  authors:
13
13
  - Gonzalo Garramuno
@@ -15,7 +15,7 @@ autorequire:
15
15
  bindir: bin
16
16
  cert_chain: []
17
17
 
18
- date: 2013-09-03 00:00:00 Z
18
+ date: 2013-09-19 00:00:00 Z
19
19
  dependencies:
20
20
  - !ruby/object:Gem::Dependency
21
21
  name: rake-compiler