cleanup module definitions
parent
77a694f797
commit
21bee3a3cb
|
|
@ -1,12 +1,7 @@
|
||||||
module Squib
|
module Squib::Args::ColorValidator
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
module ColorValidator
|
|
||||||
|
|
||||||
def colorify(color, custom_colors = {})
|
def colorify(color, custom_colors = {})
|
||||||
custom_colors[color.to_s] || color.to_s
|
custom_colors[color.to_s] || color.to_s
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,9 @@
|
||||||
require_relative 'arg_loader'
|
require_relative 'arg_loader'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
module_function def extract_coord(opts, deck)
|
||||||
module Args
|
Box.new.extract!(opts, deck)
|
||||||
|
end
|
||||||
|
|
||||||
class Coords
|
class Coords
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
|
|
@ -31,5 +32,4 @@ module Squib
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
require 'csv'
|
require 'csv'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
class CSV_Opts
|
class CSV_Opts
|
||||||
|
|
||||||
def initialize(opts)
|
def initialize(opts)
|
||||||
|
|
@ -21,5 +19,4 @@ module Squib
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,4 @@
|
||||||
module Squib
|
module Squib::Args::DirValidator
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
module DirValidator
|
|
||||||
|
|
||||||
def ensure_dir_created(dir)
|
def ensure_dir_created(dir)
|
||||||
unless Dir.exists?(dir)
|
unless Dir.exists?(dir)
|
||||||
|
|
@ -11,6 +8,4 @@ module Squib
|
||||||
return dir
|
return dir
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
require_relative 'arg_loader'
|
require_relative 'arg_loader'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
|
|
||||||
class EmbedAdjust
|
class EmbedAdjust
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
|
|
@ -21,5 +19,4 @@ module Squib
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,6 @@
|
||||||
require_relative 'arg_loader'
|
require_relative 'arg_loader'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
|
|
||||||
class EmbedKey
|
class EmbedKey
|
||||||
|
|
||||||
# Validate the embed lookup key
|
# Validate the embed lookup key
|
||||||
|
|
@ -12,6 +9,4 @@ module Squib
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
require 'cairo'
|
require 'cairo'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
|
|
||||||
class HandSpecial
|
class HandSpecial
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
|
|
@ -33,5 +31,4 @@ module Squib
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
require_relative 'arg_loader'
|
require_relative 'arg_loader'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
|
|
||||||
class Import
|
class Import
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
|
|
@ -36,5 +34,4 @@ module Squib
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -6,6 +6,7 @@ module Squib::Args
|
||||||
module_function def extract_paint(opts, deck)
|
module_function def extract_paint(opts, deck)
|
||||||
Paint.new(deck.custom_colors).extract!(opts, deck)
|
Paint.new(deck.custom_colors).extract!(opts, deck)
|
||||||
end
|
end
|
||||||
|
|
||||||
class Paint
|
class Paint
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
include ColorValidator
|
include ColorValidator
|
||||||
|
|
|
||||||
|
|
@ -1,14 +1,11 @@
|
||||||
require_relative '../constants'
|
require_relative '../constants'
|
||||||
require_relative 'arg_loader'
|
require_relative 'arg_loader'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
|
|
||||||
class Paragraph
|
class Paragraph
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
|
|
||||||
|
|
||||||
def self.parameters
|
def self.parameters
|
||||||
{ align: :left,
|
{ align: :left,
|
||||||
str: 'Hello, World!',
|
str: 'Hello, World!',
|
||||||
|
|
@ -42,7 +39,7 @@ module Squib
|
||||||
|
|
||||||
def validate_font(arg, _i)
|
def validate_font(arg, _i)
|
||||||
arg = @deck_font if arg == :use_set
|
arg = @deck_font if arg == :use_set
|
||||||
arg = DEFAULT_FONT if arg == :default
|
arg = Squib::DEFAULT_FONT if arg == :default
|
||||||
arg
|
arg
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|
@ -114,5 +111,4 @@ module Squib
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,9 +1,7 @@
|
||||||
require_relative 'arg_loader'
|
require_relative 'arg_loader'
|
||||||
require_relative 'dir_validator'
|
require_relative 'dir_validator'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
class SaveBatch
|
class SaveBatch
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
include DirValidator
|
include DirValidator
|
||||||
|
|
@ -59,5 +57,4 @@ module Squib
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,6 @@
|
||||||
require_relative 'arg_loader'
|
require_relative 'arg_loader'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
class SprueFile
|
class SprueFile
|
||||||
include ArgLoader
|
include ArgLoader
|
||||||
|
|
||||||
|
|
@ -40,5 +38,4 @@ module Squib
|
||||||
"#{File.dirname(__FILE__)}/../builtin/sprues/#{file}"
|
"#{File.dirname(__FILE__)}/../builtin/sprues/#{file}"
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
|
|
@ -1,13 +1,10 @@
|
||||||
require_relative '../constants'
|
require_relative '../constants'
|
||||||
|
|
||||||
module Squib
|
module Squib::Args
|
||||||
# @api private
|
|
||||||
module Args
|
|
||||||
# Internal class for handling arguments
|
# Internal class for handling arguments
|
||||||
# @api private
|
|
||||||
class Typographer
|
class Typographer
|
||||||
|
|
||||||
def initialize(config = Conf::DEFAULTS)
|
def initialize(config = Squib::Conf::DEFAULTS)
|
||||||
%w(lsquote ldquote rsquote rdquote smart_quotes
|
%w(lsquote ldquote rsquote rdquote smart_quotes
|
||||||
em_dash en_dash ellipsis).each do |var|
|
em_dash en_dash ellipsis).each do |var|
|
||||||
instance_variable_set("@#{var}", config[var])
|
instance_variable_set("@#{var}", config[var])
|
||||||
|
|
@ -115,5 +112,4 @@ module Squib
|
||||||
end
|
end
|
||||||
|
|
||||||
end
|
end
|
||||||
end
|
|
||||||
end
|
end
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue