Sha256: 7a61ea74dfd0e43dffca6fff24db1f29f278d0db3604d34d43e6d7d349e6b353

Contents?: true

Size: 1.04 KB

Versions: 1

Compression:

Stored size: 1.04 KB

Contents

require_relative 'cputs/version.rb'
require_relative 'cputs/functions.rb'
##
# This module represents the bridge between CPuts functionality and the user

module CPuts

    ##
    # The main method to print (puts) a message with the *preffix* (if set) *File* (that's making the call) *Line* (of the file) and *Suffix* (if set)
    # :args: message

    def cputs(message)
        CPuts::Functions.cputs(message, caller)
    end

    ##
    # Override the usual *puts* method to always use
    # cputs instead.

    def self.override_puts
        require_relative 'cputs/override.rb'
    end

    ##
    # Sets the preffix for the output

    def CPuts.set_preffix(preffix)
        CPuts::Functions.preffix preffix
    end

    ##
    # Sets the suffix for the output

    def CPuts.set_suffix(suffix)
        CPuts::Functions.suffix suffix
    end

    ##
    # Sets both the preffix and suffix for the output

    def CPuts.set_preffix_and_suffix(*args)
        CPuts::Functions.preffix_and_suffix *args
    end

    alias :default_puts :puts

end

include CPuts

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
cputs-0.1.1 lib/cputs.rb