Module: P4Tools

Defined in:
lib/p4_tools.rb,
lib/p4tools/spec.rb,
lib/commands/move.rb,
lib/commands/revert.rb,
lib/commands/shelve.rb,
lib/commands/describe.rb,
lib/p4tools/utils/utils.rb,
lib/p4tools/utils/command_utils.rb,
lib/p4tools/parsers/command_entry.rb,
lib/p4tools/parsers/command_parser.rb,
lib/p4tools/parsers/trollop_custom.rb,
lib/p4tools/parsers/command_options.rb,
lib/p4tools/utils/validators/shelve_validator.rb

Defined Under Namespace

Modules: CommandUtils, Trollop, Utils Classes: CommandEntry, CommandOptions, CommandParser, Describe, Move, Revert, Shelve, ShelveValidator

Constant Summary collapse

PROJECT_NAME =
'p4tools'
VERSION =
'0.2.0.0'

Class Method Summary collapse

Class Method Details

.connectionP4

Returns:

  • (P4)


40
41
42
# File 'lib/p4_tools.rb', line 40

def self.connection
  @p4
end

.run(args = ARGV) ⇒ void

This method returns an undefined value.

Parameters:

  • args (Array<String>) (defaults to: ARGV)


14
15
16
17
18
19
20
21
22
23
24
25
# File 'lib/p4_tools.rb', line 14

def self.run(args=ARGV)
  entries = CommandParser.new(args).parse
  global_arguments = entries.shift.arguments

  create_perforce_connection

  begin
    run_commands(entries)
  ensure
    @p4.disconnect
  end
end

.set_options(opts) ⇒ void

This method returns an undefined value.

Parameters:



29
30
31
32
33
34
35
36
37
# File 'lib/p4_tools.rb', line 29

def self.set_options(opts)
  opts.set do
    help 'Simple command line tool to run custom perforce actions through subcommands.'
    help 'For more information, please check the help page of the subcommand.'
    help ''
    help "Available subcommands are:\n  #{SUB_COMMANDS.join("\n  ")}"
    help ''
  end
end