Populates the sourcefile with the given content

 @param content [String] - Usually the output of a bash command

 @param **options [key value pairs] -
 See https://github.com/piotrmurach/tty-file for TTY::File docs
326720
def populate(content, **options)
      generator.create_file(RubyEdit::SOURCE_FILE_LOCATION,
                            content,
                            force: true,
                            verbose: false,
                            **options)
    end
785198
function create(content, url) {
  url = url || '<source>';
  const map = new SourceMapGenerator({ file: url });
  const lines = content.split('\n');

  for (let l = 1, n = lines.length; l <= n; l++) {
    // Skip empty
    if (lines[l - 1]) {
      map.addMapping({
        source: url,
        original: { line: l, column: 0 },
        generated: { line: l, column: 0 }
      });
    }
  }

  map.setSourceContent(url, content);
  return map;
}
1228800
def setcontents(self, source, **kwargs):
        """"""
        if isinstance(source, six.string_types):
            _file = opener.open(source, 'rb')
        else:
            _file = source

        # signals.document_before_content_set.send(self)

        data = _file.read()
        _fs, filename = opener.parse(self.uri)
        _fs.setcontents(filename, data, **kwargs)
        _fs.close()

        # signals.document_after_content_set.send(self)

        if isinstance(source, six.string_types) and hasattr(_file, 'close'):
            _file.close()
1072674
function(inputFile, outputFile, content) {
                return Promise()
                .then(function() {
                    var outputFilePath = PathUtils.resolveInRoot(outputFolder, outputFile);

                    return fs.ensureFile(outputFilePath)
                    .then(function() {
                        return fs.copy(inputFile, outputFilePath);
                    });
                });
            }
1232817
function renderContent(source, generator, context, options, cb) {
    ejs.renderFile(generator.templatePath(source), context, options, (err, res) => {
        if (!err) {
            cb(res);
        } else {
            generator.error(`Copying template ${source} failed. [${err}]`);
        }
    });
}
383212
def insert_content(object, location = -1)
      object = { is_reference_only: true, referenced_object: { indirect_reference_id: 0, raw_stream_content: object } } if object.is_a?(String)
      raise TypeError, 'expected a String or Hash object.' unless object.is_a?(Hash)
      prep_content_array
      self[:Contents].insert location, object
      self[:Contents].flatten!
      self
    end
597940
function syncContents(file, val) {
  switch (utils.typeOf(val)) {
    case 'buffer':
      file._contents = val;
      file._content = val.toString();
      break;
    case 'string':
      file._contents = new Buffer(val);
      file._content = val;
      break;
    case 'stream':
      file._contents = val;
      file._content = val;
      break;
    case 'undefined':
    case 'null':
    default: {
      file._contents = null;
      file._content = null;
      break;
    }
  }
}
1028788
def js_source_from_string(template_name, content, output_as_array = false)
      buffer = []
      parsed = @parser.parse(content)
      if parsed.nil?
        raise ParseError.new(@parser.failure_reason, @parser.failure_line, @parser.failure_column)
      end
      
      template_namespace(buffer, template_name)
      template_header(buffer, template_name)
      parsed.elements.each do |element|
        push_content(buffer, element)
      end
      template_footer(buffer)
            
      output_as_array ? buffer : buffer.join("\n")
    end
1229273
function(options) {
			this.inputStream = options.inputStream || process.stdin;
			this.outputStream = options.outputStream || process.stdout;
		}
805405
def populate_files_from_line_templates
        @line_templates.each do |x|
          new_name = x.sub(/_(\d+)\._{1}/, '')
          FileUtils.touch(FileUtils.join_paths(@install_path, @project_name, new_name))
          FileUtils.insert_text_at_line_number(FileUtils.join_paths(@template_path, x), FileUtils.join_paths(@install_path, @project_name, new_name), JumpStart::Base.get_line_number(x))
        end
      end
432837
function (content) {
        return Array.isArray(content)
            ? removeFromLines_(content.concat())
            : removeFromText_(content);

        function removeFromLines_(lines) {
            if (split(lines[lines.length - 1]).sourceMap) {
                lines.pop();
            }
            return lines;
        }

        function removeFromText_(text) {
            return split(text).content;
        }
    }
228414
function createContentToken(type, start) {
		let end = getSourcePoint()
		return {
			type,
			start,
			end,
			content: source.substring(start.pos, end.pos)
		}
	}
507674
function addFiles(sources, dest, options) {
      var opt = _.extend({}, defaultOptions, options || {});

      if(_.isString(sources)) {
        sources = [sources];
      }

      if(!inCwd(dest) || _.any(sources, function(src) {
        return !inCwd(src);
      })) {
        grunt.verbose.writeln('Ignore %s to %s: not in CWD.');
        return;
      }

      return addToQueueCopy(sources, dest, opt);
    }
1013611
public final void setContent(String content)
    {
        //clear non relevant flags
        this.contentBinary=null;
        this.contentParts=null;
        this.contentType=ContentType.STRING;

        this.contentString=content;
    }
1057230
public function AddSource($header_name, &$content, $subdir="src")
    {
        if($subdir)
        {
            $subdir = trim($subdir, "\\/") . "/";
            
            if(!file_exists($this->output_path . $subdir))
                \Peg\Lib\Utilities\FileSystem::MakeDir(
                    $this->output_path . $subdir, 
                    0755, 
                    true
                );
        }
        
        $header = $this->output_path 
            . $subdir
            . $this->GetSourceNamePHP($header_name)
        ;
        
        \Peg\Lib\Utilities\FileSystem::WriteFileIfDifferent($header, $content);
    }
166872
public void setSourceContent(String aSourceFile, String aSourceContent) {
        String source = aSourceFile;
        if (this._sourceRoot != null) {
            source = Util.relative(this._sourceRoot, source);
        }

        if (aSourceContent != null) {
            // Add the source content to the _sourcesContents map.
            // Create a new _sourcesContents map if the property is null.
            if (this._sourcesContents == null) {
                this._sourcesContents = new HashMap<>();
            }
            this._sourcesContents.put(source, aSourceContent);
        } else if (this._sourcesContents != null) {
            // Remove the source file from the _sourcesContents map.
            // If the _sourcesContents map is empty, set the property to null.
            this._sourcesContents.remove(source);
            if (this._sourcesContents.isEmpty()) {
                this._sourcesContents = null;
            }
        }
    }
162938
def set_source_text(self, p_text):
        
        self.src = p_text.strip()
        self.fields = parse_line(self.src)