Class: Bridgetown::Command
- Inherits:
-
Samovar::Command
- Object
- Samovar::Command
- Bridgetown::Command
- Defined in:
- bridgetown-core/lib/bridgetown-core/command.rb
Direct Known Subclasses
Bridgetown::Commands::Application, Bridgetown::Commands::Apply, Bridgetown::Commands::Build, Bridgetown::Commands::Clean, Bridgetown::Commands::Configure, Bridgetown::Commands::Console, Bridgetown::Commands::Dream, Bridgetown::Commands::Esbuild, Bridgetown::Commands::Help, Bridgetown::Commands::New, Bridgetown::Commands::Plugins, Bridgetown::Commands::Plugins::CD, Bridgetown::Commands::Plugins::List, Bridgetown::Commands::Plugins::New, Bridgetown::Commands::Start
Class Method Summary collapse
-
.command_line(name) ⇒ Object
Samovar shows all command options by default when printing out a command name string.
-
.start(args = []) ⇒ Object
Compatibility syntax to execute commands.
-
.summary ⇒ Object
Class Method Details
.command_line(name) ⇒ Object
Samovar shows all command options by default when printing out a command name string. We want to hide that part of the output, as options are already listed out separately
85 86 87 88 89 90 91 92 93 94 95 |
# File 'bridgetown-core/lib/bridgetown-core/command.rb', line 85 def self.command_line(name) table = self.table.merged usage_string = table.each.collect do |row| next "" if row.is_a?(Samovar::Options) row.to_s end.reject(&:empty?).join(" ") "#{name} #{usage_string}" end |
.start(args = []) ⇒ Object
Compatibility syntax to execute commands.
It’s recommended you use Samovar’s more idiomatic CmdClass[*args].call syntax instead
81 |
# File 'bridgetown-core/lib/bridgetown-core/command.rb', line 81 def self.start(args = []) = self[*args].call |
.summary ⇒ Object
77 |
# File 'bridgetown-core/lib/bridgetown-core/command.rb', line 77 def self.summary = description |