> Mike Stok wrote:

Thanks to all who replied!  :)

I am trying to understand why my code is not entering my rundf method?

class FsData
    def initialize
        @rawdisk = @used = @available = @capacity = @filesystem = ""
        if ARGV.empty?
            puts "ARGV0 is required else script will not run"
            exit 1
        else
            @filesystem = ARGV[0]
        end
    end

    def rundf
        puts "entering rundf method"
        df = %x(df -m |tail +2)
        df.each do |ln|
            @rawdisk    = ln.chomp.split[1].to_i
            @used       = ln.chomp.split[2].to_i
            @available  = ln.chomp.split[3].to_i
            @capacity   = ln.chomp.split[4]
            @filesystem = ln.chomp.split[5]
        end
        puts @available
        if @available <= 4557
            p "#{@available} is low as testing"
        end
    end
end

p dff = FsData.new

__OUTPUT__

ruby  filesys_chk.rb /
#<FsData:0x8115370 @filesystem="/", @rawdisk="", @capacity="", 
@available="", @used="">
-- 
Posted via http://www.ruby-forum.com/.