add bundler encoding fix, bump version

This commit is contained in:
John Bintz 2013-07-25 15:26:00 -04:00
parent eeb743467d
commit de06f3e3e3
4 changed files with 30 additions and 2 deletions

View File

@ -32,6 +32,9 @@ source :rubygems
# ensure git hooks are installed when a gemfile is processed, see below
ensure_git_hooks!
# need the bundler UTF-8 fix? ask for it by name!
bundler_encoding_fix!
# deploying to heroku and want 1.9.3 goodness?
ruby '1.9.3'

View File

@ -263,7 +263,6 @@ Feature: Gemfiles
gem "two", {:require=>nil}
"""
@wip
Scenario: Set the opposite environment in the environment defaults
Given I have the file "Gemfile.penchant" with the content:
"""
@ -423,3 +422,20 @@ Feature: Gemfiles
# generated by penchant, environment: local
ruby "1.9.3"
"""
Scenario: Ask for the Gemfile encoding fix
Given I have the file "Gemfile.penchant" with the content:
"""
bundler_encoding_fix!
"""
When I rebuild the Gemfile for "local" mode
Then the file "Gemfile" should have the following content:
"""
# generated by penchant, environment: local
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
"""

View File

@ -185,6 +185,15 @@ module Penchant
passthrough :ruby, *args
end
def bundler_encoding_fix!
self << (<<-RB)
if RUBY_VERSION =~ /1.9/
Encoding.default_external = Encoding::UTF_8
Encoding.default_internal = Encoding::UTF_8
end
RB
end
def gemspec
passthrough :gemspec
end

View File

@ -1,3 +1,3 @@
module Penchant
VERSION = "0.2.27"
VERSION = "0.2.28"
end