Sha256: ee39bbd84393da6e196237140f8635bc433881a5c9cfd8ab8d394acd5b083a41

Contents?: true

Size: 1019 Bytes

Versions: 9

Compression:

Stored size: 1019 Bytes

Contents

require 'aruba/api'

module Aruba
  class Console
    # Helpers for Aruba::Console
    module Help
      # Output help information
      def aruba_help
        puts 'Aruba Version: ' + Aruba::VERSION
        puts 'Issue Tracker: ' + 'https://github.com/cucumber/aruba/issues'
        puts "Documentation:\n" + %w(http://www.rubydoc.info/gems/aruba).map { |d| format('* %s', d) }.join("\n")
        puts

        nil
      end

      # List available methods in aruba
      def aruba_methods
        ms = if RUBY_VERSION < '1.9'
               # rubocop:disable Style/EachWithObject
               (Aruba::Api.instance_methods - Module.instance_methods).inject([]) { |a, e| a << format("* %s", e); a }.sort
               # rubocop:enable Style/EachWithObject
             else
               (Aruba::Api.instance_methods - Module.instance_methods).each_with_object([]) { |e, a| a << format("* %s", e) }.sort
             end

        puts "Available Methods:\n" + ms.join("\n")

        nil
      end
    end
  end
end

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
aruba-0.11.0.pre lib/aruba/console/help.rb
aruba-0.10.2 lib/aruba/console/help.rb
aruba-0.10.1 lib/aruba/console/help.rb
aruba-0.10.0 lib/aruba/console/help.rb
aruba-0.10.0.pre2 lib/aruba/console/help.rb
aruba-0.10.0.pre lib/aruba/console/help.rb
aruba-0.9.0 lib/aruba/console/help.rb
aruba-0.9.0.pre2 lib/aruba/console/help.rb
aruba-0.9.0.pre lib/aruba/console/help.rb