Sha256: cbf663059e9e2470372201db86f2ecc9fbf684b0b75e45e104611a707eddbf07
Contents?: true
Size: 1.04 KB
Versions: 7
Compression:
Stored size: 1.04 KB
Contents
require 'forwardable' module Gem module Release module Helper extend Forwardable def_delegators :context, :gem, :git, :ui def run(cmd) return true if send(cmd) end def cmd(cmd, *args) if cmd.is_a?(Symbol) info cmd, *args cmd = self.class::CMDS[cmd] % args end cmd = cmd.strip ui.cmd cmd result = pretend? ? true : context.run(cmd) abort "The command `#{cmd}` was unsuccessful." unless result end def gem_cmd(cmd, *args) info cmd, *args if cmd.is_a?(Symbol) ui.cmd "gem #{cmd} #{args.join(' ')}" pretend? ? true : context.gem_cmd(cmd, *args) end %w(announce notice info warn error).each do |level| define_method(level) do |msg, *args| ui.send(level, msg, args, self.class::MSGS) end end def abort(msg, *args) msg = self.class::MSGS[msg] % args if msg.is_a?(Symbol) msg = "#{msg} Aborting." context.abort(msg) end end end end
Version data entries
7 entries across 7 versions & 1 rubygems