Class: GamesAndRpgParadise::MagicTheGathering::SearchForThisMagicCard

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

Overview

GamesAndRpgParadise::MagicTheGathering::SearchForThisMagicCard

Constant Summary collapse

NAMESPACE =
#

NAMESPACE

#
inspect
REMOTE_URL_TO_USE =
#

REMOTE_URL_TO_USE

#
'https://www.cardmarket.com/en/Magic/Products/Search?searchString='

Constants inherited from Base

Base::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

Instance Method Summary collapse

Methods inherited from Base

[], #convert, #ensure_that_the_log_directory_exists, #esystem, #is_png_file?, #lightgreen, #log_dir?, #opnn, #orange, #palegoldenrod, #pngopt, #rev, #slateblue, #springgreen, #turquoise, #write_what_into

Methods included from Base::Extensions::Colours

ecomment, #efancy, #eparse, #forestgreen, #gold, #grey, #lightblue, #mediumseagreen, #mediumslateblue, #peru, #rev, 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, #ensure_that_the_log_directory_exists, #esystem, #get_user_input, #infer_the_namespace, #is_on_roebe?, #log_dir?, #mkdir, #mkdir_then_cd_into_it, #mv, #namespace?, #opne, #opnn, #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, #write_what_into

Constructor Details

#initialize(i = ARGV, run_already = true) ⇒ SearchForThisMagicCard

#

initialize

#


38
39
40
41
42
43
44
45
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/classes/search_for_this_magic_card.rb', line 38

def initialize(
    i           = ARGV,
    run_already = true
  )
  set_commandline_arguments(i)
  reset
  run if run_already
end

Instance Method Details

#do_start_the_GUIObject

#

do_start_the_GUI

#


76
77
78
79
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/classes/search_for_this_magic_card.rb', line 76

def do_start_the_GUI
  require 'games_and_rpg_paradise/gui/gtk3/magic_the_gathering/search_for_this_magic_card/search_for_this_magic_card.rb'
  GamesAndRpgParadise::GUI::Gtk::SearchForThisMagicCard.run
end
#

menu (menu tag)

#


57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/classes/search_for_this_magic_card.rb', line 57

def menu(
    i = commandline_arguments?
  )
  if i.is_a? Array
    i.each {|entry| menu(entry) }
  else
    case i # case tag
    # ===================================================================== #
    # === card --gui
    # ===================================================================== #
    when /^-?-?gui$/i
      do_start_the_GUI
    end
  end
end

#resetObject

#

ensure

#


50
51
52
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/classes/search_for_this_magic_card.rb', line 50

def reset
  ensure_that_the_log_directory_exists
end

#runObject

#

run

#


84
85
86
87
88
89
90
91
92
93
94
# File 'lib/games_and_rpg_paradise/games/magic_the_gathering/classes/search_for_this_magic_card.rb', line 84

def run
  _ = commandline_arguments?
  menu(_)
  _ = filter_away_commandline_arguments(_)
  assembled_string = commandline_arguments?.join('+').to_s
  _ = REMOTE_URL_TO_USE+assembled_string
  e
  e steelblue("  #{_}")
  e
  Open.in_browser(_)
end