Sha256: 62cfa7210c6d9ac87d30ca7bf89765719f9c83b6e81ae51c5c318844b1b5e984

Contents?: true

Size: 578 Bytes

Versions: 4

Compression:

Stored size: 578 Bytes

Contents

class Jets::CLI
  module Help
    extend self
    def text(namespaced_command)
      file = namespaced_command.to_s.tr(":", "/")
      path = File.expand_path("../help/#{file}.md", __FILE__)
      return IO.read(path) if File.exist?(path)

      # Also look up for a help folder within the current command folder
      called_from = caller(1..1).first.split(":").first
      unnamespaced_command = namespaced_command.to_s.split(":").last
      path = File.expand_path("../help/#{unnamespaced_command}.md", called_from)
      IO.read(path) if File.exist?(path)
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
jets-6.0.5 lib/jets/cli/help.rb
jets-6.0.4 lib/jets/cli/help.rb
jets-6.0.3 lib/jets/cli/help.rb
jets-6.0.2 lib/jets/cli/help.rb