lib/cotcube-scheduler/library.rb
# dig_jobs recursively reads a directory structure and considers a YAML files in there to be jobs to load
# the directory structure itself serves only to humans but does not provide a structure to joblist or batches
#
# NOTE: to ignore a specific file or directory tree, rename it ending on ignore(d)
dig_jobs recursively reads a directory structure and considers a YAML files in there to be jobs to load
the directory structure itself serves only to humans but does not provide a structure to joblist or batches

to ignore a specific file or directory tree, rename it ending on ignore(d)
dig_jobs recursively reads a directory structure and considers a YAML files in there to be jobs to load the directory structure itself serves only to humans but does not provide a structure to joblist or batches to ignore a specific file or directory tree rename it ending on ignore ( d )
def dig_jobs(dir)
        Dir[dir + '/*' ].each do |file| 
          next if file.downcase =~ /ignored?$/ 
          if File.directory?(file)
            dig_jobs file
          elsif %w[yml yaml].include? file.split('.').last.downcase
            job = Job.new(root: root, filename: file.split(root).last)
            unless find_by_name(job.name).nil? or job.name.nil?
              puts job.quick_print(status: :duplicate, message: 'Cannot enqueue job, another job with same NAME already exists.')
              next
            end
            list << job
          end
        end
      end
def dig_jobs ( dir ) Dir [ dir + '/*' ] . each do | file | next if file . downcase =~ / ignored?$ / if File . directory? ( file ) dig_jobs file elsif %w[ yml yaml ] . include? file . split ( '.' ) . last . downcase job = Job . new ( root : root , filename : file . split ( root ) . last ) unless find_by_name ( job . name ) . nil? or job . name . nil? puts job . quick_print ( status : :duplicate , message : 'Cannot enqueue job, another job with same NAME already exists.' ) next end list << job end end end
dig_jobs recursively reads a directory structure and considers a YAML files in there to be jobs to load
the directory structure itself serves only to humans but does not provide a structure to joblist or batches
dig_jobs recursively reads a directory structure and considers a YAML files in there to be jobs to load the directory structure itself serves only to humans but does not provide a structure to joblist or batches
# the following message actually is wrong, as the there is no job.status :duplicate # furthermore it is not found in the logs as there is no access to the scheduler obj here # puts job.quick_print unless @silent
dir
<not_specific>