Sha256: 2bf12027661d127b5c97f583fd7e1c995a0a6e90ce8b24cb559b90357adfefe8

Contents?: true

Size: 701 Bytes

Versions: 4

Compression:

Stored size: 701 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

4 entries across 4 versions & 1 rubygems

Version Path
hanamimastery-cli-0.3.1 lib/hanamimastery/cli/commands/unshot.rb
hanamimastery-cli-0.3.0 lib/hanamimastery/cli/commands/unshot.rb
hanamimastery-cli-0.2.2 lib/hanamimastery/cli/commands/unshot.rb
hanamimastery-cli-0.2.1 lib/hanamimastery/cli/commands/unshot.rb