module Lyracyst
The Lyracyst
module handles base functionality.
Constants
- VERSION
Semantic program version
Public Class Methods
http(http)
click to toggle source
Optionally sets HTTP adapter with httpi. Supports [:httpclient, :curb, :em_http, :net_http_persistent, :excon, :rack]
@param http [Symbol] The http adapter to use. Smart defaults.
# File lib/lyracyst.rb, line 24 def self.http(http) HTTPI.adapter = http end
json(mj)
click to toggle source
Optionally sets JSON adapter with multi_json. Supports [:oj, :yajl, :json_gem, :json_pure]
@param mj [Symbol] The JSON adapter to use. Smart defaults.
# File lib/lyracyst.rb, line 32 def self.json(mj) MultiJson.use(mj) end
label(label)
click to toggle source
Prints colored element label.
@param label [String] The label to print
# File lib/lyracyst.rb, line 47 def self.label(label) print Rainbow('[').blue.bright print Rainbow(label).green.bright print Rainbow(']').blue.bright print Rainbow('|').bright end
tofile(obj)
click to toggle source
Adds an object to the outfile array.
@param obj [String] The item to add
# File lib/lyracyst.rb, line 57 def self.tofile(obj) if $fmt != nil $tofile.push obj end end
xml(mx)
click to toggle source
Optionally sets XML adapter with multi_xml. Supports [:ox, :libxml, :nokogiri, :rexml]
@param mx [Symbol] The XML adapter to use. Smart defaults.
# File lib/lyracyst.rb, line 40 def self.xml(mx) MultiXml.parser = mx end