Sha256: e7095c9148337f3df3c14030fed71c6015a9a0fc41d275187154eb7f181f2e3e

Contents?: true

Size: 467 Bytes

Versions: 7

Compression:

Stored size: 467 Bytes

Contents

module HaveAPI::Fs::Components
  class MdHelpFile < HelpFile
    def initialize(*args)
      super

      @layout = ERB.new(::File.open(template_path('layout')).read, 0, '-')
      @template = ERB.new(
          ::File.open(template_path(@c.class)).read,
          0, '-'
      )
    end

    def read
      layout(@layout) do
        @template.result(binding)
      end
    end

    protected
    def safe_print(str)
      str.to_s.gsub('_', '\_')
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
haveapi-fs-0.11.0 lib/haveapi/fs/components/md_help_file.rb
haveapi-fs-0.10.0 lib/haveapi/fs/components/md_help_file.rb
haveapi-fs-0.9.0 lib/haveapi/fs/components/md_help_file.rb
haveapi-fs-0.8.0 lib/haveapi/fs/components/md_help_file.rb
haveapi-fs-0.7.1 lib/haveapi/fs/components/md_help_file.rb
haveapi-fs-0.7.0 lib/haveapi/fs/components/md_help_file.rb
haveapi-fs-0.1.0 lib/haveapi/fs/components/md_help_file.rb