0.0
No commit activity in last 3 years
No release in over 3 years
provides methods to validate the content of an excel(xls/xlsx) file
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0
>= 0

Runtime

~> 1.13.2
 Project Readme

Gem Version

ExcelValidator

provides methods to validate the content of an excel(xls/xlsx) file

Installation

Add this line to your application's Gemfile: gem 'excel_validator'

And then execute: $ bundle

Or install it yourself as: $ gem install excel_validator

Usage

require 'excel_validator'

f = ExcelValidator::ValidateFile.new(file_name, file_path)

  1. f.number_of_sheets_is?(5)

#returns true if the number of sheets in the file is 5.

  1. f.names_of_sheets_are?({1: 'Banks', 2: 'Countries', 3: 'Metrics'})

#returns true if the names of the sheets at each position is as specified. If the names are case sensitive , do f.names_of_sheets_are?({1: 'Banks', 2: 'Countries', 3: 'Metrics'}, true)

  1. f.first_row_is?(2, 5)

#returns true if the first non-empty row of 2nd sheet in the file is 12

  1. f.last_row_is?(2,100)

#returns true if the first non-empty row of 2nd sheet in the file is 100

  1. f.first_column_is?(2, 'B')

#returns true if the first non-empty row of 2nd sheet in the file is 'B'

  1. f.last_column_is?(2, 'CK')

#returns true if the first non-empty row of 2nd sheet in the file is 'CK'

  1. f.column_is_empty?(2, 'B')

#returns true if the 'B' column of 2nd sheet in the file is completely empty

  1. f.row_is_empty?(2, 12)

#returns true if the 12th row of 2nd sheet in the file is completely empty

  1. f.content_of_cell_is?(2, 3, 'C', 'Location', true)

#returns true if at 2nd sheet in the file Row3, Column C, content is 'Location'. If the content is case sensitive , do

  1. f.empty_sheets_present?

#returns true if there are empty sheets present in the file.

  1. f.keyword_present?(2, 'ClassA')

#returns true if keyword 'ClassA' is present the 2nd sheet of the file. If the keyword is case sensitive, do f.keyword_present?(2, 'ClassA', true)

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request