Low commit activity in last 3 years
A long-lived project that still receives updates
Source code comment stripping library
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
 Dependencies

Runtime

>= 0.39.5, < 1.0
 Project Readme

comment_strip.r

Comment Strip, for Ruby

Language License Gem Version Last Commit Ruby

Table of Contents

  • Introduction
  • Installation
  • Components
  • Examples
  • Project Information
    • Where to get help
    • Contribution guidelines
    • Dependencies
      • Efferent (fan-out)
        • Runtime Dependencies (aka "Normal Dependencies")
        • Development Dependencies
      • Afferent (fan-in)
        • Runtime dependents
        • Development dependents
    • Related projects
    • License

Introduction

comment_strip.r strips comments from source text for a small set of language families. Call CommentStrip.strip(input, language_family) (or the equivalent instance API) with a recognised family such as :C or :Hash_Line; the library returns the input with comments removed according to that family's rules.

Installation

Install via gem as in:

gem install comment_strip-ruby

or add it to your Gemfile.

Components

Current version supports following language families:

  • 'C' - C-family languages, recognising // line and /* … */ block comments;
  • 'Hash_Line' - Generic support for # line comments, as found in shell scripts and languages such as Perl, Python, and Ruby. NOTE: Does not yet provide any language-specific smarts such as she-bang comments and directive comments;

Examples

It is as simple as the following:

require 'comment_strip'

stripped = CommentStrip.strip($stdin.read, :C)

puts "Stripped form of input:\n#{stripped}"

Examples are provided in the examples directory. A detailed list TOC of them is provided in EXAMPLES.md.

Project Information

Where to get help

GitHub Page

Contribution guidelines

Defect reports, feature requests, and pull requests are welcome on https://github.com/synesissoftware/comment_strip.r.

Dependencies

Efferent (fan-out)

Libraries upon which comment_strip.r depends:

Runtime Dependencies (aka "Normal Dependencies")
Development Dependencies

Afferent (fan-in)

Projects that depend on comment_strip.r:

Runtime dependents
  • <none>;
Development dependents
  • <none>;

Related projects

  • <none> — no sibling-language comment_strip ports are published in freelibs at present;

License

comment_strip.r is released under the 3-clause BSD license. See LICENSE for details.