Class: CreateVendorDir

Inherits:
Object
  • Object
show all
Defined in:
lib/createDir.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(vendorName) ⇒ CreateVendorDir

Returns a new instance of CreateVendorDir.



17
18
19
20
21
# File 'lib/createDir.rb', line 17

def initialize(vendorName)
  @vendorName=vendorName
 # private @vendorNamePrivate=vendorName

end

Instance Attribute Details

#vendorNameObject (readonly)

Returns the value of attribute vendorName.



15
16
17
# File 'lib/createDir.rb', line 15

def vendorName
  @vendorName
end

Instance Method Details

#createDirObject



23
24
25
26
27
28
29
30
31
32
# File 'lib/createDir.rb', line 23

def createDir
  # self.initializeLog
  if (@vendorName != '')
   # self.class.runCodeToCreateDirectory
    self.runCodeToCreateDirectory
    #return true
  else
    return false
  end
end

#runCodeToCreateDirectoryObject

def self.runCodeToCreateDirectory



45
46
47
48
49
50
51
52
53
54
55
# File 'lib/createDir.rb', line 45

def runCodeToCreateDirectory
 # puts "vendorname:#{@@vendorNamePrivate}"
  begin
  #exit_status=system('mkdir "vendor\\FeedFiles\\@vendorName.to_s" >> log/NewVendorTable.log')
  exit_status=system("mkdir -p vendor/FeedFiles/#{vendorName} >> log/CreateVendorDir.log")
  puts "#{exit_status}Directory is created"
  rescue Exception, NameError => nonerror
    system('puts "#{exit_status}: Exception with Error" + nonerror >> log/CreateVendorDir.log')
  end
  return exit_status.to_s
end