Module: Rodish::Plugins::PostCommands::DSLMethods

Defined in:
lib/rodish/plugins/post_commands.rb

Instance Method Summary collapse

Instance Method Details

#autoload_post_subcommand_dir(dir) ⇒ Object

Similar to autoload_subcommand_dir, but for post subcommands instead of normal subcommands.



40
41
42
# File 'lib/rodish/plugins/post_commands.rb', line 40

def autoload_post_subcommand_dir(dir)
  _autoload_subcommand_dir(@command.post_subcommands, dir)
end

#post_banner(banner) ⇒ Object

Set the banner for post subcommand usage.



25
26
27
# File 'lib/rodish/plugins/post_commands.rb', line 25

def post_banner(banner)
  @command.post_banner = banner
end

#post_options(banner, key: nil, &block) ⇒ Object

Similar to options, but sets the option parser for post subcommands. This option parser is only used when the command is executed and chooses to run a post subcommand.



32
33
34
35
36
# File 'lib/rodish/plugins/post_commands.rb', line 32

def post_options(banner, key: nil, &block)
  @command.post_banner = banner
  @command.post_option_key = key
  @command.post_option_parser = create_option_parser(&block)
end

#run_on(command_name, &block) ⇒ Object

Same as on, but for post subcommands instead of normal subcommands.



46
47
48
# File 'lib/rodish/plugins/post_commands.rb', line 46

def run_on(command_name, &block)
  _on(@command.post_subcommands, command_name, &block)
end