class Object

Constants

REPOSITORY

Public Instance Methods

current_gemspec() click to toggle source

This Source Code Form is subject to the terms of the Mozilla Public License, v. 2.0. If a copy of the MPL was not distributed with this file, You can obtain one at mozilla.org/MPL/2.0/.

# File lib/yard_rideliner/task/ghpages_deploy.rb, line 8
def current_gemspec
  root = `git rev-parse --show-toplevel`.strip
  abort('Only git repositories are supported') unless $?

  gemspecs = Dir["#{root}/*.gemspec"]
  abort "No gemspec found in #{root}" if gemspecs.empty?

  spec = gemspecs.first
  if gemspecs.length > 1
    $stderr.puts "Warning: only using the first gemspec found (#{spec})."
  end

  Gem::Specification.load(spec)
end