Sha256: 13a1e82ae6cf7d3b1f520d545afb9b11b1358f5fb004aa82a05e2a9dde589a6c

Contents?: true

Size: 538 Bytes

Versions: 21

Compression:

Stored size: 538 Bytes

Contents

# frozen_string_literal: true

require "dry/monads"
require "refinements/pathname"

module Gemsmith
  module Tools
    # Cleans gem artifacts.
    class Cleaner
      include Dry::Monads[:result]

      using Refinements::Pathname

      def initialize root_dir: Pathname.pwd
        @root_dir = root_dir
      end

      def call specification
        root_dir.join("pkg").remove_tree
        root_dir.files("**/*.gem").each(&:delete)
        Success specification
      end

      private

      attr_reader :root_dir
    end
  end
end

Version data entries

21 entries across 21 versions & 1 rubygems

Version Path
gemsmith-22.10.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.9.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.8.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.7.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.6.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.5.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.4.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.3.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.2.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.1.0 lib/gemsmith/tools/cleaner.rb
gemsmith-22.0.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.10.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.9.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.6.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.5.1 lib/gemsmith/tools/cleaner.rb
gemsmith-21.5.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.4.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.3.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.2.0 lib/gemsmith/tools/cleaner.rb
gemsmith-21.1.0 lib/gemsmith/tools/cleaner.rb