Sha256: 7b5044a1288e3d2a77dd6b7969e2349541146c1dbec927a37d90caaabae78896

Contents?: true

Size: 847 Bytes

Versions: 60

Compression:

Stored size: 847 Bytes

Contents

require 'commands/meta/command'

module Nutella
    
  class Help < Command
    @description = 'Displays what every command does and how to use it'
  
    def run(args=nil)
      message=''
      Dir["#{File.dirname(__FILE__)}/*.rb"].each do |file|
        message += add_cmd_help(file)
      end
      console.info message
      console.success 'For more details on individual commands, see https://github.com/nutella-framework/nutella_framework/wiki/Nutella-Command-Line-Interface'
    end

    private

    def add_cmd_help(file)
      command = File.basename(file, File.extname(file))
      if command.length > 7
        message = "#{command}\t"
      else
        message = "#{command}\t\t"
      end
      message += Object::const_get("Nutella::#{command.capitalize}").description
      message += "\n"
      message
    end

  end
  
end


Version data entries

60 entries across 60 versions & 1 rubygems

Version Path
nutella_framework-0.4.23 lib/commands/help.rb
nutella_framework-0.4.22 lib/commands/help.rb
nutella_framework-0.4.21 lib/commands/help.rb
nutella_framework-0.4.20 lib/commands/help.rb
nutella_framework-0.4.19 lib/commands/help.rb
nutella_framework-0.4.18 lib/commands/help.rb
nutella_framework-0.4.17 lib/commands/help.rb
nutella_framework-0.4.16 lib/commands/help.rb
nutella_framework-0.4.13 lib/commands/help.rb
nutella_framework-0.4.12 lib/commands/help.rb
nutella_framework-0.4.11 lib/commands/help.rb
nutella_framework-0.4.10 lib/commands/help.rb
nutella_framework-0.4.9 lib/commands/help.rb
nutella_framework-0.4.8 lib/commands/help.rb
nutella_framework-0.4.5 lib/commands/help.rb
nutella_framework-0.4.4 lib/commands/help.rb
nutella_framework-0.4.3 lib/commands/help.rb
nutella_framework-0.4.2 lib/commands/help.rb
nutella_framework-0.4.1 lib/commands/help.rb
nutella_framework-0.4.0 lib/commands/help.rb