Sha256: cb14e385b5bf8867d4e79660261f1137864652189fdb752d15fb070f6277b561

Contents?: true

Size: 500 Bytes

Versions: 7

Compression:

Stored size: 500 Bytes

Contents

module HaveAPI::Fs::Components
  class HtmlHelpFile < 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 asset(path)
      ::File.join(@context.mountpoint, '.assets', path)
    end
  end
end

Version data entries

7 entries across 7 versions & 1 rubygems

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