Permalink
Browse files

rework to use psyched_yaml by adding Bundler to $LOAD_PATH

  • Loading branch information...
1 parent 01f07c8 commit 148d1f7ab04a13da4b580a53fac1cea0081055a1 @hone hone committed Mar 19, 2013
Showing with 4 additions and 5 deletions.
  1. +2 −0 lib/language_pack/ruby.rb
  2. +2 −5 vendor/syck_hack.rb
@@ -404,9 +404,11 @@ def build_bundler
yaml_include = File.expand_path("#{libyaml_dir}/include")
yaml_lib = File.expand_path("#{libyaml_dir}/lib")
pwd = run("pwd").chomp
+ bundler_path = "#{pwd}/#{slug_vendor_base}/gems/#{BUNDLER_GEM_PATH}/lib"
# we need to set BUNDLE_CONFIG and BUNDLE_GEMFILE for
# codon since it uses bundler.
env_vars = "env BUNDLE_GEMFILE=#{pwd}/Gemfile BUNDLE_CONFIG=#{pwd}/.bundle/config CPATH=#{yaml_include}:$CPATH CPPATH=#{yaml_include}:$CPPATH LIBRARY_PATH=#{yaml_lib}:$LIBRARY_PATH RUBYOPT=\"#{syck_hack}\""
+ env_vars += " BUNDLER_LIB_PATH=#{bundler_path}" if ruby_version == "ruby-1.8.7"
puts "Running: #{bundle_command}"
bundler_output << pipe("#{env_vars} #{bundle_command} --no-clean 2>&1")
View
@@ -10,11 +10,8 @@
# class no matter if the full yaml library has loaded or not.
#
-begin
- require 'rubygems'
- require 'bundler/psyched_yaml'
-rescue LoadError
-end
+$: << ENV['BUNDLER_LIB_PATH'] if ENV['BUNDLER_LIB_PATH']
+require 'bundler/psyched_yaml'
module YAML
# In newer 1.9.2, there is a Syck toplevel constant instead of it

0 comments on commit 148d1f7

Please sign in to comment.