Class: Bash

Inherits:
Clamp::Command show all
Defined in:
lib/wpb/bash.rb

Instance Attribute Summary

Attributes inherited from Clamp::Command

#invocation_path

Attributes included from Clamp::Help

#declared_usage_descriptions, #description

Instance Method Summary collapse

Methods inherited from Clamp::Command

#execute_subcommands, #help, #initialize, #parse, #remaining_arguments, #run, run

Methods included from Clamp::Help

#derived_usage_description, #help, #usage, #usage_descriptions

Methods included from Clamp::Subcommand::Declaration

#find_subcommand, #has_subcommands!, #has_subcommands?, #recognised_subcommands, #subcommand

Methods included from Clamp::Parameter::Declaration

#has_parameters?, #parameter, #parameters

Methods included from Clamp::Option::Declaration

#declared_options, #documented_options, #find_option, #has_options?, #option, #recognised_options

Constructor Details

This class inherits a constructor from Clamp::Command

Instance Method Details

#executeObject



6
7
8
9
10
11
12
13
14
15
16
17
# File 'lib/wpb/bash.rb', line 6

def execute
	if version?
		require "wpb/version"
		print "WordPress Bash #{WPB::VERSION} (c) James Birtles"
	else
		irb = RUBY_PLATFORM =~ /(:?mswin|mingw)/ ? 'irb.bat' : 'irb'
		libs = " -r irb/completion"
		libs << " -r #{File.expand_path('../../wpb.rb', __FILE__)}"
		puts "Connecting to database..."
		exec "#{irb} #{libs}"
	end
end