Class: GamesAndRpgParadise::MagicTheGathering::Base

Inherits:
Base
  • Object
show all
Defined in:
lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb

Overview

GamesAndRpgParadise::MagicTheGathering::Base

Constant Summary collapse

LOG_DIR =
#

LOG_DIR

#
::GamesAndRpgParadise::MagicTheGathering.log_dir?

Constants included from Base::Extensions::Colours

Base::Extensions::Colours::ARRAY_AVAILABLE_KONSOLE_COLOURS

Constants included from CommonExtensions

CommonExtensions::CONTROL_C_CODE, CommonExtensions::N

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Base::Extensions::Colours

ecomment, #efancy, #eparse, #forestgreen, #gold, #grey, #lightblue, #mediumseagreen, #mediumslateblue, #peru, sdir, sfancy, #sfile, simp, #teal, #yellow

Methods included from Base::Extensions::CommandlineArguments

#commandline_arguments?, #filter_away_commandline_arguments, #first_argument?, #first_non_hyphened_argument?, #set_commandline_arguments

Methods included from CommonExtensions

#cat, #cd, #cliner, #copy_file, #delete, #dirname_but_retains_the_trailing_slash, #disable_colours, #get_user_input, #infer_the_namespace, #is_on_roebe?, #mkdir, #mkdir_then_cd_into_it, #mv, #namespace?, #opne, #project_base_directory?, #project_image_directory?, #project_yaml_directory?, #rds, #register_sigint, #remove_this_directory, #rename_file, #reset_the_internal_hash, #return_pwd, #return_today, #touch_file, #wrap

Class Method Details

.[](i = ARGV) ⇒ Object

#

GamesAndRpgParadise::MagicTheGathering::Base[]

#


182
183
184
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 182

def self.[](i = ARGV)
  new(i)
end

Instance Method Details

#convert(name_of_the_png_file, name_of_the_image_file) ⇒ Object

#

convert

#


143
144
145
146
147
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 143

def convert(
    name_of_the_png_file, name_of_the_image_file
  )
  ::GamesAndRpgParadise.convert(name_of_the_png_file, name_of_the_image_file)
end

#ensure_that_the_log_directory_existsObject

#

ensure_that_the_log_directory_exists

#


159
160
161
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 159

def ensure_that_the_log_directory_exists
  ::GamesAndRpgParadise.ensure_that_the_log_directory_exists
end

#esystem(i) ⇒ Object

#

esystem

#


73
74
75
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 73

def esystem(i)
  ::GamesAndRpgParadise.esystem(i)
end

#is_png_file?(i) ⇒ Boolean Also known as: is_a_png_file?

#

is_png_file?

Query whether we can assume the input to be a .png file. This will be true typically for “foobar.png”, if the program file can identify this as a png-file.

#

Returns:

  • (Boolean)


64
65
66
67
68
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 64

def is_png_file?(i)
  result = `file #{i}`
  return true if result.include? ': PNG image data'
  return false # else return this.
end

#lightgreen(i) ⇒ Object

#

lightgreen

#


101
102
103
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 101

def lightgreen(i)
  ::Colours.lightgreen(i)
end

#log_dir?Boolean Also known as: log_directory?

#

log_dir?

#

Returns:

  • (Boolean)


175
176
177
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 175

def log_dir?
  LOG_DIR # Simply use the constant in this case.
end

#opnn(i) ⇒ Object

#

opnn

#


122
123
124
125
126
127
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 122

def opnn(i)
  if i.is_a? String
    i = { namespace: i }
  end
  Opn.opn(i)
end

#orange(i) ⇒ Object

#

orange

#


80
81
82
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 80

def orange(i)
  ::Colours.orange(i)
end

#palegoldenrod(i) ⇒ Object

#

palegoldenrod

#


108
109
110
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 108

def palegoldenrod(i)
  ::Colours.palegoldenrod(i)
end

#pngopt(i, be_verbose = :be_silent) ⇒ Object

#

pngopt

Use pngopt to reduce the file size.

#


135
136
137
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 135

def pngopt(i, be_verbose = :be_silent)
  ::GamesAndRpgParadise.pngopt(i, be_verbose)
end

#resetObject

#

reset

#


50
51
52
53
54
55
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 50

def reset
  # ======================================================================= #
  # === @use_colours
  # ======================================================================= #
  @use_colours = GamesAndRpgParadise.use_colours?
end

#revObject

#

rev

#


152
153
154
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 152

def rev
  ::Colours.rev
end

#slateblue(i) ⇒ Object

#

slateblue

#


94
95
96
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 94

def slateblue(i)
  ::Colours.slateblue(i)
end

#springgreen(i) ⇒ Object

#

springgreen

#


87
88
89
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 87

def springgreen(i)
  ::Colours.springgreen(i)
end

#turquoise(i) ⇒ Object

#

turquoise

#


115
116
117
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 115

def turquoise(i)
  ::Colours.turquoise(i)
end

#write_what_into(what, into) ⇒ Object

#

write_what_into

Wrapper over SaveFile.write_what_into().

#


168
169
170
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/base/base.rb', line 168

def write_what_into(what, into)
  ::SaveFile.write_what_into(what, into) if Object.const_defined?(::SaveFile)
end