Sha256: 21baa90edac3ebddfbeac7a13e4ff383f001d105174e9b4d217b808f01564b2c

Contents?: true

Size: 715 Bytes

Versions: 3

Compression:

Stored size: 715 Bytes

Contents

# frozen_string_literal: true

module Hanamimastery
  module CLI
    module Commands
      class ToPRO < Dry::CLI::Command
        desc 'Renders HTML out of Markdown'
        argument :episode, type: :integer, required: :true, desc: "Episode's ID to render"
        option :save, aliases: ['-s'], type: :boolean, default: false, desc: 'Save to file?'

        include Deps[
          repository: 'repositories.episodes',
          transformation: 'transformations.to_pro'
        ]

        def call(episode:, save:, **)
          content = repository.fetch(episode).content
          processed = transformation.call(content)
          repository.replace(episode, processed)
        end
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
hanamimastery-cli-0.4.0 lib/hanamimastery/cli/commands/to_pro.rb
hanamimastery-cli-0.3.1 lib/hanamimastery/cli/commands/to_pro.rb
hanamimastery-cli-0.3.0 lib/hanamimastery/cli/commands/to_pro.rb