Generate the name of the output file
 @return [String]
 @param [Gimli::MarkupFile] file optionally, specify a file, otherwise use output filename
763185
def output_file(file = nil)
      if file
        output_filename = file.name
        if !@config.output_filename.nil? && @files.length == 1
          output_filename = @config.output_filename
        end
      else
        output_filename = Time.now.to_s.split(' ').join('_')
        output_filename = @files.last.name if @files.length == 1 || @config.merge
        output_filename = @config.output_filename unless @config.output_filename.nil?
      end

      ::File.join(output_dir, "#{output_filename}.pdf")
    end
382449
private String getFilename(String filename, File file) {
        if (!file.exists()) {
            file.mkdirs();
        }
        String ext = ".jpg";
        //get extension
        /*if (Pattern.matches("^[.][p][n][g]", filename)){
            ext = ".png";
        }*/

        return (file.getAbsolutePath() + "/IMG_" + new SimpleDateFormat("yyyyMMdd_HHmmss").format(new Date()) + ext);

    }
975763
def output(self, _filename):
        

        for contract in self.slither.contracts_derived:
            txt = "\nContract %s"%contract.name
            table = PrettyTable(["Function",
                                 "require or assert"])
            for function in contract.functions:
                require = function.all_slithir_operations()
                require = [ir for ir in require if isinstance(ir, SolidityCall) and ir.function in require_or_assert]
                require = [ir.node for ir in require]
                table.add_row([function.name, self._convert([str(m.expression) for m in set(require)])])
            txt += "\n"+str(table)
            self.info(txt)
235291
def output_template(outputs)
      resource_name = outputs.keys[0]
      outputs_array = outputs.values[0].collect
      each_output_join = outputs_array.collect {|output| {"Fn::Join" => ["|", output]}}
      return resource_name => {
        'Value' => { "Fn::Join" => [ ",", each_output_join] }
      }
    end
1007207
def render_partial(file_name)
      # The "default" version of the partial.
      file_to_render = "#{@input_folder}/partials/#{file_name.to_s}.haml"
      if @scope
        # Look for a partial prefixed with the current "scope" (which is just the name of the
        # primary template being rendered).
        scope_file = "#{@input_folder}/partials/#{@scope.to_s}_#{file_name.to_s}.haml"
        # Use it if it's there.
        file_to_render = scope_file if File.exists? scope_file
      end
      # If we found a matching partial (either the scoped one or the default), render it now.
      if File.exists? file_to_render
        partial = Haml::Engine.new(File.read(file_to_render), @options)
        partial.render self
      else
        nil
      end
    rescue Exception => e
      raise $!, "#{$!} PARTIAL::#{file_name} ", $!.backtrace
    end
555215
def output_markdown(markdown_cont, output_file):
    
    if output_file:
        with open(output_file, 'w') as out:
            out.write(markdown_cont)
42462
def output(self, _filename):
        

        for c in self.contracts:
            (name, inheritance, var, func_summaries, modif_summaries) = c.get_summary()
            txt = "\nContract %s"%name
            txt += '\nContract vars: '+str(var)
            txt += '\nInheritance:: '+str(inheritance)
            table = PrettyTable(["Function",
                                 "Visibility",
                                 "Modifiers",
                                 "Read",
                                 "Write",
                                 "Internal Calls",
                                 "External Calls"])
            for (_c_name, f_name, visi, modifiers, read, write, internal_calls, external_calls) in func_summaries:
                read = self._convert(read)
                write = self._convert(write)
                internal_calls = self._convert(internal_calls)
                external_calls = self._convert(external_calls)
                table.add_row([f_name, visi, modifiers, read, write, internal_calls, external_calls])
            txt += "\n \n"+str(table)
            table = PrettyTable(["Modifiers",
                                 "Visibility",
                                 "Read",
                                 "Write",
                                 "Internal Calls",
                                 "External Calls"])
            for (_c_name, f_name, visi, _, read, write, internal_calls, external_calls) in modif_summaries:
                read = self._convert(read)
                write = self._convert(write)
                internal_calls = self._convert(internal_calls)
                external_calls = self._convert(external_calls)
                table.add_row([f_name, visi, read, write, internal_calls, external_calls])
            txt += "\n\n"+str(table)
            txt += "\n"
            self.info(txt)
708469
function generateFileName(className) {
    return className
        .replace(/component/gi, '')
        .replace(/system/gi, '')
        .replace('2D', '2d')
        .replace('3D', '3d')
        .replace(/^[A-Z]/, function(c) {
            return c.toLowerCase();
        })
        .replace(/[A-Z]/g, function(c) {
            return '-' + c.toLowerCase();
        }) + '.js';
}
361895
def generate_html
      FileUtils.rm_rf(Rails.root.join('tmp/apidocs'))
      options = [Rails.root.join("app/controllers").to_s, "--op=#{Rails.root.join('tmp/apidocs')}"]

      self.store = RDoc::Store.new

      @options = load_options
      @options.parse options
      @exclude = @options.exclude

      @last_modified = setup_output_dir @options.op_dir, @options.force_update

      @store.encoding = @options.encoding if @options.respond_to? :encoding
      @store.dry_run = @options.dry_run
      @store.main = @options.main_page
      @store.title = @options.title
      @store.path = @options.op_dir

      @start_time = Time.now
      @store.load_cache
      @options.default_title = "RDoc Documentation"

      parse_files @options.files
      @store.complete @options.visibility

      formatter = RDoc::Markup::ToHtml.new(RDoc::Options.new)

      routes = routes_by_regex.map do |r|
        {verb: r[:verb],
         path: r[:path].sub('(.:format)', ''),
         class_name: gen_class_name(r),
         action_name: gen_action_name(r)
        }
      end.each do |r|
        doc = document_route(r)
        r[:html_comment] = doc ? doc.accept(formatter) : ""
      end.select { |r| r[:class_name] != "ApidocsController" }

      puts routes.inspect
      routes
    end
192811
def output(self, _filename):
        

        txt = ''
        for contract in self.slither.contracts_derived:
            txt += '\n{}:\n'.format(contract.name)
            table = PrettyTable(['Name', 'Type'])
            for variable in contract.state_variables:
                if not variable.is_constant:
                    table.add_row([variable.name, str(variable.type)])
            txt += str(table) + '\n'

        self.info(txt)
1343730
def yaml?(file)
      line = open(file) { |f| line = f.gets }
      line.index "!ruby/object:Gem::Specification"
    end
288957
def gemspec_filename(gem_version = nil)
      gem_version ||= version.to_s
      n = [name, gem_version]
      n.push(@platform) if @platform != 'ruby'
      "#{n.join('-')}.gemspec.rz"
    end
1167287
def add_underscore_to(file)
      f = Pathname.new(file)
      if f.basename.to_s =~ /^_/
        file
      else
        "#{f.dirname}/_#{f.basename}"
      end
    end
717506
def generate_filename(self, mark, **kwargs):
        """"""

        kwargs = kwargs.copy()

        kwargs['opacity'] = int(kwargs['opacity'] * 100)
        kwargs['st_mtime'] = kwargs['fstat'].st_mtime
        kwargs['st_size'] = kwargs['fstat'].st_size

        params = [
            '%(original_basename)s',
            'wm',
            'w%(watermark)i',
            'o%(opacity)i',
            'gs%(greyscale)i',
            'r%(rotation)i',
            'fm%(st_mtime)i',
            'fz%(st_size)i',
            'p%(position)s',
        ]

        scale = kwargs.get('scale', None)
        if scale and scale != mark.size:
            params.append('_s%i' % (float(kwargs['scale'][0]) / mark.size[0] * 100))

        if kwargs.get('tile', None):
            params.append('_tiled')

        # make thumbnail filename
        filename = '%s%s' % ('_'.join(params), kwargs['ext'])

        return filename % kwargs
755594
def output(self, filename):
        

        if not filename.endswith('.dot'):
            filename += '.dot'
        if filename == ".dot":
            filename = "all_contracts.dot"

        with open(filename, 'w', encoding='utf8') as f:
            self.info(f'Call Graph: {filename}')
            f.write('\n'.join(['strict digraph {'] + [self._process_functions(self.slither.functions)] +  ['}']))


        for derived_contract in self.slither.contracts_derived:
            with open(f'{derived_contract.name}.dot', 'w', encoding='utf8') as f:
                self.info(f'Call Graph: {derived_contract.name}.dot')
                f.write('\n'.join(['strict digraph {'] + [self._process_functions(derived_contract.functions)] +  ['}']))
562865
function name(file, implicit){
  function rel(name){
    return name ? String(name).replace(/^\//, '') : name;
  }

  if (file.filename)
    file.graphName = file.filename;

  if (file.sourceFilename)
    file.graphName = file.sourceFilename;

  if (!file.graphName && implicit && file.inline && file.htmlFile)
    return rel(file.htmlFile.filename);

  return rel(file.graphName);
}
733465
def file_basename(self, file):
        '''
        
        '''
        valid_extensions = set(".tree",
                               ".tre")
        split_file = os.path.basename(file).split('.')
        base, suffix = '.'.join(split_file[:-1]), split_file[-1]

        if suffix in valid_extensions:
            return base
        else:
            logging.error("Invalid file extension found on file: %s" % file)
            logging.error("For trees, please provide a file with one of the \
following extensions: %s" % ' '.join(valid_extensions.keys()))
            raise InvalidFileExtensionError