Class: Factorix::CLI::Commands::MOD::Search
- Includes:
- PortalSupport
- Defined in:
- lib/factorix/cli/commands/mod/search.rb
Overview
Search MODs on Factorio MOD Portal
Instance Method Summary collapse
-
#call(mod_names: [], hide_deprecated: true, page: "1", page_size: "25", sort: nil, sort_order: nil, version: nil, json: false) ⇒ void
Execute the search command.
Methods inherited from Base
backup_support!, confirmable!, inherited, require_game_stopped!
Instance Method Details
#call(mod_names: [], hide_deprecated: true, page: "1", page_size: "25", sort: nil, sort_order: nil, version: nil, json: false) ⇒ void
This method returns an undefined value.
Execute the search command
49 50 51 52 53 54 55 56 57 58 59 60 61 |
# File 'lib/factorix/cli/commands/mod/search.rb', line 49 def call(mod_names: [], hide_deprecated: true, page: "1", page_size: "25", sort: nil, sort_order: nil, version: nil, json: false, **) page = Integer(page) page_size = Integer(page_size) version ||= default_factorio_version mods = portal.list_mods(*mod_names, hide_deprecated: hide_deprecated || nil, page:, page_size:, sort:, sort_order:, version:) if json output_json(mods) else output_table(mods) end end |