Class: Webgen::CLI::CreateBundleCommand

Inherits:
CmdParse::Command
  • Object
show all
Defined in:
lib/webgen/cli/commands/create_bundle.rb

Overview

The CLI command for creating a new extension bundle.

Instance Method Summary collapse

Constructor Details

#initializeCreateBundleCommand

:nodoc:



13
14
15
16
17
18
19
20
21
22
23
24
25
26
# File 'lib/webgen/cli/commands/create_bundle.rb', line 13

def initialize # :nodoc:
  super('bundle', takes_commands: false)
  short_desc('Create an extension bundle')
  long_desc(<<DESC)
Creates a new extension bundle. This command can either create a local bundle in the
website's ext/ directory or a bundle that can be distributed via Rubygems. In the
latter case you can optionally specify the directory under which the bundle should
be created.
DESC
  options.on("-d", "--distribution-format", "Create the bundle in distribution format") do
    @type = :gem
  end
  @type = :local
end

Instance Method Details

#execute(bundle_name, directory = nil) ⇒ Object

:nodoc:



28
29
30
31
# File 'lib/webgen/cli/commands/create_bundle.rb', line 28

def execute(bundle_name, directory = nil) # :nodoc:
  directory ||= bundle_name
  command_parser.website.execute_task(:create_bundle, bundle_name, @type, directory)
end