Showing posts with label Eggplant. Show all posts
Showing posts with label Eggplant. Show all posts

Thursday, 9 May 2013

Reading Excel file using ruby


 This is an example to read excel file in ruby (this can be used for reading excel workbook as well) using RubyXL gem

Step 1) Create an excel workbook like below



 Step 2) Create a ruby file including gems
require 'rubygems'
require 'rubyXL'

Copy path to excel file and replace it in place of work book
    workbook = RubyXL::Parser.parse("/Users/username/Downloads/simple_spreadsheet.xlsm")



This first sheet of excel workbook can be read into hash table using below command
    hash_arr=workbook[0].get_table(["Login", "email", "password"])

Multiple tables can be present in same file and they will read based on the format given in the above command (this helps in organizing many data tables in single sheet of excel file)



 Step 3: If needed it can be used in cucumber file as below


Source code :


require 'rubygems'
require 'rubyXL'
workbook = RubyXL::Parser.parse("simple_spreadsheet.xlsm")
hash_arr=workbook[0].get_table(["Login", "email", "password"])
all_tables=hash_arr[:table]
puts all_tables


For more details refer to - https://github.com/gilt/rubyXL project

Output looks like below




















Sunday, 27 May 2012

jailbreak iPod touch running iOS 5.1 using Redsn0w and Install veency (VNC for IOS)

Three steps to sucess
1) jail break using redsnow (DFU procedure)
http://www.iphonehacks.com/2012/03/jailbreak-ipod-touch-4g-ipod-touch-3g-ios-5-1-using-redsn0w.html

2) Then go to cydia app and then search veency
3) change date and time in ipod to avoid untrusted server certificate
Some time when iphone isnt charged for a while it resets timer to 1970 (Unix time, or POSIX time, is a system for describing instants in time, defined as the number of seconds that have elapsed since midnight Coordinated Universal Time, January 1, 1970)
Just check time to avoid certificate issue.

I did this procedure to get Eggplant tool to run on veency(VNC) for IOS.