class Corundum::GemCutter
Public Instance Methods
default_configuration(toolkit, build)
click to toggle source
Calls superclass method
# File lib/corundum/gemcutter.rb, line 16 def default_configuration(toolkit, build) super toolkit.copy_settings_to(self) self.build = build end
define()
click to toggle source
# File lib/corundum/gemcutter.rb, line 87 def define in_namespace do task :uninstall do |t| when_writing("Uninstalling #{gemfile.full_name}") do require "rubygems/commands/uninstall_command" uninstall = get_command Gem::Commands::UninstallCommand uninstall.options[:args] = [gem_path] uninstall.execute end end task :install => [gem_path] do |t| when_writing("Installing #{gem_path}") do require "rubygems/commands/install_command" install = get_command Gem::Commands::InstallCommand install.options[:args] = [gem_path] install.execute end end task :reinstall => [:uninstall, :install] task :dependencies_available do require 'corundum/qa-report' report = QA::Report.new("Gem dependencies[#{File::basename(gemspec.loaded_from)}]") qa_rejections << report checker = DepsChecker.build gemspec.runtime_dependencies.each do |dep| if checker.fulfilled?(dep) report.add("status", dep, nil, "fulfilled") else report.add("status", dep, nil, "missing") report.fail "Dependency unfulfilled remotely" end end end task :pinned_dependencies do return unless File::exists?("Gemfile.lock") require 'corundum/qa-report' require 'bundler/lockfile_parser' parser = File::open("Gemfile.lock") do |lockfile| Bundler::LockfileParser.new(lockfile.read) end report = QA::Report.new("Bundler pinned dependencies") qa_rejections << report runtime_deps = gemspec.runtime_dependencies.map(&:name) parser.dependencies.each do |_, dep| next unless runtime_deps.include? dep.name _, source = dep.source next if source.nil? next if source.respond_to?(:path) and source.path.to_s == "." report.add("source", dep, nil, source) report.fail("Pinned gem dependencies:\n" + " Specs depended on by the gemspec are pinned (by :path or :git) and " + "as a result, spec results are suspect\n") end end task :is_unpushed do checker = DepsChecker.build dep = Gem::Dependency.new(gemspec.name, ">= #{gemspec.version}") if checker.fulfilled?(dep) fail "Gem #{gemspec.full_name} is already pushed" end end desc 'Push a gem up to Gemcutter' task :push => [:dependencies_available, :is_unpushed] do require "rubygems/commands/push_command" push = get_command(Gem::Commands::PushCommand) push.options[:args] = [gem_path.abspath] push.execute end task :push => build_file.abspath end task :release => in_namespace(:push) task :preflight => in_namespace(:is_unpushed) task :run_quality_assurance => in_namespace(:dependencies_available, :pinned_dependencies) task :run_continuous_integration => in_namespace(:pinned_dependencies) end
get_command(klass, args=nil)
click to toggle source
# File lib/corundum/gemcutter.rb, line 49 def get_command(klass, args=nil) cmd = klass.new cmd.extend(CommandTweaks) cmd.setup_args(args) cmd end
resolve_configuration()
click to toggle source
Calls superclass method
# File lib/corundum/gemcutter.rb, line 22 def resolve_configuration super gem_path.relative_path = gemspec.file_name resolve_paths end