Class: EASYFPM::CommandLine

Inherits:
Object
  • Object
show all
Defined in:
lib/easyfpm/commandline.rb

Instance Method Summary collapse

Constructor Details

#initializeCommandLine

Returns a new instance of CommandLine.



20
21
22
23
24
25
26
27
# File 'lib/easyfpm/commandline.rb', line 20

def initialize()
  @easyfpmconf = UnixConfigStyle.new()
  @verbose = false
  @dryrun = false
  @debug=false
  @labels = []
  parse()
end

Instance Method Details

For debugging purpose, print the UnixConfigStyle object for this instance



249
250
251
# File 'lib/easyfpm/commandline.rb', line 249

def print()
  @easyfpmconf.print()
end

#runObject

Run the command line given def run(*args)



255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
# File 'lib/easyfpm/commandline.rb', line 255

def run()
  returnCode=true
  if @labels.empty?
    easyfpmpkg = EASYFPM::Packaging.new(@easyfpmconf)
    easyfpmpkg.verbose = @verbose
    easyfpmpkg.dryrun = @dryrun
    easyfpmpkg.debug = @debug
    returnCode=false unless easyfpmpkg.makeAll()
  else
    @labels.each do |label|
      easyfpmpkg = EASYFPM::Packaging.new(@easyfpmconf,label)
      easyfpmpkg.verbose = @verbose
      easyfpmpkg.dryrun = @dryrun
      easyfpmpkg.debug = @debug
      returnCode=false unless easyfpmpkg.make(label)
    end
  end
  return returnCode
end