Skip to content

Commit

Permalink
Fix gem version to work with Rubygems < 2.1
Browse files Browse the repository at this point in the history
Rubygems < 2.1 does not support dashes in gem versions.  Rubygems >= 2.2
automatically substitutes dashes with ".pre.".  We now emulate the
2.2 behavior so we are compatible with < 2.1.

MSP-10714
  • Loading branch information
bturner-r7 committed Jul 16, 2014
1 parent 6cda66e commit a4c549c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 1 deletion.
12 changes: 12 additions & 0 deletions lib/yard/metasploit/erd/version.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,20 @@ def self.full

version
end

# The full gem version string, including the {MAJOR}, {MINOR}, {PATCH}, and optionally, the {PRERELEASE} in the
# {http://guides.rubygems.org/specification-reference/#version RubyGems versioning} format.
#
# @return [String] '{MAJOR}.{MINOR}.{PATCH}' on master. '{MAJOR}.{MINOR}.{PATCH}.{PRERELEASE}' on any branch
# other than master.
def self.gem
full.gsub('-', '.pre.')
end
end

# @see Version.gem
GEM_VERSION = Version.gem

# @see Version.full
VERSION = Version.full
end
Expand Down
2 changes: 1 addition & 1 deletion yard-metasploit-erd.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ require 'yard/metasploit/erd/version'

Gem::Specification.new do |spec|
spec.name = 'yard-metasploit-erd'
spec.version = YARD::Metasploit::ERD::VERSION
spec.version = YARD::Metasploit::ERD::GEM_VERSION
spec.authors = ['Luke Imhoff']
spec.email = ['luke_imhoff@rapid7.com']
spec.summary = 'YARD plugin that add Metasploit::ERDs to namespaces and classes'
Expand Down

0 comments on commit a4c549c

Please sign in to comment.