Sha256: cbe9edcf9106b9d0a5688b35f1d5e363897b70ee4406572a0c2f58e6eaf6f646
Contents?: true
Size: 1.07 KB
Versions: 14
Compression:
Stored size: 1.07 KB
Contents
require 'gem/release/context/gem' require 'gem/release/context/git' require 'gem/release/context/paths' require 'gem/release/context/ui' module Gem module Release class Context attr_accessor :config, :gem, :git, :ui def initialize(*args) opts = args.last.is_a?(Hash) ? args.pop : {} name = args.shift @config = Config.new @gem = Gem.new(name || File.basename(Dir.pwd)) @git = Git.new @ui = Ui.new(opts) end def run(cmd) system(cmd) end def gem_cmd(cmd, *args) ::Gem::Commands.const_get("#{cmd.to_s.capitalize}Command").new.invoke(*args.flatten) # TODO what's with the return value? maybe add our own abstraction that can check the result? true end def in_dirs(args, opts, &block) Paths::ByNames.new(args, opts).in_dirs(&block) end def in_gem_dirs(args, opts, &block) Paths::ByGemspecs.new(args, opts).in_dirs(&block) end def abort(str) ui.error(str) exit 1 end end end end
Version data entries
14 entries across 14 versions & 1 rubygems