module Squib
The project module
@api public
Constants
- USER_CONFIG
- VERSION
The next version to be released. Uses semantic versioning: semver.org/
Most of the time this is in the alpha of the next release. e.g. v0.0.5a is on its way to becoming v0.0.5
Public Class Methods
# File lib/squib/conf.rb, line 8 def configure(opts) str_hash = opts.inject({}) { |h, (k, v)| h[k.to_s] = v; h } USER_CONFIG.merge! str_hash end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/csv.rb, line 8 def csv(opts = {}, &block) DSL::Csv.new(__callee__).run(opts, &block) end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/groups.rb, line 13 def disable_build_globally group groups = (ENV['SQUIB_BUILD'] ||= '').split(',') groups.delete(group.to_s) ENV['SQUIB_BUILD'] = groups.uniq.join(',') end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/groups.rb, line 6 def enable_build_globally group groups = (ENV['SQUIB_BUILD'] ||= '').split(',') ENV['SQUIB_BUILD'] = (groups << group).uniq.join(',') end
Access the internal logger that Squib
uses. By default, Squib
configure the logger to the WARN level Use this to suppress or increase output levels. @example
Squib.logger.level = Logger::DEBUG #show waaaay more information than you probably need, unless you're a dev Squib.logger.level = Logger::ERROR #basically turns it off
@return [Logger] the ruby logger @api public
# File lib/squib.rb, line 23 def logger if @logger.nil? @logger = Logger.new($stdout) @logger.level = Logger::WARN @logger.formatter = proc do |severity, datetime, m_progname, msg| "[#{datetime.strftime('%F %H:%M:%S')} #{severity.red}] #{msg}\n" end end @logger end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/xlsx.rb, line 7 def xlsx(opts = {}, &block) DSL::Xlsx.new(__callee__).run(opts, &block) end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/yaml.rb, line 7 def yaml(opts = {}, &block) DSL::Yaml.new(__callee__).run(opts, &block) end
Public Instance Methods
Prints out the system fonts in sorted order
# File lib/squib/system_fonts.rb, line 13 def print_system_fonts puts "== DEBUG: Squib knows about these fonts ==" puts system_fonts.sort end
List all system fonts that Cairo/Pango can see Wow this call was convoluted… Returns array of strings with the names of fonts
# File lib/squib/system_fonts.rb, line 7 def system_fonts cc = Cairo::Context.new(Cairo::ImageSurface.new(0,0)) # empty image cc.create_pango_layout.context.families.map {|f| f.name } end
Private Instance Methods
# File lib/squib/conf.rb, line 8 def configure(opts) str_hash = opts.inject({}) { |h, (k, v)| h[k.to_s] = v; h } USER_CONFIG.merge! str_hash end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/csv.rb, line 8 def csv(opts = {}, &block) DSL::Csv.new(__callee__).run(opts, &block) end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/groups.rb, line 13 def disable_build_globally group groups = (ENV['SQUIB_BUILD'] ||= '').split(',') groups.delete(group.to_s) ENV['SQUIB_BUILD'] = groups.uniq.join(',') end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/groups.rb, line 6 def enable_build_globally group groups = (ENV['SQUIB_BUILD'] ||= '').split(',') ENV['SQUIB_BUILD'] = (groups << group).uniq.join(',') end
Access the internal logger that Squib
uses. By default, Squib
configure the logger to the WARN level Use this to suppress or increase output levels. @example
Squib.logger.level = Logger::DEBUG #show waaaay more information than you probably need, unless you're a dev Squib.logger.level = Logger::ERROR #basically turns it off
@return [Logger] the ruby logger @api public
# File lib/squib.rb, line 23 def logger if @logger.nil? @logger = Logger.new($stdout) @logger.level = Logger::WARN @logger.formatter = proc do |severity, datetime, m_progname, msg| "[#{datetime.strftime('%F %H:%M:%S')} #{severity.red}] #{msg}\n" end end @logger end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/xlsx.rb, line 7 def xlsx(opts = {}, &block) DSL::Xlsx.new(__callee__).run(opts, &block) end
DSL
method. See squib.readthedocs.io
# File lib/squib/dsl/yaml.rb, line 7 def yaml(opts = {}, &block) DSL::Yaml.new(__callee__).run(opts, &block) end