workbook 0.8.0 → 0.8.1

Sign up to get free protection for your applications and to get access to all the features.
Files changed (68) hide show
  1. checksums.yaml +4 -4
  2. data/.ruby-version +1 -1
  3. data/CHANGELOG.md +9 -0
  4. data/Gemfile +3 -1
  5. data/Rakefile +3 -1
  6. data/lib/workbook.rb +2 -0
  7. data/lib/workbook/book.rb +2 -0
  8. data/lib/workbook/cell.rb +2 -0
  9. data/lib/workbook/column.rb +4 -3
  10. data/lib/workbook/format.rb +2 -0
  11. data/lib/workbook/generatetypes.rb +2 -1
  12. data/lib/workbook/modules/cache.rb +3 -1
  13. data/lib/workbook/modules/cell.rb +2 -0
  14. data/lib/workbook/modules/diff_sort.rb +2 -0
  15. data/lib/workbook/modules/raw_objects_storage.rb +2 -0
  16. data/lib/workbook/modules/type_parser.rb +2 -0
  17. data/lib/workbook/nil_value.rb +1 -0
  18. data/lib/workbook/readers/csv_reader.rb +1 -0
  19. data/lib/workbook/readers/ods_reader.rb +2 -0
  20. data/lib/workbook/readers/txt_reader.rb +2 -0
  21. data/lib/workbook/readers/xls_reader.rb +2 -0
  22. data/lib/workbook/readers/xls_shared.rb +2 -0
  23. data/lib/workbook/readers/xlsx_reader.rb +3 -1
  24. data/lib/workbook/row.rb +2 -0
  25. data/lib/workbook/sheet.rb +2 -0
  26. data/lib/workbook/table.rb +2 -0
  27. data/lib/workbook/template.rb +2 -0
  28. data/lib/workbook/types/date.rb +2 -1
  29. data/lib/workbook/types/false.rb +2 -1
  30. data/lib/workbook/types/false_class.rb +2 -1
  31. data/lib/workbook/types/nil.rb +2 -1
  32. data/lib/workbook/types/nil_class.rb +2 -1
  33. data/lib/workbook/types/numeric.rb +2 -1
  34. data/lib/workbook/types/string.rb +2 -1
  35. data/lib/workbook/types/time.rb +2 -1
  36. data/lib/workbook/types/true.rb +2 -1
  37. data/lib/workbook/types/true_class.rb +2 -1
  38. data/lib/workbook/version.rb +3 -1
  39. data/lib/workbook/writers/csv_table_writer.rb +2 -0
  40. data/lib/workbook/writers/html_writer.rb +2 -0
  41. data/lib/workbook/writers/json_table_writer.rb +2 -0
  42. data/lib/workbook/writers/xls_writer.rb +2 -0
  43. data/lib/workbook/writers/xlsx_writer.rb +2 -0
  44. data/test/helper.rb +2 -0
  45. data/test/test_book.rb +2 -0
  46. data/test/test_column.rb +3 -1
  47. data/test/test_format.rb +2 -0
  48. data/test/test_functional.rb +2 -0
  49. data/test/test_modules_cache.rb +2 -0
  50. data/test/test_modules_cell.rb +2 -0
  51. data/test/test_modules_table_diff_sort.rb +2 -0
  52. data/test/test_modules_type_parser.rb +2 -0
  53. data/test/test_readers_csv_reader.rb +2 -0
  54. data/test/test_readers_ods_reader.rb +2 -0
  55. data/test/test_readers_txt_reader.rb +2 -0
  56. data/test/test_readers_xls_reader.rb +2 -0
  57. data/test/test_readers_xls_shared.rb +3 -1
  58. data/test/test_readers_xlsx_reader.rb +2 -0
  59. data/test/test_row.rb +2 -0
  60. data/test/test_sheet.rb +2 -0
  61. data/test/test_table.rb +2 -0
  62. data/test/test_template.rb +2 -0
  63. data/test/test_types_date.rb +3 -1
  64. data/test/test_writers_html_writer.rb +2 -0
  65. data/test/test_writers_json_writer.rb +2 -0
  66. data/test/test_writers_xls_writer.rb +2 -0
  67. data/test/test_writers_xlsx_writer.rb +2 -0
  68. metadata +4 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 2d11f35120106855bbb5905a7f2611b138293157e135f86b0d8f5248c90f5f83
4
- data.tar.gz: ced9b91f1f1f69bbe90151ef78f61885a1ced541c5d3392e46dcb4e7770b58da
3
+ metadata.gz: 87ff9d1b27ed349f1b788ec37cf0ca3e743353abf6281badaebd2a9a5efa4355
4
+ data.tar.gz: 52f399ec0e3ea2acead3f918cf9b43b942dc158ee321e19239eff71563f4f6ba
5
5
  SHA512:
6
- metadata.gz: 1abccd53682ea4a4718153f0409e43925108740004dfbbba78419d4f80dd7a23add4677c7430812253a6e5559322b1919fb0f2c8f4450575804c8aae68056db6
7
- data.tar.gz: 6eb31d092e13c909e6d96d78a594bd3c1e9abd01d88a8cb76fc133c128035786d7f06651123e4c2f0798fa7d8b275f6914ed21152a0eab94efbb80e03083cb95
6
+ metadata.gz: 151d666f60f1edcb99ba8dfaa35d4cb8e6bebe33bcb3e15543f80f22b62593fa02dd8a45e74fd680260296f2a398008a07fc227dddaafa21958eb0a0a65f8cfb
7
+ data.tar.gz: eb0fcf133fe88aed80b42c91e9c3cec2f94820c7fb33eda606b0f5c97f1d7cf1368f6de52508655790af0ebd03a5952e6099d8293b1a3329ffd13d156c20fb76
@@ -1 +1 @@
1
- 2.6.0
1
+ 2.6.2
@@ -0,0 +1,9 @@
1
+ # Changelog
2
+
3
+
4
+ ### 0.8.0
5
+
6
+ * Dropped support for ruby < 2.3.0
7
+ * Added support for 2.6.0
8
+ * Stripping strings before calling to_sym (possibly breaking, as symbols can be used to address columns)
9
+ * Started maintaining a changelog
data/Gemfile CHANGED
@@ -1,6 +1,8 @@
1
+ # frozen_string_literal: true
2
+
1
3
  source "http://rubygems.org"
2
4
 
3
5
  # Specify your gem's dependencies in workbook.gemspec
4
6
 
5
7
  gemspec
6
- gem 'rubyzip', :require => 'zip/zip'
8
+ gem 'rubyzip', :require => 'zip/zip'
data/Rakefile CHANGED
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  require 'rake'
2
4
  require 'rake/testtask'
3
5
  require 'bundler'
@@ -11,4 +13,4 @@ Rake::TestTask.new do |t|
11
13
  t.libs << "test"
12
14
  t.test_files = FileList['test/test*.rb','test/writers/test*.rb']
13
15
  t.verbose = false
14
- end
16
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require_relative 'workbook/modules/cache'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'open-uri'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'workbook/modules/cell'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -84,13 +86,12 @@ module Workbook
84
86
  # @param [String] string that typically identifies a column
85
87
  # @return [Integer]
86
88
  def alpha_index_to_number_index string
87
- string.upcase!
88
89
  sum = 0
89
- string.chars.each_with_index do | char, char_index|
90
+ string.upcase.chars.each_with_index do | char, char_index|
90
91
  sum = sum * 26 + char.unpack('U')[0]-64
91
92
  end
92
93
  return sum-1
93
94
  end
94
95
  end
95
96
  end
96
- end
97
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'workbook/modules/raw_objects_storage'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  ["Numeric","String","Time","Date","TrueClass","FalseClass","NilClass"].each do |type|
3
4
  f = File.open(File.join(File.dirname(__FILE__),"types","#{type}.rb"),'w+')
4
5
  puts f.inspect
@@ -12,4 +13,4 @@ module Workbook
12
13
  end
13
14
  end"
14
15
  f.write(doc)
15
- end
16
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -50,4 +52,4 @@ module Workbook
50
52
  end
51
53
  end
52
54
  end
53
- end
55
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'workbook/modules/type_parser'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Workbook
3
4
 
4
5
  # Used in cases col or rowspans are used
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  # -*- encoding : utf-8 -*-
3
4
 
4
5
  module Workbook
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'spreadsheet'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'date'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'workbook/readers/xls_shared'
@@ -205,4 +207,4 @@ module Workbook
205
207
  end
206
208
  end
207
209
  end
208
- end
210
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'workbook/modules/diff_sort'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'workbook/modules/raw_objects_storage'
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Workbook
3
4
  module Types
4
5
  class Date < Date
@@ -17,4 +18,4 @@ module Workbook
17
18
  end
18
19
  end
19
20
  end
20
- end
21
+ end
@@ -1 +1,2 @@
1
- # frozen_string_literal: true
1
+ # frozen_string_literal: true
2
+
@@ -1,8 +1,9 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  module Workbook
3
4
  module Types
4
5
  class FalseClass < FalseClass
5
6
  include Workbook::Modules::Cell
6
7
  end
7
8
  end
8
- end
9
+ end
@@ -1 +1,2 @@
1
- # frozen_string_literal: true
1
+ # frozen_string_literal: true
2
+
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'workbook/cell'
3
4
 
4
5
  module Workbook
@@ -7,4 +8,4 @@ module Workbook
7
8
  include Workbook::Cell
8
9
  end
9
10
  end
10
- end
11
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'workbook/cell'
3
4
 
4
5
  module Workbook
@@ -7,4 +8,4 @@ module Workbook
7
8
  include Workbook::Cell
8
9
  end
9
10
  end
10
- end
11
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'workbook/cell'
3
4
 
4
5
  module Workbook
@@ -7,4 +8,4 @@ module Workbook
7
8
  include Workbook::Cell
8
9
  end
9
10
  end
10
- end
11
+ end
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'workbook/cell'
3
4
 
4
5
  module Workbook
@@ -7,4 +8,4 @@ module Workbook
7
8
  include Workbook::Cell
8
9
  end
9
10
  end
10
- end
11
+ end
@@ -1 +1,2 @@
1
- # frozen_string_literal: true
1
+ # frozen_string_literal: true
2
+
@@ -1,4 +1,5 @@
1
1
  # frozen_string_literal: true
2
+
2
3
  require 'workbook/cell'
3
4
 
4
5
  module Workbook
@@ -7,4 +8,4 @@ module Workbook
7
8
  include Workbook::Cell
8
9
  end
9
10
  end
10
- end
11
+ end
@@ -1,5 +1,7 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  module Workbook
4
- VERSION = '0.8.0'
6
+ VERSION = '0.8.1'
5
7
  end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'csv'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'spreadsheet'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'json'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'spreadsheet'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  # frozen_string_literal: true
3
5
  require 'axlsx'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require 'minitest/autorun'
3
5
  # require 'test/unit'
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -62,4 +64,4 @@ class TestColumn < Minitest::Test
62
64
  assert_equal(52,Workbook::Column.alpha_index_to_number_index("BA"))
63
65
  assert_equal((27*26)-1,Workbook::Column.alpha_index_to_number_index("ZZ"))
64
66
  end
65
- end
67
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Modules
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Modules
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Readers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Readers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Readers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Readers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Readers
@@ -7,4 +9,4 @@ module Readers
7
9
  assert_equal(DateTime.new(2011,11,15),w.xls_number_to_time(40862))
8
10
  end
9
11
  end
10
- end
12
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
  module Readers
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -11,4 +13,4 @@ class TestTypesDate < Minitest::Test
11
13
  assert_equal(true, w.is_a?(Workbook::Modules::Cell))
12
14
 
13
15
  end
14
- end
16
+ end
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
@@ -1,3 +1,5 @@
1
+ # frozen_string_literal: true
2
+
1
3
  # -*- encoding : utf-8 -*-
2
4
  require File.join(File.dirname(__FILE__), 'helper')
3
5
 
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: workbook
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.8.0
4
+ version: 0.8.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Maarten Brouwers
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2019-02-27 00:00:00.000000000 Z
11
+ date: 2019-03-27 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: ruby-prof
@@ -140,6 +140,7 @@ files:
140
140
  - ".yardoc/objects/root.dat"
141
141
  - ".yardoc/proxy_types"
142
142
  - ".yardopts"
143
+ - CHANGELOG.md
143
144
  - Gemfile
144
145
  - LICENSE.txt
145
146
  - README.md
@@ -258,7 +259,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
258
259
  - !ruby/object:Gem::Version
259
260
  version: '0'
260
261
  requirements: []
261
- rubygems_version: 3.0.1
262
+ rubygems_version: 3.0.3
262
263
  signing_key:
263
264
  specification_version: 4
264
265
  summary: Workbook is a datastructure to contain books of tables (an anlogy used in