support the ruby version option
This commit is contained in:
parent
dacc9d9334
commit
a0f610602b
@ -411,3 +411,14 @@ Feature: Gemfiles
|
|||||||
gem "one"
|
gem "one"
|
||||||
"""
|
"""
|
||||||
|
|
||||||
|
Scenario: Pass through the Ruby version
|
||||||
|
Given I have the file "Gemfile.penchant" with the content:
|
||||||
|
"""
|
||||||
|
ruby '1.9.3'
|
||||||
|
"""
|
||||||
|
When I rebuild the Gemfile for "local" mode
|
||||||
|
Then the file "Gemfile" should have the following content:
|
||||||
|
"""
|
||||||
|
# generated by penchant, environment: local
|
||||||
|
ruby "1.9.3"
|
||||||
|
"""
|
||||||
|
@ -203,6 +203,10 @@ module Penchant
|
|||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
def ruby(version)
|
||||||
|
@output << %{ruby "#{version}"}
|
||||||
|
end
|
||||||
|
|
||||||
protected
|
protected
|
||||||
def args_to_string(args)
|
def args_to_string(args)
|
||||||
args.inspect[1..-2]
|
args.inspect[1..-2]
|
||||||
@ -218,9 +222,9 @@ module Penchant
|
|||||||
[ args, template ]
|
[ args, template ]
|
||||||
end
|
end
|
||||||
|
|
||||||
def call_and_indent_output(block)
|
def call_and_indent_output(block = nil, &given_block)
|
||||||
index = @output.length
|
index = @output.length
|
||||||
block.call
|
(block || given_block).call
|
||||||
index.upto(@output.length - 1) do |i|
|
index.upto(@output.length - 1) do |i|
|
||||||
@output[i] = " " + @output[i]
|
@output[i] = " " + @output[i]
|
||||||
end
|
end
|
||||||
|
Loading…
Reference in New Issue
Block a user