Sha256: 45166d36f3a643903ac6a000bb6eaa1b814a5c10305803b32bd476cdf2d99484

Contents?: true

Size: 614 Bytes

Versions: 15

Compression:

Stored size: 614 Bytes

Contents

module Jets::Command
  class Help
    class << self
      def text(namespaced_command)
        file = namespaced_command.to_s.gsub(':','/')
        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.first.split(':').first
        unnamespaced_command = namespaced_command.to_s.split(':').last
        path = File.expand_path("../help/#{unnamespaced_command}.md", called_from)
        return IO.read(path) if File.exist?(path)
      end
    end
  end
end

Version data entries

15 entries across 15 versions & 1 rubygems

Version Path
jets-5.0.13 lib/jets/command/help.rb
jets-5.0.12 lib/jets/command/help.rb
jets-5.0.11 lib/jets/command/help.rb
jets-5.0.10 lib/jets/command/help.rb
jets-5.0.9 lib/jets/command/help.rb
jets-5.0.8 lib/jets/command/help.rb
jets-5.0.7 lib/jets/command/help.rb
jets-5.0.6 lib/jets/command/help.rb
jets-5.0.5 lib/jets/command/help.rb
jets-5.0.4 lib/jets/command/help.rb
jets-5.0.3 lib/jets/command/help.rb
jets-5.0.2 lib/jets/command/help.rb
jets-5.0.1 lib/jets/command/help.rb
jets-5.0.0 lib/jets/command/help.rb
jets-5.0.0.beta1 lib/jets/command/help.rb