gem by itself handles version now

This commit is contained in:
John Bintz 2012-06-11 16:46:34 -04:00
parent 1b97fa6078
commit bc09df6bce
3 changed files with 12 additions and 4 deletions

View File

@ -124,13 +124,13 @@ Feature: Gemfiles
Scenario: Single gem gets processed like a gems list
Given I have the file "Gemfile.penchant" with the content:
"""
gem 'one', :path => '../%s'
gem 'one', '1.2.3', :path => '../%s'
"""
When I rebuild the Gemfile for "local" mode
Then the file "Gemfile" should have the following content:
"""
# generated by penchant, environment: local
gem "one", {:path=>"../one"}
gem "one", "1.2.3", {:path=>"../one"}
"""
@mocha

View File

@ -233,11 +233,19 @@ module Penchant
end
def gem(*args)
gem_name, template = split_args(args)
gem_name = [ args.shift ]
template = {}
if args.last.kind_of?(::Hash)
template = args.pop
end
version = args.first
options = process_options(gem_name, template)
args = [ gem_name.first ]
args << version if version
args << options if !options.empty?
if options[:git]

View File

@ -1,3 +1,3 @@
module Penchant
VERSION = "0.2.4"
VERSION = "0.2.5"
end