No commit activity in last 3 years
No release in over 3 years
Comments your meta code
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

 Project Readme

Meta code commenter (mcc)¶ ↑

Comments your meta code.

Usage¶ ↑

require 'mcc'

params = ARGV.inject({}) do |hash, arg|
  key, value = arg.split(/=/)
  hash[key] = value
  hash
end

puts MetaCodeCommenter.comment(STDIN.readlines)

Command line¶ ↑

$ mcc key1=value key2=value < my_meta_code

Example¶ ↑

$ cat code 
def #{name}(proc=nil, &blk)              
  proc ||= blk                           
  @#{name} = Proc.new do |ptr,data,len|  
    if data                              
      proc.call(data.get_string(0, len)) 
    else                                 
      proc.call                          
    end                                  
    @abort ? 1 : 0                       
  end                                    
  @parser[:#{name}] = @#{name}           
end                                      

$ mcc name=on_headers < code 
def #{name}(proc=nil, &blk)                 # def name(proc=nil, &blk)              
  proc ||= blk                              #   proc ||= blk                           
  @#{name} = Proc.new do |ptr,data,len|     #   @name = Proc.new do |ptr,data,len|  
    if data                                 #     if data                              
      proc.call(data.get_string(0, len))    #       proc.call(data.get_string(0, len)) 
    else                                    #     else                                 
      proc.call                             #       proc.call                          
    end                                     #     end                                  
    @abort ? 1 : 0                          #     @abort ? 1 : 0                       
  end                                       #   end                                    
  @parser[:#{name}] = @#{name}              #   @parser[:name] = @name           
end                                         # end

Installation (not yet)¶ ↑

gem install meta_code_commenter

Authors¶ ↑

  • Peter Suschlik

TODO¶ ↑

  • Fix failing test (double quotes don’t work yet)

  • Use thor or something or mcc