Sha256: d34afa564fd0273a98cdf9b5af15f3deb95fbd59328c01509db66936d2f169fc

Contents?: true

Size: 735 Bytes

Versions: 12

Compression:

Stored size: 735 Bytes

Contents

# coding: utf-8

# module for all Thor subcommands
module CLISplash

  # Thor inherited class for documentation management
  class Documentation < Thor
    include Splash::Config
    include Splash::Exiter

    # Thor method : display the readme file Typicallly formatted in Markdown
    desc "readme", "Display README file"
    option :formatted, :type => :boolean, :default => true
    def readme
      filename = search_file_in_gem("prometheus-splash","README.md")

      if options[:formatted] then
        content = TTY::Markdown.parse_file(filename)
      else
        content = File::readlines(filename).join
      end
      pager = TTY::Pager.new
      pager.page(content)
      splash_exit case: :quiet_exit
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
prometheus-splash-0.9.1 lib/splash/cli/documentation.rb
prometheus-splash-0.9.0 lib/splash/cli/documentation.rb
prometheus-splash-0.8.6 lib/splash/cli/documentation.rb
prometheus-splash-0.8.5 lib/splash/cli/documentation.rb
prometheus-splash-0.8.4 lib/splash/cli/documentation.rb
prometheus-splash-0.8.3 lib/splash/cli/documentation.rb
prometheus-splash-0.8.2 lib/splash/cli/documentation.rb
prometheus-splash-0.8.1 lib/splash/cli/documentation.rb
prometheus-splash-0.8.0 lib/splash/cli/documentation.rb
prometheus-splash-0.7.0 lib/splash/cli/documentation.rb
prometheus-splash-0.6.1 lib/splash/cli/documentation.rb
prometheus-splash-0.6.0 lib/splash/cli/documentation.rb