Skip to content

Commit 1047068

Browse files
Merge pull request #11 from masood-anwer/master
Aspose.Cells Java for Ruby - Version 0.0.2
2 parents b897898 + 739d6a9 commit 1047068

File tree

5 files changed

+34
-6
lines changed

5 files changed

+34
-6
lines changed

Plugins/Aspose_Cells_Java_for_Ruby/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Aspose_Cells_Java_For_Ruby
1+
# Aspose_Cells_Java_for_Ruby
22
Aspose Cells Java for Ruby is a gem that demonstrates / provides the Aspose.Cells for Java API usage examples in Ruby by using Rjb - Ruby Java Bridge.
33

44
## Installation
@@ -23,14 +23,14 @@ http://www.aspose.com/community/files/72/java-components/aspose.cells-for-java/
2323

2424
For most complete documentation of the project, check Aspose.Cells Java for Ruby confluence wiki link:
2525

26-
http://www.aspose.com/docs/display/cellssjava/3.+Aspose.Cells+Java+For+Ruby
26+
http://www.aspose.com/docs/display/cellsjava/4.+Aspose.Cells+Java+For+Ruby
2727

2828
## Usage
2929

3030
```ruby
31-
require '../lib/asposecellsjava'
31+
require require File.dirname(File.dirname(File.dirname(__FILE__))) + '/lib/asposecellsjava'
3232
include Asposecellsjava
33-
include Asposecellsjava::HideUnhideWorksheet
33+
include Asposecellsjava::HelloWorld
3434
initialize_aspose_cells
3535
```
3636
Lets understand the above code

Plugins/Aspose_Cells_Java_for_Ruby/lib/asposecellsjava/asposecells.rb

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
require_relative 'helloworld'
12
require_relative 'hideunhideworksheet'
23
require_relative 'displayhidetabs'
34
require_relative 'displayhidescrollbars'
Lines changed: 27 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,27 @@
1+
module Asposecellsjava
2+
module HelloWorld
3+
def initialize()
4+
data_dir = File.dirname(File.dirname(File.dirname(__FILE__))) + '/data/'
5+
6+
# Instantiating a Workbook object that represents a Microsoft Excel file.
7+
workbook = Rjb::import('com.aspose.cells.Workbook').new
8+
9+
# Note when you create a new workbook, a default worksheet,
10+
# "Sheet1", is by default added to the workbook.
11+
# Accessing the first worksheet in the book ("Sheet1").
12+
sheet = workbook.getWorksheets().get(0)
13+
14+
# Access cell "A1" in the sheet.
15+
cell = sheet.getCells().get("A1")
16+
17+
# Input the "Hello World!" text into the "A1" cell
18+
cell.setValue("Hello World!")
19+
20+
# Saving the modified Excel file in default (that is Excel 2003) format
21+
file_format_type = Rjb::import('com.aspose.cells.FileFormatType')
22+
workbook.save(data_dir + "HelloWorld.xls", file_format_type.EXCEL_97_TO_2003)
23+
24+
puts "Document has been saved, please check the output file."
25+
end
26+
end
27+
end
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,3 @@
11
module Asposecellsjava
2-
VERSION = '0.0.1'
2+
VERSION = '0.0.2'
33
end

Plugins/Aspose_Cells_Java_for_Ruby/samples/test.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
require '../lib/asposecellsjava'
22
include Asposecellsjava
3-
include Asposecellsjava::HideUnhideWorksheet
3+
include Asposecellsjava::HelloWorld
44

55
initialize_aspose_cells
66

0 commit comments

Comments
 (0)