Class: RubyLens::ShowcaseWriter
- Inherits:
-
ReportWriter
- Object
- ReportWriter
- RubyLens::ShowcaseWriter
- Defined in:
- lib/rubylens/showcase_writer.rb
Constant Summary collapse
- MARKER =
'<meta name="rubylens-artifact" content="showcase">'- SHELL_PATH =
File.("../../assets/shells/showcase.html", __dir__)
- STYLESHEET_PATH =
File.("../../assets/styles/showcase.css", __dir__)
- RUNTIME_PATH =
File.("../../assets/runtime/report.js", __dir__)
Constants inherited from ReportWriter
ReportWriter::MODEL_PLACEHOLDER
Instance Method Summary collapse
-
#initialize ⇒ ShowcaseWriter
constructor
A new instance of ShowcaseWriter.
- #rubylens_showcase?(path) ⇒ Boolean
Methods inherited from ReportWriter
Constructor Details
#initialize ⇒ ShowcaseWriter
Returns a new instance of ShowcaseWriter.
12 13 14 15 16 17 18 |
# File 'lib/rubylens/showcase_writer.rb', line 12 def initialize super(asset_assembler: ReportAssetAssembler.new( shell_path: SHELL_PATH, stylesheet_path: STYLESHEET_PATH, runtime_path: RUNTIME_PATH, )) end |
Instance Method Details
#rubylens_showcase?(path) ⇒ Boolean
20 21 22 23 24 |
# File 'lib/rubylens/showcase_writer.rb', line 20 def rubylens_showcase?(path) File.file?(path) && File.open(path, "rb") { |file| file.read(2048).include?(MARKER) } rescue Errno::ENOENT, Errno::EACCES false end |