Sha256: 45bdbe96cede10a7cec1f47e35d3bdd06a2b82d4252e782195a7d6507b1753ec
Contents?: true
Size: 766 Bytes
Versions: 21
Compression:
Stored size: 766 Bytes
Contents
# frozen_string_literal: true require "dry/monads" require "refinements/pathname" require "rubygems/command_manager" module Gemsmith module Tools # Builds a gem package for distribution. class Packager include Dry::Monads[:result] using Refinements::Pathname def initialize command: Gem::CommandManager.new @command = command end # :reek:TooManyStatements def call specification command.run ["build", "#{specification.name}.gemspec"] specification.package_path.then { |path| path.make_ancestors.basename.copy path.parent } Success specification rescue Gem::Exception => error Failure error.message end private attr_reader :command end end end
Version data entries
21 entries across 21 versions & 1 rubygems