roo 1.13.1 → 2.10.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (235) hide show
  1. checksums.yaml +5 -5
  2. data/.codeclimate.yml +17 -0
  3. data/.github/issue_template.md +16 -0
  4. data/.github/pull_request_template.md +14 -0
  5. data/.github/workflows/pull-request.yml +15 -0
  6. data/.github/workflows/ruby.yml +34 -0
  7. data/.gitignore +11 -0
  8. data/.rubocop.yml +186 -0
  9. data/.simplecov +4 -0
  10. data/CHANGELOG.md +702 -0
  11. data/Gemfile +18 -12
  12. data/Guardfile +23 -0
  13. data/LICENSE +5 -1
  14. data/README.md +328 -0
  15. data/Rakefile +23 -23
  16. data/examples/roo_soap_client.rb +28 -31
  17. data/examples/roo_soap_server.rb +4 -6
  18. data/examples/write_me.rb +9 -10
  19. data/lib/roo/base.rb +317 -504
  20. data/lib/roo/constants.rb +7 -0
  21. data/lib/roo/csv.rb +141 -113
  22. data/lib/roo/errors.rb +11 -0
  23. data/lib/roo/excelx/cell/base.rb +108 -0
  24. data/lib/roo/excelx/cell/boolean.rb +30 -0
  25. data/lib/roo/excelx/cell/date.rb +28 -0
  26. data/lib/roo/excelx/cell/datetime.rb +107 -0
  27. data/lib/roo/excelx/cell/empty.rb +20 -0
  28. data/lib/roo/excelx/cell/number.rb +99 -0
  29. data/lib/roo/excelx/cell/string.rb +19 -0
  30. data/lib/roo/excelx/cell/time.rb +44 -0
  31. data/lib/roo/excelx/cell.rb +110 -0
  32. data/lib/roo/excelx/comments.rb +55 -0
  33. data/lib/roo/excelx/coordinate.rb +19 -0
  34. data/lib/roo/excelx/extractor.rb +39 -0
  35. data/lib/roo/excelx/format.rb +71 -0
  36. data/lib/roo/excelx/images.rb +26 -0
  37. data/lib/roo/excelx/relationships.rb +33 -0
  38. data/lib/roo/excelx/shared.rb +39 -0
  39. data/lib/roo/excelx/shared_strings.rb +151 -0
  40. data/lib/roo/excelx/sheet.rb +151 -0
  41. data/lib/roo/excelx/sheet_doc.rb +257 -0
  42. data/lib/roo/excelx/styles.rb +64 -0
  43. data/lib/roo/excelx/workbook.rb +64 -0
  44. data/lib/roo/excelx.rb +407 -601
  45. data/lib/roo/font.rb +17 -0
  46. data/lib/roo/formatters/base.rb +15 -0
  47. data/lib/roo/formatters/csv.rb +84 -0
  48. data/lib/roo/formatters/matrix.rb +23 -0
  49. data/lib/roo/formatters/xml.rb +31 -0
  50. data/lib/roo/formatters/yaml.rb +40 -0
  51. data/lib/roo/helpers/default_attr_reader.rb +20 -0
  52. data/lib/roo/helpers/weak_instance_cache.rb +41 -0
  53. data/lib/roo/libre_office.rb +4 -0
  54. data/lib/roo/link.rb +34 -0
  55. data/lib/roo/open_office.rb +631 -0
  56. data/lib/roo/spreadsheet.rb +28 -23
  57. data/lib/roo/tempdir.rb +24 -0
  58. data/lib/roo/utils.rb +128 -0
  59. data/lib/roo/version.rb +3 -0
  60. data/lib/roo.rb +26 -24
  61. data/roo.gemspec +29 -202
  62. data/spec/helpers.rb +5 -0
  63. data/spec/lib/roo/base_spec.rb +291 -3
  64. data/spec/lib/roo/csv_spec.rb +38 -11
  65. data/spec/lib/roo/excelx/cell/time_spec.rb +15 -0
  66. data/spec/lib/roo/excelx/format_spec.rb +7 -6
  67. data/spec/lib/roo/excelx/relationships_spec.rb +43 -0
  68. data/spec/lib/roo/excelx/sheet_doc_spec.rb +11 -0
  69. data/spec/lib/roo/excelx_spec.rb +682 -6
  70. data/spec/lib/roo/libreoffice_spec.rb +16 -6
  71. data/spec/lib/roo/openoffice_spec.rb +30 -8
  72. data/spec/lib/roo/spreadsheet_spec.rb +60 -12
  73. data/spec/lib/roo/strict_spec.rb +43 -0
  74. data/spec/lib/roo/utils_spec.rb +119 -0
  75. data/spec/lib/roo/weak_instance_cache_spec.rb +92 -0
  76. data/spec/lib/roo_spec.rb +0 -0
  77. data/spec/spec_helper.rb +7 -6
  78. data/test/all_ss.rb +12 -11
  79. data/test/excelx/cell/test_attr_reader_default.rb +72 -0
  80. data/test/excelx/cell/test_base.rb +68 -0
  81. data/test/excelx/cell/test_boolean.rb +36 -0
  82. data/test/excelx/cell/test_date.rb +38 -0
  83. data/test/excelx/cell/test_datetime.rb +45 -0
  84. data/test/excelx/cell/test_empty.rb +18 -0
  85. data/test/excelx/cell/test_number.rb +90 -0
  86. data/test/excelx/cell/test_string.rb +48 -0
  87. data/test/excelx/cell/test_time.rb +30 -0
  88. data/test/excelx/test_coordinate.rb +51 -0
  89. data/test/formatters/test_csv.rb +136 -0
  90. data/test/formatters/test_matrix.rb +76 -0
  91. data/test/formatters/test_xml.rb +78 -0
  92. data/test/formatters/test_yaml.rb +20 -0
  93. data/test/helpers/test_accessing_files.rb +81 -0
  94. data/test/helpers/test_comments.rb +43 -0
  95. data/test/helpers/test_formulas.rb +9 -0
  96. data/test/helpers/test_labels.rb +103 -0
  97. data/test/helpers/test_sheets.rb +55 -0
  98. data/test/helpers/test_styles.rb +62 -0
  99. data/test/roo/test_base.rb +182 -0
  100. data/test/roo/test_csv.rb +88 -0
  101. data/test/roo/test_excelx.rb +360 -0
  102. data/test/roo/test_libre_office.rb +9 -0
  103. data/test/roo/test_open_office.rb +289 -0
  104. data/test/test_helper.rb +123 -59
  105. data/test/test_roo.rb +392 -2292
  106. metadata +153 -296
  107. data/CHANGELOG +0 -412
  108. data/Gemfile.lock +0 -78
  109. data/README.markdown +0 -126
  110. data/VERSION +0 -1
  111. data/lib/roo/excel.rb +0 -355
  112. data/lib/roo/excel2003xml.rb +0 -300
  113. data/lib/roo/google.rb +0 -292
  114. data/lib/roo/openoffice.rb +0 -496
  115. data/lib/roo/roo_rails_helper.rb +0 -83
  116. data/lib/roo/worksheet.rb +0 -18
  117. data/scripts/txt2html +0 -67
  118. data/spec/lib/roo/excel2003xml_spec.rb +0 -15
  119. data/spec/lib/roo/excel_spec.rb +0 -17
  120. data/spec/lib/roo/google_spec.rb +0 -64
  121. data/test/files/1900_base.xls +0 -0
  122. data/test/files/1900_base.xlsx +0 -0
  123. data/test/files/1904_base.xls +0 -0
  124. data/test/files/1904_base.xlsx +0 -0
  125. data/test/files/Bibelbund.csv +0 -3741
  126. data/test/files/Bibelbund.ods +0 -0
  127. data/test/files/Bibelbund.xls +0 -0
  128. data/test/files/Bibelbund.xlsx +0 -0
  129. data/test/files/Bibelbund.xml +0 -62518
  130. data/test/files/Bibelbund1.ods +0 -0
  131. data/test/files/Pfand_from_windows_phone.xlsx +0 -0
  132. data/test/files/bad_excel_date.xls +0 -0
  133. data/test/files/bbu.ods +0 -0
  134. data/test/files/bbu.xls +0 -0
  135. data/test/files/bbu.xlsx +0 -0
  136. data/test/files/bbu.xml +0 -152
  137. data/test/files/bode-v1.ods.zip +0 -0
  138. data/test/files/bode-v1.xls.zip +0 -0
  139. data/test/files/boolean.csv +0 -2
  140. data/test/files/boolean.ods +0 -0
  141. data/test/files/boolean.xls +0 -0
  142. data/test/files/boolean.xlsx +0 -0
  143. data/test/files/boolean.xml +0 -112
  144. data/test/files/borders.ods +0 -0
  145. data/test/files/borders.xls +0 -0
  146. data/test/files/borders.xlsx +0 -0
  147. data/test/files/borders.xml +0 -144
  148. data/test/files/bug-numbered-sheet-names.xlsx +0 -0
  149. data/test/files/bug-row-column-fixnum-float.xls +0 -0
  150. data/test/files/bug-row-column-fixnum-float.xml +0 -127
  151. data/test/files/comments.ods +0 -0
  152. data/test/files/comments.xls +0 -0
  153. data/test/files/comments.xlsx +0 -0
  154. data/test/files/csvtypes.csv +0 -1
  155. data/test/files/datetime.ods +0 -0
  156. data/test/files/datetime.xls +0 -0
  157. data/test/files/datetime.xlsx +0 -0
  158. data/test/files/datetime.xml +0 -142
  159. data/test/files/datetime_floatconv.xls +0 -0
  160. data/test/files/datetime_floatconv.xml +0 -148
  161. data/test/files/dreimalvier.ods +0 -0
  162. data/test/files/emptysheets.ods +0 -0
  163. data/test/files/emptysheets.xls +0 -0
  164. data/test/files/emptysheets.xlsx +0 -0
  165. data/test/files/emptysheets.xml +0 -105
  166. data/test/files/excel2003.xml +0 -21140
  167. data/test/files/false_encoding.xls +0 -0
  168. data/test/files/false_encoding.xml +0 -132
  169. data/test/files/file_item_error.xlsx +0 -0
  170. data/test/files/formula.ods +0 -0
  171. data/test/files/formula.xls +0 -0
  172. data/test/files/formula.xlsx +0 -0
  173. data/test/files/formula.xml +0 -134
  174. data/test/files/formula_parse_error.xls +0 -0
  175. data/test/files/formula_parse_error.xml +0 -1833
  176. data/test/files/formula_string_error.xlsx +0 -0
  177. data/test/files/html-escape.ods +0 -0
  178. data/test/files/link.xls +0 -0
  179. data/test/files/link.xlsx +0 -0
  180. data/test/files/matrix.ods +0 -0
  181. data/test/files/matrix.xls +0 -0
  182. data/test/files/named_cells.ods +0 -0
  183. data/test/files/named_cells.xls +0 -0
  184. data/test/files/named_cells.xlsx +0 -0
  185. data/test/files/no_spreadsheet_file.txt +0 -1
  186. data/test/files/numbers1.csv +0 -18
  187. data/test/files/numbers1.ods +0 -0
  188. data/test/files/numbers1.xls +0 -0
  189. data/test/files/numbers1.xlsx +0 -0
  190. data/test/files/numbers1.xml +0 -312
  191. data/test/files/only_one_sheet.ods +0 -0
  192. data/test/files/only_one_sheet.xls +0 -0
  193. data/test/files/only_one_sheet.xlsx +0 -0
  194. data/test/files/only_one_sheet.xml +0 -67
  195. data/test/files/paragraph.ods +0 -0
  196. data/test/files/paragraph.xls +0 -0
  197. data/test/files/paragraph.xlsx +0 -0
  198. data/test/files/paragraph.xml +0 -127
  199. data/test/files/prova.xls +0 -0
  200. data/test/files/ric.ods +0 -0
  201. data/test/files/simple_spreadsheet.ods +0 -0
  202. data/test/files/simple_spreadsheet.xls +0 -0
  203. data/test/files/simple_spreadsheet.xlsx +0 -0
  204. data/test/files/simple_spreadsheet.xml +0 -225
  205. data/test/files/simple_spreadsheet_from_italo.ods +0 -0
  206. data/test/files/simple_spreadsheet_from_italo.xls +0 -0
  207. data/test/files/simple_spreadsheet_from_italo.xml +0 -242
  208. data/test/files/so_datetime.csv +0 -7
  209. data/test/files/style.ods +0 -0
  210. data/test/files/style.xls +0 -0
  211. data/test/files/style.xlsx +0 -0
  212. data/test/files/style.xml +0 -154
  213. data/test/files/time-test.csv +0 -2
  214. data/test/files/time-test.ods +0 -0
  215. data/test/files/time-test.xls +0 -0
  216. data/test/files/time-test.xlsx +0 -0
  217. data/test/files/time-test.xml +0 -131
  218. data/test/files/type_excel.ods +0 -0
  219. data/test/files/type_excel.xlsx +0 -0
  220. data/test/files/type_excelx.ods +0 -0
  221. data/test/files/type_excelx.xls +0 -0
  222. data/test/files/type_openoffice.xls +0 -0
  223. data/test/files/type_openoffice.xlsx +0 -0
  224. data/test/files/whitespace.ods +0 -0
  225. data/test/files/whitespace.xls +0 -0
  226. data/test/files/whitespace.xlsx +0 -0
  227. data/test/files/whitespace.xml +0 -184
  228. data/test/rm_sub_test.rb +0 -12
  229. data/test/rm_test.rb +0 -7
  230. data/test/test_generic_spreadsheet.rb +0 -259
  231. data/website/index.html +0 -385
  232. data/website/index.txt +0 -423
  233. data/website/javascripts/rounded_corners_lite.inc.js +0 -285
  234. data/website/stylesheets/screen.css +0 -130
  235. data/website/template.rhtml +0 -48
@@ -0,0 +1,24 @@
1
+ module Roo
2
+ module Tempdir
3
+ def finalize_tempdirs(object_id)
4
+ if @tempdirs && (dirs_to_remove = @tempdirs[object_id])
5
+ @tempdirs.delete(object_id)
6
+ dirs_to_remove.each do |dir|
7
+ # Pass force=true to avoid an exception (and thus warnings in Ruby 3.1) if dir has
8
+ # already been removed. This can occur when the finalizer is called both in a forked
9
+ # child process and in the parent.
10
+ ::FileUtils.remove_entry(dir, true)
11
+ end
12
+ end
13
+ end
14
+
15
+ def make_tempdir(object, prefix, root)
16
+ root ||= ENV["ROO_TMP"]
17
+ # NOTE: This folder is cleaned up by finalize_tempdirs.
18
+ ::Dir.mktmpdir("#{Roo::TEMP_PREFIX}#{prefix}", root).tap do |tmpdir|
19
+ @tempdirs ||= Hash.new { |h, k| h[k] = [] }
20
+ @tempdirs[object.object_id] << tmpdir
21
+ end
22
+ end
23
+ end
24
+ end
data/lib/roo/utils.rb ADDED
@@ -0,0 +1,128 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Roo
4
+ module Utils
5
+ extend self
6
+
7
+ LETTERS = ('A'..'Z').to_a
8
+
9
+ def extract_coordinate(s)
10
+ num = letter_num = 0
11
+ num_only = false
12
+
13
+ s.each_byte do |b|
14
+ if !num_only && (index = char_index(b))
15
+ letter_num *= 26
16
+ letter_num += index
17
+ elsif index = num_index(b)
18
+ num_only = true
19
+ num *= 10
20
+ num += index
21
+ else
22
+ fail ArgumentError
23
+ end
24
+ end
25
+ fail ArgumentError if letter_num == 0 || !num_only
26
+
27
+ Excelx::Coordinate.new(num, letter_num)
28
+ end
29
+
30
+ alias_method :ref_to_key, :extract_coordinate
31
+
32
+ def split_coordinate(str)
33
+ warn "[DEPRECATION] `Roo::Utils.split_coordinate` is deprecated. Please use `Roo::Utils.extract_coordinate` instead."
34
+ extract_coordinate(str)
35
+ end
36
+
37
+
38
+
39
+ def split_coord(str)
40
+ coord = extract_coordinate(str)
41
+ [number_to_letter(coord.column), coord.row]
42
+ end
43
+
44
+ # convert a number to something like 'AB' (1 => 'A', 2 => 'B', ...)
45
+ def number_to_letter(num)
46
+ result = +""
47
+
48
+ until num.zero?
49
+ num, index = (num - 1).divmod(26)
50
+ result.prepend(LETTERS[index])
51
+ end
52
+
53
+ result
54
+ end
55
+
56
+ def letter_to_number(letters)
57
+ @letter_to_number ||= {}
58
+ @letter_to_number[letters] ||= begin
59
+ result = 0
60
+
61
+ # :bytes method returns an enumerator in 1.9.3 and an array in 2.0+
62
+ letters.bytes.to_a.map{|b| b > 96 ? b - 96 : b - 64 }.reverse.each_with_index{ |num, i| result += num * 26 ** i }
63
+
64
+ result
65
+ end
66
+ end
67
+
68
+ # Compute upper bound for cells in a given cell range.
69
+ def num_cells_in_range(str)
70
+ cells = str.split(':')
71
+ return 1 if cells.count == 1
72
+ raise ArgumentError.new("invalid range string: #{str}. Supported range format 'A1:B2'") if cells.count != 2
73
+ x1, y1 = extract_coordinate(cells[0])
74
+ x2, y2 = extract_coordinate(cells[1])
75
+ (x2 - (x1 - 1)) * (y2 - (y1 - 1))
76
+ end
77
+
78
+ def coordinates_in_range(str)
79
+ return to_enum(:coordinates_in_range, str) unless block_given?
80
+ coordinates = str.split(":", 2).map! { |s| extract_coordinate s }
81
+
82
+ case coordinates.size
83
+ when 1
84
+ yield coordinates[0]
85
+ when 2
86
+ tl, br = coordinates
87
+ rows = tl.row..br.row
88
+ cols = tl.column..br.column
89
+ rows.each do |row|
90
+ cols.each do |column|
91
+ yield Excelx::Coordinate.new(row, column)
92
+ end
93
+ end
94
+ end
95
+ end
96
+
97
+ def load_xml(path)
98
+ ::File.open(path, 'rb') do |file|
99
+ ::Nokogiri::XML(file)
100
+ end
101
+ end
102
+
103
+ # Yield each element of a given type ('row', 'c', etc.) to caller
104
+ def each_element(path, elements)
105
+ elements = Array(elements)
106
+ Nokogiri::XML::Reader(::File.open(path, 'rb'), nil, nil, Nokogiri::XML::ParseOptions::NOBLANKS).each do |node|
107
+ next unless node.node_type == Nokogiri::XML::Reader::TYPE_ELEMENT && elements.include?(node.name)
108
+ yield Nokogiri::XML(node.outer_xml).root if block_given?
109
+ end
110
+ end
111
+
112
+ private
113
+
114
+ def char_index(byte)
115
+ if byte >= 65 && byte <= 90
116
+ byte - 64
117
+ elsif byte >= 97 && byte <= 122
118
+ byte - 96
119
+ end
120
+ end
121
+
122
+ def num_index(byte)
123
+ if byte >= 48 && byte <= 57
124
+ byte - 48
125
+ end
126
+ end
127
+ end
128
+ end
@@ -0,0 +1,3 @@
1
+ module Roo
2
+ VERSION = "2.10.1"
3
+ end
data/lib/roo.rb CHANGED
@@ -1,34 +1,36 @@
1
+ # frozen_string_literal: true
2
+
3
+ require 'roo/version'
4
+ require 'roo/constants'
5
+ require 'roo/errors'
6
+ require 'roo/spreadsheet'
7
+ require 'roo/base'
8
+
1
9
  module Roo
10
+ autoload :OpenOffice, 'roo/open_office'
11
+ autoload :LibreOffice, 'roo/libre_office'
12
+ autoload :Excelx, 'roo/excelx'
13
+ autoload :CSV, 'roo/csv'
14
+
15
+ TEMP_PREFIX = 'roo_'
2
16
 
3
- VERSION = '1.12.1'
17
+ CLASS_FOR_EXTENSION = {
18
+ ods: Roo::OpenOffice,
19
+ xlsx: Roo::Excelx,
20
+ xlsm: Roo::Excelx,
21
+ csv: Roo::CSV
22
+ }
4
23
 
5
24
  def self.const_missing(const_name)
6
25
  case const_name
7
- when :Libreoffice
8
- warn "`Roo::Libreoffice` has been deprecated. Use `Roo::LibreOffice` instead."
9
- LibreOffice
10
- when :Openoffice
11
- warn "`Roo::Openoffice` has been deprecated. Use `Roo::OpenOffice` instead."
12
- OpenOffice
13
- when :Csv
14
- warn "`Roo::Csv` has been deprecated. Use `Roo::CSV` instead."
15
- CSV
16
- when :GenericSpreadsheet
17
- warn "`Roo::GenericSpreadsheet` has been deprecated. Use `Roo::Base` instead."
18
- Base
26
+ when :Excel
27
+ raise ROO_EXCEL_NOTICE
28
+ when :Excel2003XML
29
+ raise ROO_EXCELML_NOTICE
30
+ when :Google
31
+ raise ROO_GOOGLE_NOTICE
19
32
  else
20
33
  super
21
34
  end
22
35
  end
23
-
24
- autoload :Spreadsheet, 'roo/spreadsheet'
25
- autoload :Base, 'roo/base'
26
-
27
- autoload :OpenOffice, 'roo/openoffice'
28
- autoload :LibreOffice, 'roo/openoffice'
29
- autoload :Excel, 'roo/excel'
30
- autoload :Excelx, 'roo/excelx'
31
- autoload :Excel2003XML, 'roo/excel2003xml'
32
- autoload :Google, 'roo/google'
33
- autoload :CSV, 'roo/csv'
34
36
  end
data/roo.gemspec CHANGED
@@ -1,208 +1,35 @@
1
- # Generated by jeweler
2
- # DO NOT EDIT THIS FILE DIRECTLY
3
- # Instead, edit Jeweler::Tasks in Rakefile, and run 'rake gemspec'
4
- # -*- encoding: utf-8 -*-
1
+ # encoding: utf-8
2
+ lib = File.expand_path('../lib', __FILE__)
3
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
4
+ require 'roo/version'
5
5
 
6
- Gem::Specification.new do |s|
7
- s.name = "roo"
8
- s.version = "1.13.1"
6
+ Gem::Specification.new do |spec|
7
+ spec.name = 'roo'
8
+ spec.version = Roo::VERSION
9
+ spec.authors = ['Thomas Preymesser', 'Hugh McGowan', 'Ben Woosley', 'Oleksandr Simonov', 'Steven Daniels', 'Anmol Chopra']
10
+ spec.email = ['ruby.ruby.ruby.roo@gmail.com', 'oleksandr@simonov.me']
11
+ spec.summary = 'Roo can access the contents of various spreadsheet files.'
12
+ spec.description = "Roo can access the contents of various spreadsheet files. It can handle\n* OpenOffice\n* Excelx\n* LibreOffice\n* CSV"
13
+ spec.homepage = 'https://github.com/roo-rb/roo'
14
+ spec.license = 'MIT'
9
15
 
10
- s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
11
- s.authors = ["Thomas Preymesser", "Hugh McGowan", "Ben Woosley"]
12
- s.date = "2013-12-23"
13
- s.description = "Roo can access the contents of various spreadsheet files. It can handle\n* OpenOffice\n* Excel\n* Google spreadsheets\n* Excelx\n* LibreOffice\n* CSV"
14
- s.email = "ruby.ruby.ruby.roo@gmail.com"
15
- s.extra_rdoc_files = [
16
- "LICENSE",
17
- "README.markdown"
18
- ]
19
- s.files = [
20
- "CHANGELOG",
21
- "Gemfile",
22
- "Gemfile.lock",
23
- "LICENSE",
24
- "README.markdown",
25
- "Rakefile",
26
- "VERSION",
27
- "examples/roo_soap_client.rb",
28
- "examples/roo_soap_server.rb",
29
- "examples/write_me.rb",
30
- "lib/roo.rb",
31
- "lib/roo/base.rb",
32
- "lib/roo/csv.rb",
33
- "lib/roo/excel.rb",
34
- "lib/roo/excel2003xml.rb",
35
- "lib/roo/excelx.rb",
36
- "lib/roo/google.rb",
37
- "lib/roo/openoffice.rb",
38
- "lib/roo/roo_rails_helper.rb",
39
- "lib/roo/spreadsheet.rb",
40
- "lib/roo/worksheet.rb",
41
- "roo.gemspec",
42
- "scripts/txt2html",
43
- "spec/fixtures/vcr_cassettes/google_drive.yml",
44
- "spec/fixtures/vcr_cassettes/google_drive_access_token.yml",
45
- "spec/fixtures/vcr_cassettes/google_drive_set.yml",
46
- "spec/lib/roo/base_spec.rb",
47
- "spec/lib/roo/csv_spec.rb",
48
- "spec/lib/roo/excel2003xml_spec.rb",
49
- "spec/lib/roo/excel_spec.rb",
50
- "spec/lib/roo/excelx/format_spec.rb",
51
- "spec/lib/roo/excelx_spec.rb",
52
- "spec/lib/roo/google_spec.rb",
53
- "spec/lib/roo/libreoffice_spec.rb",
54
- "spec/lib/roo/openoffice_spec.rb",
55
- "spec/lib/roo/spreadsheet_spec.rb",
56
- "spec/spec_helper.rb",
57
- "test/all_ss.rb",
58
- "test/files/1900_base.xls",
59
- "test/files/1900_base.xlsx",
60
- "test/files/1904_base.xls",
61
- "test/files/1904_base.xlsx",
62
- "test/files/Bibelbund.csv",
63
- "test/files/Bibelbund.ods",
64
- "test/files/Bibelbund.xls",
65
- "test/files/Bibelbund.xlsx",
66
- "test/files/Bibelbund.xml",
67
- "test/files/Bibelbund1.ods",
68
- "test/files/Pfand_from_windows_phone.xlsx",
69
- "test/files/bad_excel_date.xls",
70
- "test/files/bbu.ods",
71
- "test/files/bbu.xls",
72
- "test/files/bbu.xlsx",
73
- "test/files/bbu.xml",
74
- "test/files/bode-v1.ods.zip",
75
- "test/files/bode-v1.xls.zip",
76
- "test/files/boolean.csv",
77
- "test/files/boolean.ods",
78
- "test/files/boolean.xls",
79
- "test/files/boolean.xlsx",
80
- "test/files/boolean.xml",
81
- "test/files/borders.ods",
82
- "test/files/borders.xls",
83
- "test/files/borders.xlsx",
84
- "test/files/borders.xml",
85
- "test/files/bug-numbered-sheet-names.xlsx",
86
- "test/files/bug-row-column-fixnum-float.xls",
87
- "test/files/bug-row-column-fixnum-float.xml",
88
- "test/files/comments.ods",
89
- "test/files/comments.xls",
90
- "test/files/comments.xlsx",
91
- "test/files/csvtypes.csv",
92
- "test/files/datetime.ods",
93
- "test/files/datetime.xls",
94
- "test/files/datetime.xlsx",
95
- "test/files/datetime.xml",
96
- "test/files/datetime_floatconv.xls",
97
- "test/files/datetime_floatconv.xml",
98
- "test/files/dreimalvier.ods",
99
- "test/files/emptysheets.ods",
100
- "test/files/emptysheets.xls",
101
- "test/files/emptysheets.xlsx",
102
- "test/files/emptysheets.xml",
103
- "test/files/excel2003.xml",
104
- "test/files/false_encoding.xls",
105
- "test/files/false_encoding.xml",
106
- "test/files/file_item_error.xlsx",
107
- "test/files/formula.ods",
108
- "test/files/formula.xls",
109
- "test/files/formula.xlsx",
110
- "test/files/formula.xml",
111
- "test/files/formula_parse_error.xls",
112
- "test/files/formula_parse_error.xml",
113
- "test/files/formula_string_error.xlsx",
114
- "test/files/html-escape.ods",
115
- "test/files/link.xls",
116
- "test/files/link.xlsx",
117
- "test/files/matrix.ods",
118
- "test/files/matrix.xls",
119
- "test/files/named_cells.ods",
120
- "test/files/named_cells.xls",
121
- "test/files/named_cells.xlsx",
122
- "test/files/no_spreadsheet_file.txt",
123
- "test/files/numbers1.csv",
124
- "test/files/numbers1.ods",
125
- "test/files/numbers1.xls",
126
- "test/files/numbers1.xlsx",
127
- "test/files/numbers1.xml",
128
- "test/files/only_one_sheet.ods",
129
- "test/files/only_one_sheet.xls",
130
- "test/files/only_one_sheet.xlsx",
131
- "test/files/only_one_sheet.xml",
132
- "test/files/paragraph.ods",
133
- "test/files/paragraph.xls",
134
- "test/files/paragraph.xlsx",
135
- "test/files/paragraph.xml",
136
- "test/files/prova.xls",
137
- "test/files/ric.ods",
138
- "test/files/simple_spreadsheet.ods",
139
- "test/files/simple_spreadsheet.xls",
140
- "test/files/simple_spreadsheet.xlsx",
141
- "test/files/simple_spreadsheet.xml",
142
- "test/files/simple_spreadsheet_from_italo.ods",
143
- "test/files/simple_spreadsheet_from_italo.xls",
144
- "test/files/simple_spreadsheet_from_italo.xml",
145
- "test/files/so_datetime.csv",
146
- "test/files/style.ods",
147
- "test/files/style.xls",
148
- "test/files/style.xlsx",
149
- "test/files/style.xml",
150
- "test/files/time-test.csv",
151
- "test/files/time-test.ods",
152
- "test/files/time-test.xls",
153
- "test/files/time-test.xlsx",
154
- "test/files/time-test.xml",
155
- "test/files/type_excel.ods",
156
- "test/files/type_excel.xlsx",
157
- "test/files/type_excelx.ods",
158
- "test/files/type_excelx.xls",
159
- "test/files/type_openoffice.xls",
160
- "test/files/type_openoffice.xlsx",
161
- "test/files/whitespace.ods",
162
- "test/files/whitespace.xls",
163
- "test/files/whitespace.xlsx",
164
- "test/files/whitespace.xml",
165
- "test/rm_sub_test.rb",
166
- "test/rm_test.rb",
167
- "test/test_generic_spreadsheet.rb",
168
- "test/test_helper.rb",
169
- "test/test_roo.rb",
170
- "website/index.html",
171
- "website/index.txt",
172
- "website/javascripts/rounded_corners_lite.inc.js",
173
- "website/stylesheets/screen.css",
174
- "website/template.rhtml"
175
- ]
176
- s.homepage = "http://github.com/Empact/roo"
177
- s.licenses = ["MIT"]
178
- s.require_paths = ["lib"]
179
- s.required_ruby_version = Gem::Requirement.new(">= 1.9.0")
180
- s.rubygems_version = "2.0.14"
181
- s.summary = "Roo can access the contents of various spreadsheet files."
182
- s.test_files = ["spec/fixtures/vcr_cassettes/google_drive.yml", "spec/fixtures/vcr_cassettes/google_drive_access_token.yml", "spec/fixtures/vcr_cassettes/google_drive_set.yml", "spec/lib/roo/base_spec.rb", "spec/lib/roo/csv_spec.rb", "spec/lib/roo/excel2003xml_spec.rb", "spec/lib/roo/excel_spec.rb", "spec/lib/roo/excelx/format_spec.rb", "spec/lib/roo/excelx_spec.rb", "spec/lib/roo/google_spec.rb", "spec/lib/roo/libreoffice_spec.rb", "spec/lib/roo/openoffice_spec.rb", "spec/lib/roo/spreadsheet_spec.rb", "spec/spec_helper.rb", "test/all_ss.rb", "test/files/1900_base.xls", "test/files/1900_base.xlsx", "test/files/1904_base.xls", "test/files/1904_base.xlsx", "test/files/Bibelbund.csv", "test/files/Bibelbund.ods", "test/files/Bibelbund.xls", "test/files/Bibelbund.xlsx", "test/files/Bibelbund.xml", "test/files/Bibelbund1.ods", "test/files/Pfand_from_windows_phone.xlsx", "test/files/bad_excel_date.xls", "test/files/bbu.ods", "test/files/bbu.xls", "test/files/bbu.xlsx", "test/files/bbu.xml", "test/files/bode-v1.ods.zip", "test/files/bode-v1.xls.zip", "test/files/boolean.csv", "test/files/boolean.ods", "test/files/boolean.xls", "test/files/boolean.xlsx", "test/files/boolean.xml", "test/files/borders.ods", "test/files/borders.xls", "test/files/borders.xlsx", "test/files/borders.xml", "test/files/bug-numbered-sheet-names.xlsx", "test/files/bug-row-column-fixnum-float.xls", "test/files/bug-row-column-fixnum-float.xml", "test/files/comments.ods", "test/files/comments.xls", "test/files/comments.xlsx", "test/files/csvtypes.csv", "test/files/datetime.ods", "test/files/datetime.xls", "test/files/datetime.xlsx", "test/files/datetime.xml", "test/files/datetime_floatconv.xls", "test/files/datetime_floatconv.xml", "test/files/dreimalvier.ods", "test/files/emptysheets.ods", "test/files/emptysheets.xls", "test/files/emptysheets.xlsx", "test/files/emptysheets.xml", "test/files/excel2003.xml", "test/files/false_encoding.xls", "test/files/false_encoding.xml", "test/files/file_item_error.xlsx", "test/files/formula.ods", "test/files/formula.xls", "test/files/formula.xlsx", "test/files/formula.xml", "test/files/formula_parse_error.xls", "test/files/formula_parse_error.xml", "test/files/formula_string_error.xlsx", "test/files/html-escape.ods", "test/files/link.xls", "test/files/link.xlsx", "test/files/matrix.ods", "test/files/matrix.xls", "test/files/named_cells.ods", "test/files/named_cells.xls", "test/files/named_cells.xlsx", "test/files/no_spreadsheet_file.txt", "test/files/numbers1.csv", "test/files/numbers1.ods", "test/files/numbers1.xls", "test/files/numbers1.xlsx", "test/files/numbers1.xml", "test/files/only_one_sheet.ods", "test/files/only_one_sheet.xls", "test/files/only_one_sheet.xlsx", "test/files/only_one_sheet.xml", "test/files/paragraph.ods", "test/files/paragraph.xls", "test/files/paragraph.xlsx", "test/files/paragraph.xml", "test/files/prova.xls", "test/files/ric.ods", "test/files/simple_spreadsheet.ods", "test/files/simple_spreadsheet.xls", "test/files/simple_spreadsheet.xlsx", "test/files/simple_spreadsheet.xml", "test/files/simple_spreadsheet_from_italo.ods", "test/files/simple_spreadsheet_from_italo.xls", "test/files/simple_spreadsheet_from_italo.xml", "test/files/so_datetime.csv", "test/files/style.ods", "test/files/style.xls", "test/files/style.xlsx", "test/files/style.xml", "test/files/time-test.csv", "test/files/time-test.ods", "test/files/time-test.xls", "test/files/time-test.xlsx", "test/files/time-test.xml", "test/files/type_excel.ods", "test/files/type_excel.xlsx", "test/files/type_excelx.ods", "test/files/type_excelx.xls", "test/files/type_openoffice.xls", "test/files/type_openoffice.xlsx", "test/files/whitespace.ods", "test/files/whitespace.xls", "test/files/whitespace.xlsx", "test/files/whitespace.xml", "test/rm_sub_test.rb", "test/rm_test.rb", "test/test_generic_spreadsheet.rb", "test/test_helper.rb", "test/test_roo.rb"]
16
+ spec.files = `git ls-files -z`.split("\x0")
17
+ spec.files.reject! { |fn| fn.include?('test/files') }
18
+ spec.require_paths = ['lib']
183
19
 
184
- if s.respond_to? :specification_version then
185
- s.specification_version = 4
186
-
187
- if Gem::Version.new(Gem::VERSION) >= Gem::Version.new('1.2.0') then
188
- s.add_runtime_dependency(%q<spreadsheet>, ["> 0.6.4"])
189
- s.add_runtime_dependency(%q<nokogiri>, [">= 0"])
190
- s.add_runtime_dependency(%q<rubyzip>, [">= 0"])
191
- s.add_development_dependency(%q<google_drive>, [">= 0"])
192
- s.add_development_dependency(%q<jeweler>, [">= 0"])
193
- else
194
- s.add_dependency(%q<spreadsheet>, ["> 0.6.4"])
195
- s.add_dependency(%q<nokogiri>, [">= 0"])
196
- s.add_dependency(%q<rubyzip>, [">= 0"])
197
- s.add_dependency(%q<google_drive>, [">= 0"])
198
- s.add_dependency(%q<jeweler>, [">= 0"])
199
- end
20
+ if defined?(RUBY_ENGINE) && RUBY_ENGINE == 'jruby'
21
+ spec.required_ruby_version = ">= 2.6.0"
200
22
  else
201
- s.add_dependency(%q<spreadsheet>, ["> 0.6.4"])
202
- s.add_dependency(%q<nokogiri>, [">= 0"])
203
- s.add_dependency(%q<rubyzip>, [">= 0"])
204
- s.add_dependency(%q<google_drive>, [">= 0"])
205
- s.add_dependency(%q<jeweler>, [">= 0"])
23
+ spec.required_ruby_version = ">= 2.7.0"
206
24
  end
207
- end
208
25
 
26
+ spec.add_dependency 'nokogiri', '~> 1'
27
+ spec.add_dependency 'rubyzip', '>= 1.3.0', '< 3.0.0'
28
+
29
+ spec.add_development_dependency 'rake'
30
+ spec.add_development_dependency 'minitest', '~> 5.4', '>= 5.4.3'
31
+ spec.add_development_dependency 'rack', '~> 1.6', '< 2.0.0'
32
+ if RUBY_VERSION >= '3.0.0'
33
+ spec.add_development_dependency 'matrix'
34
+ end
35
+ end
data/spec/helpers.rb ADDED
@@ -0,0 +1,5 @@
1
+ module Helpers
2
+ def yaml_entry(row,col,type,value)
3
+ "cell_#{row}_#{col}: \n row: #{row} \n col: #{col} \n celltype: #{type} \n value: #{value} \n"
4
+ end
5
+ end