Class: RubyLens::ShowcaseGenerator
- Inherits:
-
Object
- Object
- RubyLens::ShowcaseGenerator
- Defined in:
- lib/rubylens/showcase_generator.rb
Constant Summary collapse
- DEFAULT_SHOWCASE_NAME =
"rubylens-showcase.html"
Instance Method Summary collapse
- #call ⇒ Object
-
#initialize(path: Dir.pwd, output: nil, lockfile: nil, details: false) ⇒ ShowcaseGenerator
constructor
A new instance of ShowcaseGenerator.
Constructor Details
#initialize(path: Dir.pwd, output: nil, lockfile: nil, details: false) ⇒ ShowcaseGenerator
Returns a new instance of ShowcaseGenerator.
13 14 15 16 17 18 |
# File 'lib/rubylens/showcase_generator.rb', line 13 def initialize(path: Dir.pwd, output: nil, lockfile: nil, details: false) @path = path @output = output @lockfile = lockfile @details = details end |
Instance Method Details
#call ⇒ Object
20 21 22 23 24 25 26 27 28 29 30 31 |
# File 'lib/rubylens/showcase_generator.rb', line 20 def call root = File.realpath(@path) output = @output || DefaultOutput.resolve(root: root, name: DEFAULT_SHOWCASE_NAME, description: "showcase") do |existing| ArtifactMarker.present?(existing, ShowcaseWriter::MARKER) end model, warnings = GenerationPipeline.new(root:, lockfile: @lockfile).call output_path = ShowcaseWriter.new.write(ShowcaseModel.new(model, details: @details).call, output: output) Result.new(output_path:, counts: model.fetch("totals").freeze, warnings:) rescue Errno::ENOENT, Errno::EACCES, Errno::ELOOP => error raise Error, error. end |