spreadsheet 1.1.2 → 1.1.3

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 2b637195c40422ea73262b933a7a62d3b7c50883
4
- data.tar.gz: 61510bfe1d8aa2eaebcd087b8d479e9f073efebd
3
+ metadata.gz: d963aae672b717dc7a279a1e14efec5cce64a272
4
+ data.tar.gz: 18009a3af345b0051e4ad6efe2f85739ec87dda3
5
5
  SHA512:
6
- metadata.gz: ddafa532308bdffe930e4fe1f2d94aa8b38bef32850953b266432804a9d32c8829cd6a63e6143e222d47dc08186f001343e2fb556317ec62787a77b2815322ed
7
- data.tar.gz: 53ce917e4db7f5730726bbb1a36f6e0befa24cd7c5ae890731809e6b93cb89d5e3ffc5b1c47125e89a15d135681bcb573e7b9d1ed6bc2b85dcd30ce05f5de51b
6
+ metadata.gz: e22611671910b290869e586f214b92d00beb40d486b1b830face971f8dc35fdeb60e064fa44c7e0e27393eab5217890fcf595d990597ef1e324be2565048fc93
7
+ data.tar.gz: 253242666e44ffcc7ef180c542e2f7ee30183db5d00d4277de99e2a2736d519af1a61f4b36404c0a6173ab2883e197c699a96d90cdb02013619691fe07ee81d4
data/History.md CHANGED
@@ -1,3 +1,13 @@
1
+ ### 1.1.3 / 06.08.2016
2
+
3
+ Author: Alexandre Balon-Perin <abalonperin@gilt.jp>
4
+ Date: Fri Aug 5 17:19:29 2016 +0900
5
+
6
+ * Fix issue with iconv on Ubuntu 12.04
7
+ * This fix is related to a bug in the iconv implementation packaged in libc6 on Ubuntu 12.04
8
+ * For some reasons, the encoding options //TRANSLIT//IGNORE are improperly applied.
9
+ * When //TRANSLIT is specified, instead of rescuing errors related to //TRANSLIT and checking if the //IGNORE is set, the code simply crashes.
10
+
1
11
  ### 1.1.2 / 29.03.2016
2
12
  Author: Aleksandr Boykov <aleksandr.boykov@parelio.com>
3
13
  Date: Mon Mar 28 14:07:35 2016 -0400
@@ -45,17 +45,19 @@ module Spreadsheet
45
45
 
46
46
  ##
47
47
  # The version of Spreadsheet you are using.
48
- VERSION = '1.1.2'
48
+ VERSION = '1.1.3'
49
49
 
50
50
  ##
51
51
  # Default client Encoding. Change this value if your application uses a
52
52
  # different Encoding:
53
53
  # Spreadsheet.client_encoding = 'ISO-LATIN-1//TRANSLIT//IGNORE'
54
54
  @client_encoding = 'UTF-8'
55
+ @enc_translit = 'TRANSLIT'
56
+ @enc_ignore = 'IGNORE'
55
57
 
56
58
  class << self
57
59
 
58
- attr_accessor :client_encoding
60
+ attr_accessor :client_encoding, :enc_translit, :enc_ignore
59
61
 
60
62
  ##
61
63
  # Parses a Spreadsheet Document and returns a Workbook object. At present,
@@ -26,22 +26,27 @@ module Spreadsheet
26
26
  else
27
27
  require 'iconv'
28
28
  @@iconvs = {}
29
+
30
+ def build_output_encoding(to_encoding)
31
+ [to_encoding, Spreadsheet.enc_translit, Spreadsheet.enc_ignore].compact.join('//')
32
+ end
33
+
29
34
  def client string, internal='UTF-16LE'
30
35
  string = string.dup
31
36
  key = [Spreadsheet.client_encoding, internal]
32
37
  iconv = @@iconvs[key] ||= Iconv.new(Spreadsheet.client_encoding, internal)
33
38
  iconv.iconv string
34
39
  end
35
- def internal string, client=Spreadsheet.client_encoding
40
+ def internal string, client=Spreadsheet.client_encoding, to_encoding = 'UTF-16LE'
36
41
  string = string.dup
37
- key = ['UTF-16LE', client]
38
- iconv = @@iconvs[key] ||= Iconv.new('UTF-16LE//TRANSLIT//IGNORE', client)
42
+ key = [to_encoding, client]
43
+ iconv = @@iconvs[key] ||= Iconv.new(build_output_encoding(to_encoding), client)
39
44
  iconv.iconv string
40
45
  end
41
- def utf8 string, client=Spreadsheet.client_encoding
46
+ def utf8 string, client=Spreadsheet.client_encoding, to_encoding = 'UTF-8'
42
47
  string = string.dup
43
- key = ['UTF-8', client]
44
- iconv = @@iconvs[key] ||= Iconv.new('UTF-8//TRANSLIT//IGNORE', client)
48
+ key = [to_encoding, client]
49
+ iconv = @@iconvs[key] ||= Iconv.new(build_output_encoding(to_encoding), client)
45
50
  iconv.iconv string
46
51
  end
47
52
  end
@@ -55,3 +60,4 @@ module Spreadsheet
55
60
  end
56
61
  end
57
62
  end
63
+
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: spreadsheet
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.1.2
4
+ version: 1.1.3
5
5
  platform: ruby
6
6
  authors:
7
7
  - Masaomi Hatakeyama, Zeno R.R. Davatz
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-03-29 00:00:00.000000000 Z
11
+ date: 2016-08-06 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-ole
@@ -44,14 +44,14 @@ dependencies:
44
44
  requirements:
45
45
  - - "~>"
46
46
  - !ruby/object:Gem::Version
47
- version: '3.7'
47
+ version: '3.14'
48
48
  type: :development
49
49
  prerelease: false
50
50
  version_requirements: !ruby/object:Gem::Requirement
51
51
  requirements:
52
52
  - - "~>"
53
53
  - !ruby/object:Gem::Version
54
- version: '3.7'
54
+ version: '3.14'
55
55
  description: |-
56
56
  The Spreadsheet Library is designed to read and write Spreadsheet Documents.
57
57
  As of version 0.6.0, only Microsoft Excel compatible spreadsheets are
@@ -70,7 +70,6 @@ extra_rdoc_files:
70
70
  - Manifest.txt
71
71
  - README.md
72
72
  files:
73
- - ".gemtest"
74
73
  - ".gitignore"
75
74
  - ".travis.yml"
76
75
  - Excel97-2007BinaryFileFormatSpecification.pdf
@@ -179,8 +178,8 @@ required_rubygems_version: !ruby/object:Gem::Requirement
179
178
  - !ruby/object:Gem::Version
180
179
  version: '0'
181
180
  requirements: []
182
- rubyforge_project: spreadsheet
183
- rubygems_version: 2.4.5
181
+ rubyforge_project:
182
+ rubygems_version: 2.5.1
184
183
  signing_key:
185
184
  specification_version: 4
186
185
  summary: The Spreadsheet Library is designed to read and write Spreadsheet Documents
data/.gemtest DELETED
File without changes