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 Scenario: Single gem gets processed like a gems list
Given I have the file "Gemfile.penchant" with the content: 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 When I rebuild the Gemfile for "local" mode
Then the file "Gemfile" should have the following content: Then the file "Gemfile" should have the following content:
""" """
# generated by penchant, environment: local # generated by penchant, environment: local
gem "one", {:path=>"../one"} gem "one", "1.2.3", {:path=>"../one"}
""" """
@mocha @mocha

View File

@ -233,11 +233,19 @@ module Penchant
end end
def gem(*args) 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) options = process_options(gem_name, template)
args = [ gem_name.first ] args = [ gem_name.first ]
args << version if version
args << options if !options.empty? args << options if !options.empty?
if options[:git] if options[:git]

View File

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