jruby_excelcom 0.0.1-java

Sign up to get free protection for your applications and to get access to all the features.
Files changed (72) hide show
  1. checksums.yaml +7 -0
  2. data/.//jruby_excelcom.gemspec +13 -0
  3. data/LICENSE +201 -0
  4. data/doc/ExcelColor.html +95 -0
  5. data/doc/ExcelConnection.html +709 -0
  6. data/doc/JavaExcelcom.html +95 -0
  7. data/doc/LICENSE.html +283 -0
  8. data/doc/MiniTest.html +95 -0
  9. data/doc/Object.html +153 -0
  10. data/doc/Time.html +95 -0
  11. data/doc/Workbook.html +520 -0
  12. data/doc/Worksheet.html +1111 -0
  13. data/doc/created.rid +12 -0
  14. data/doc/css/fonts.css +167 -0
  15. data/doc/css/rdoc.css +590 -0
  16. data/doc/fonts/Lato-Light.ttf +0 -0
  17. data/doc/fonts/Lato-LightItalic.ttf +0 -0
  18. data/doc/fonts/Lato-Regular.ttf +0 -0
  19. data/doc/fonts/Lato-RegularItalic.ttf +0 -0
  20. data/doc/fonts/SourceCodePro-Bold.ttf +0 -0
  21. data/doc/fonts/SourceCodePro-Regular.ttf +0 -0
  22. data/doc/images/add.png +0 -0
  23. data/doc/images/arrow_up.png +0 -0
  24. data/doc/images/brick.png +0 -0
  25. data/doc/images/brick_link.png +0 -0
  26. data/doc/images/bug.png +0 -0
  27. data/doc/images/bullet_black.png +0 -0
  28. data/doc/images/bullet_toggle_minus.png +0 -0
  29. data/doc/images/bullet_toggle_plus.png +0 -0
  30. data/doc/images/date.png +0 -0
  31. data/doc/images/delete.png +0 -0
  32. data/doc/images/find.png +0 -0
  33. data/doc/images/loadingAnimation.gif +0 -0
  34. data/doc/images/macFFBgHack.png +0 -0
  35. data/doc/images/package.png +0 -0
  36. data/doc/images/page_green.png +0 -0
  37. data/doc/images/page_white_text.png +0 -0
  38. data/doc/images/page_white_width.png +0 -0
  39. data/doc/images/plugin.png +0 -0
  40. data/doc/images/ruby.png +0 -0
  41. data/doc/images/tag_blue.png +0 -0
  42. data/doc/images/tag_green.png +0 -0
  43. data/doc/images/transparent.png +0 -0
  44. data/doc/images/wrench.png +0 -0
  45. data/doc/images/wrench_orange.png +0 -0
  46. data/doc/images/zoom.png +0 -0
  47. data/doc/index.html +103 -0
  48. data/doc/jruby_excelcom_gemspec.html +98 -0
  49. data/doc/js/darkfish.js +161 -0
  50. data/doc/js/jquery.js +4 -0
  51. data/doc/js/navigation.js +142 -0
  52. data/doc/js/navigation.js.gz +0 -0
  53. data/doc/js/search.js +109 -0
  54. data/doc/js/search_index.js +1 -0
  55. data/doc/js/search_index.js.gz +0 -0
  56. data/doc/js/searcher.js +228 -0
  57. data/doc/js/searcher.js.gz +0 -0
  58. data/doc/table_of_contents.html +337 -0
  59. data/lib/jars/excelcom-0.0.5.jar +0 -0
  60. data/lib/jars/jna-4.4.0.jar +0 -0
  61. data/lib/jars/jna-platform-4.4.0.jar +0 -0
  62. data/lib/jruby_excelcom/excel_connection.rb +81 -0
  63. data/lib/jruby_excelcom/workbook.rb +46 -0
  64. data/lib/jruby_excelcom/worksheet.rb +136 -0
  65. data/lib/jruby_excelcom.rb +22 -0
  66. data/test/resources/test.xlsx +0 -0
  67. data/test/resources/test2.xlsx +0 -0
  68. data/test/test_helper.rb +4 -0
  69. data/test/unit/excel_connection_spec.rb +38 -0
  70. data/test/unit/workbook_spec.rb +41 -0
  71. data/test/unit/worksheet_spec.rb +100 -0
  72. metadata +114 -0
@@ -0,0 +1,41 @@
1
+ # encoding: utf-8
2
+
3
+ require 'minitest/autorun'
4
+ require_relative '../../lib/jruby_excelcom'
5
+
6
+ describe 'Workbook' do
7
+
8
+ Minitest.after_run {
9
+ $wb.close unless $wb.nil?; $wb = nil
10
+ $con.quit unless $con.nil?; $con = nil
11
+ File.delete($temp_file_path) if not $temp_file_path.nil? and File.exists?($temp_file_path)
12
+ }
13
+
14
+ $con ||= begin
15
+ e = ExcelConnection::connect
16
+ e.display_alerts = false
17
+ e
18
+ end
19
+ $wb ||= $con.workbook("#{File.dirname(File.absolute_path(__FILE__))}/../resources/test.xlsx")
20
+ $temp_file_path ||= "#{Dir::tmpdir}/test.xlsx"
21
+
22
+ it '#name' do
23
+ $wb.name.must_equal 'test.xlsx'
24
+ end
25
+
26
+ it '#save_as' do
27
+ $wb.save_as($temp_file_path)
28
+ File.exist?($temp_file_path).must_equal true
29
+ end
30
+
31
+ it '#worksheet' do
32
+ $wb.worksheet('Tabelle1').wont_be_nil
33
+ end
34
+
35
+ it '#add_worksheet' do
36
+ $wb.add_worksheet('test123')
37
+ $wb.worksheet('test123').wont_be_nil
38
+ $wb.worksheet('test123').delete
39
+ end
40
+
41
+ end
@@ -0,0 +1,100 @@
1
+ # encoding: utf-8
2
+
3
+ require 'minitest/autorun'
4
+ require 'time'
5
+ require_relative '../../lib/jruby_excelcom'
6
+
7
+ describe 'Worksheet' do
8
+
9
+ $con ||= begin
10
+ e = ExcelConnection::connect
11
+ e.display_alerts = false
12
+ e
13
+ end
14
+ $wb ||= $con.workbook("#{File.dirname(File.absolute_path(__FILE__))}/../resources/test.xlsx")
15
+
16
+ Minitest.after_run {
17
+ $wb.close unless $wb.nil?; $wb = nil
18
+ $con.quit unless $con.nil?; $con = nil
19
+ }
20
+
21
+ before do
22
+ $ws = $wb.add_worksheet 'test'
23
+ end
24
+
25
+ after do
26
+ $ws.delete
27
+ $ws = nil
28
+ end
29
+
30
+ it '#content' do
31
+ range = 'A2:B5'
32
+ content = [['A22', 123], [54.6, 23.5], ['äöüß', '#?-'], [Time::parse('2017-03-03'), 1234567]]
33
+ $ws.set_content(range, content)
34
+
35
+ actual = $ws.content(range)
36
+ actual[0][0].must_equal content[0][0]
37
+ actual[0][1].must_equal content[0][1]
38
+ actual[1][0].must_equal content[1][0]
39
+ actual[1][1].must_equal content[1][1]
40
+ actual[2][0].must_equal content[2][0]
41
+ actual[2][1].must_equal content[2][1]
42
+ actual[3][0].must_equal content[3][0]
43
+ actual[3][1].must_equal content[3][1]
44
+ end
45
+
46
+ it '#content=' do
47
+ # check single cell
48
+ range = 'A1'
49
+ content = 123
50
+ $ws.content = {:range => range, :content => content}
51
+ actual = $ws.content range
52
+ actual.must_equal content
53
+
54
+ # check column
55
+ range = 'A2:A3'
56
+ content = [123, 456]
57
+ $ws.content = {:range => range, :content => content}
58
+ actual = $ws.content range
59
+ actual.must_equal content
60
+
61
+ # check row
62
+ range = 'A4:B4'
63
+ content = [123, 654]
64
+ $ws.content = {:range => range, :content => content}
65
+ actual = $ws.content range
66
+ actual.must_equal content
67
+
68
+ # check matrix
69
+ range = 'A5:B6'
70
+ content = [[235, 7911], [13,17]]
71
+ $ws.content = {:range => range, :content => content}
72
+ actual = $ws.content range
73
+ actual.must_equal content
74
+ end
75
+
76
+ it '#fill_color' do
77
+ range = 'A1'
78
+ color = ExcelColor::RED
79
+ $ws.fill_color = {:range => range, :color => color}
80
+ actual = $ws.fill_color range
81
+ actual.must_equal color
82
+ end
83
+
84
+ it '#font_color' do
85
+ range = 'A1'
86
+ color = ExcelColor::RED
87
+ $ws.font_color = {:range => range, :color => color}
88
+ actual = $ws.font_color range
89
+ actual.must_equal color
90
+ end
91
+
92
+ it '#border_color' do
93
+ range = 'A1'
94
+ color = ExcelColor::RED
95
+ $ws.border_color = {:range => range, :color => color}
96
+ actual = $ws.border_color range
97
+ actual.must_equal color
98
+ end
99
+
100
+ end
metadata ADDED
@@ -0,0 +1,114 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: jruby_excelcom
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.0.1
5
+ platform: java
6
+ authors:
7
+ - lprc
8
+ autorequire:
9
+ bindir: bin
10
+ cert_chain: []
11
+ date: 2017-06-21 00:00:00.000000000 Z
12
+ dependencies: []
13
+ description: Uses the java library excelcom and JNA for modifying excel spreadsheets.
14
+ Works on windows only.
15
+ email:
16
+ executables: []
17
+ extensions: []
18
+ extra_rdoc_files: []
19
+ files:
20
+ - ".\\jruby_excelcom.gemspec"
21
+ - LICENSE
22
+ - doc/ExcelColor.html
23
+ - doc/ExcelConnection.html
24
+ - doc/JavaExcelcom.html
25
+ - doc/LICENSE.html
26
+ - doc/MiniTest.html
27
+ - doc/Object.html
28
+ - doc/Time.html
29
+ - doc/Workbook.html
30
+ - doc/Worksheet.html
31
+ - doc/created.rid
32
+ - doc/css/fonts.css
33
+ - doc/css/rdoc.css
34
+ - doc/fonts/Lato-Light.ttf
35
+ - doc/fonts/Lato-LightItalic.ttf
36
+ - doc/fonts/Lato-Regular.ttf
37
+ - doc/fonts/Lato-RegularItalic.ttf
38
+ - doc/fonts/SourceCodePro-Bold.ttf
39
+ - doc/fonts/SourceCodePro-Regular.ttf
40
+ - doc/images/add.png
41
+ - doc/images/arrow_up.png
42
+ - doc/images/brick.png
43
+ - doc/images/brick_link.png
44
+ - doc/images/bug.png
45
+ - doc/images/bullet_black.png
46
+ - doc/images/bullet_toggle_minus.png
47
+ - doc/images/bullet_toggle_plus.png
48
+ - doc/images/date.png
49
+ - doc/images/delete.png
50
+ - doc/images/find.png
51
+ - doc/images/loadingAnimation.gif
52
+ - doc/images/macFFBgHack.png
53
+ - doc/images/package.png
54
+ - doc/images/page_green.png
55
+ - doc/images/page_white_text.png
56
+ - doc/images/page_white_width.png
57
+ - doc/images/plugin.png
58
+ - doc/images/ruby.png
59
+ - doc/images/tag_blue.png
60
+ - doc/images/tag_green.png
61
+ - doc/images/transparent.png
62
+ - doc/images/wrench.png
63
+ - doc/images/wrench_orange.png
64
+ - doc/images/zoom.png
65
+ - doc/index.html
66
+ - doc/jruby_excelcom_gemspec.html
67
+ - doc/js/darkfish.js
68
+ - doc/js/jquery.js
69
+ - doc/js/navigation.js
70
+ - doc/js/navigation.js.gz
71
+ - doc/js/search.js
72
+ - doc/js/search_index.js
73
+ - doc/js/search_index.js.gz
74
+ - doc/js/searcher.js
75
+ - doc/js/searcher.js.gz
76
+ - doc/table_of_contents.html
77
+ - lib/jars/excelcom-0.0.5.jar
78
+ - lib/jars/jna-4.4.0.jar
79
+ - lib/jars/jna-platform-4.4.0.jar
80
+ - lib/jruby_excelcom.rb
81
+ - lib/jruby_excelcom/excel_connection.rb
82
+ - lib/jruby_excelcom/workbook.rb
83
+ - lib/jruby_excelcom/worksheet.rb
84
+ - test/resources/test.xlsx
85
+ - test/resources/test2.xlsx
86
+ - test/test_helper.rb
87
+ - test/unit/excel_connection_spec.rb
88
+ - test/unit/workbook_spec.rb
89
+ - test/unit/worksheet_spec.rb
90
+ homepage: http://rubygems.org/gems/jruby_excelcom
91
+ licenses:
92
+ - Apache-2.0
93
+ metadata: {}
94
+ post_install_message:
95
+ rdoc_options: []
96
+ require_paths:
97
+ - lib
98
+ required_ruby_version: !ruby/object:Gem::Requirement
99
+ requirements:
100
+ - - ">="
101
+ - !ruby/object:Gem::Version
102
+ version: '0'
103
+ required_rubygems_version: !ruby/object:Gem::Requirement
104
+ requirements:
105
+ - - ">="
106
+ - !ruby/object:Gem::Version
107
+ version: '0'
108
+ requirements: []
109
+ rubyforge_project:
110
+ rubygems_version: 2.5.2
111
+ signing_key:
112
+ specification_version: 4
113
+ summary: Excel spreadsheet modification using COM
114
+ test_files: []