Class: PackageCommand

Inherits:
Command show all
Defined in:
lib/replicant/command.rb

Instance Attribute Summary

Attributes inherited from Command

#args

Instance Method Summary collapse

Methods inherited from Command

all, #execute, inherited, #initialize, load, #name

Constructor Details

This class inherits a constructor from Command

Instance Method Details

#descriptionObject



178
179
180
# File 'lib/replicant/command.rb', line 178

def description
  "set a default package to work with"
end

#runObject



190
191
192
193
# File 'lib/replicant/command.rb', line 190

def run
  output "Setting default package to #{args.inspect}"
  @repl.default_package = args
end

#usageObject



182
183
184
# File 'lib/replicant/command.rb', line 182

def usage
  "#{name} com.mydomain.mypackage"
end

#valid_args?Boolean

Returns:

  • (Boolean)


186
187
188
# File 'lib/replicant/command.rb', line 186

def valid_args?
  args.present? && /^\w+(\.\w+)*$/ =~ args
end