module Preproc

Constants

MAJOR
MINOR
PATCH
VERSION

Public Class Methods

banner() click to toggle source

version string for generator meta tag (includes ruby version)

fetcher_read_utf8!( src ) click to toggle source

todo/fix: use/find better name? - e.g. Fetcher.read_utf8!() move out of global ns etc.

move to Fetcher gem; (re)use!!! remove here
e.g. use Fetch.read_utf8!()  e.g. throws exception on error
               read_blob!()
# File lib/preproc.rb, line 21
def self.fetcher_read_utf8!( src )
  worker = Fetcher::Worker.new
  res = worker.get_response( src )
  if res.code != '200'
    puts "sorry; failed to fetch >#{src} - HTTP #{res.code} - #{res.message}"
    exit 1
  end

  ###
  # Note: Net::HTTP will NOT set encoding UTF-8 etc.
  #  will be set to ASCII-8BIT == BINARY == Encoding Unknown; Raw Bytes Here
  #  thus, set/force encoding to utf-8
  txt = res.body.to_s
  txt = txt.force_encoding( Encoding::UTF_8 )
  txt
end
root() click to toggle source
# File lib/preproc/version.rb, line 19
def self.root
  "#{File.expand_path( File.dirname(File.dirname(File.dirname(__FILE__))) )}"
end
version() click to toggle source
# File lib/preproc/version.rb, line 10
def self.version
  VERSION
end