@raise [Exception] unless asset_options contains base_folder or :assets if an absolute path

 @return [Array] of Asset
424553
def assets(asset_options={})
      logger.debug "asset_options: #{asset_options.inspect}"
      # type of asset to create, used to guess the asset_folder name
      type = asset_options[:type] || :app_asset

      assets = []
      filters = asset_options[:filter] || ['.*']
      match_count = 0
      logger.debug "generating assets array with filter array: #{filters.join(',')}"

      assets_folder = asset_options[:assets_folder] || "assets"
      pattern = File.join(assets_folder, '*/')
      logger.debug "reading from asset type: '#{type}' from assets_folder:'#{assets_folder}' "

      # asset folder can be relative to main config file
      unless Pathname.new(pattern).absolute?
        # base_folder is determined from the configuration file
        # location, if it is not set, then the configuration file wasn't not found
        raise "configuration file not found" unless asset_options[:base_folder]
        base_folder = asset_options[:base_folder]
        pattern = File.expand_path(File.join(base_folder, pattern))
      end
      logger.debug "asset glob pattern: #{pattern}"
      folders = Dir.glob(pattern)
      logger.debug "user assets folder is empty: #{pattern}" if folders.empty?

      folders.sort.each do |folder|
        folder_basename = Pathname.new(folder).basename.to_s
        #logger.debug "matching folder: #{folder} using basename: #{folder_basename}"
        if filters.find {|filter| matches?(folder_basename, filter, asset_options)}
          logger.debug "match found for: #{folder_basename}"
          match_count += 1
          asset = RepoManager::AppAsset.create(type, folder, {})
          assets << asset
          break if ((asset_options[:match] == 'FIRST') || (asset_options[:match] == 'EXACT'))
          raise "match mode = ONE, multiple matching assets found filter" if (asset_options[:match] == 'ONE' && match_count > 1)
        end
      end

      assets
    end
228201
def setup_directories(options)
      @directories = options[:directories] || []
      [
        'app/assets/javascripts',
        'app/assets/stylesheets',
        'app/views/components'
      ].each { |known_dir|
        if !@directories.include?(known_dir) && File.exists?(known_dir)
          @directories << known_dir
        end
      }
    end
494094
def pin_assets(self, file_or_dir_path: Path) -> List[Dict[str, str]]:
        
        if file_or_dir_path.is_dir():
            asset_data = [dummy_ipfs_pin(path) for path in file_or_dir_path.glob("*")]
        elif file_or_dir_path.is_file():
            asset_data = [dummy_ipfs_pin(file_or_dir_path)]
        else:
            raise FileNotFoundError(
                f"{file_or_dir_path} is not a valid file or directory path."
            )
        return asset_data
1019822
def directories=(directories)
      valid = []

      if directories
        directories.each do |dir|
          unless File.directory?(dir)
            raise ArgumentError, "The directory #{dir} does not exist"
          end

          valid << File.expand_path(dir)
        end
      end

      @directories = valid
    end
1298837
def top_level_file(absolute_path=true)
     
      path = get_property(TopLevelFileProperty)

      #If the absolute_path flag is set, and we know how, expand the file path.
      if absolute_path
        path = File.expand_path(path, @base_path) 
      end

      #Return the relevant path.
      path

    end
1248175
def check_pseudo_package(path):
    
    if not os.path.isdir(path):
        raise Exception("Please make sure pseudo-package %s exists." % path)
    else:
        assets = os.listdir(path)
        if len(assets) == 0:
            raise Exception("Please make sure pseudo-package %s is populated." % path)
338086
def additional_assets(context: Context):
    
    rsync_flags = '-avz' if context.verbosity == 2 else '-az'
    for path in context.app.additional_asset_paths:
        context.shell('rsync %s %s %s/' % (rsync_flags, path, context.app.asset_build_path))
1338167
def absolute_path(asset_pathname, css_pathname)
      (asset_pathname.absolute? ?
        Pathname.new(File.join(Jammit.public_root, asset_pathname)) :
        css_pathname.dirname + asset_pathname).cleanpath
    end
576431
def get_existing_boxes
      # Converts the bebox boxes directory to an absolute pathname
      expanded_directory = File.expand_path("#{BEBOX_BOXES_PATH}")
      # Get an array of bebox boxes paths
      boxes = Dir["#{expanded_directory}/*"].reject {|f| File.directory? f}
      boxes.map{|box| box.split('/').last}
    end
1361392
def check_assets(self):
        
        if not self.assets_file:
            raise ImproperlyConfigured("You must specify the path to the assets.json file via WEBPACK_ASSETS_FILE")
        elif not os.path.exists(self.assets_file):
            raise ImproperlyConfigured(
                "The file `{file}` was not found, make sure to run the webpack build before the collectstatic command".format(
                    file=self.assets_file))
735489
def validate
			@folders.each do |item|
        if(item==nil) || (item=="") || !Dir.exists?(item)
          puts "a valid folder path is required as argument #{item}"
          exit
        end
      end
		end
729836
def basic_options
      Hash[BASIC_OPTION_KEYS.map { |k| [k, send(k)] }].reject {|_,v| v.nil?}
    end
277925
def load_file_exclusions
      return unless config_hash["Exclude Files"]
      config_options[:excluded_files] = []
      config_hash["Exclude Files"].each do |short_file|
        config_options[:excluded_files] << File.join(starting_path, short_file)
      end
    end
234589
def asset_folders
      folders = []
      app_folders do |app_folder|
        Dir["#{app_folder}/*/assets"].sort.each do |asset_folder|
          folders << yield(asset_folder)
        end
      end

      folders.flatten
    end
221612
def get_basedir(path):
  
  return path[:path.index(os.sep)] if os.sep in path else path
600153
def get_asset_url(self, path):
		
		url = self.root_url + '/assets/' + path
		if path in self.asset_hash:
			url += '?' + self.asset_hash[path]
		return url
629318
def path_exists?(path = @path)
      path = path.split(' ') if path.is_a?(String) && path.include?(' ')
      if path.is_a?(Array)
        path.each do |p|
          unless File.exist?(p)
            puts "#{p} does not exist"
            return false
          end
        end
      else
        path = path.gsub('/**', '').gsub('/*', '').gsub(/\/\.*/, '') if path.include?('*')
        if File.exist?(path)
          return true
        else
          puts "#{path} does not exist"
          return false
        end
      end
    end