Sha256: 61f9bb258d4a1c92dc78b5d02cf355af8dd1af616e1aa05336c03e362d257852

Contents?: true

Size: 700 Bytes

Versions: 1

Compression:

Stored size: 700 Bytes

Contents

# frozen_string_literal: true

module Hanamimastery
  module CLI
    module Commands
      class Unshot < Dry::CLI::Command
        desc 'Removes shot marks from a given article (i.e. ""[🎬 01] ")'
        argument :episode, type: :integer, required: true, desc: "Episodes ID to unshot"

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

        attr_reader :transformation, :repository

        def call(episode:, **)
          content = repository.read(episode)
          processed = transformation.call(content, one: false)
          repository.replace(episode, processed)
        end
      end
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
hanamimastery-cli-0.4.0 lib/hanamimastery/cli/commands/unshot.rb