Module: Gem::GemspecHelpers

Included in:
Commands::BuildCommand, Commands::RebuildCommand
Defined in:
lib/rubygems/gemspec_helpers.rb

Overview

Mixin methods for commands that work with gemspecs.

Instance Method Summary collapse

Instance Method Details

#find_gemspec(glob = "*.gemspec") ⇒ Object



9
10
11
12
13
14
15
16
17
18
# File 'lib/rubygems/gemspec_helpers.rb', line 9

def find_gemspec(glob = "*.gemspec")
  gemspecs = Dir.glob(glob).sort

  if gemspecs.size > 1
    alert_error "Multiple gemspecs found: #{gemspecs}, please specify one"
    terminate_interaction(1)
  end

  gemspecs.first
end