Skip to content

Commit

Permalink
removed binstubs which were causing trouble. updated the update_gemfi…
Browse files Browse the repository at this point in the history
…le_jail.rb file
  • Loading branch information
Philip (flip) Kromer committed Jul 31, 2011
1 parent 8cea45d commit 6287616
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 15 deletions.
2 changes: 2 additions & 0 deletions Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ Jeweler::Tasks.new do |gem|

gem.required_ruby_version = '>=1.9.2'

gem.executables = []

gem.add_dependency 'yajl-ruby', "~> 0.8.2"
gem.add_dependency 'gorillib', "~> 0.1.1"
gem.add_dependency 'configliere', "~> 0.4.7"
Expand Down
20 changes: 6 additions & 14 deletions bin/update_gemfile_jail.rb
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#!/usr/bin/env ruby
#/ Usage: config/bootstrap.rb [<options>]
#/ Usage: bin/update_gemfile_jail.rb [<options>]
#/ Bootstraps the gem environment.
#/
#/ Options are passed through to the bundle-install command. In most cases you
Expand Down Expand Up @@ -31,7 +31,7 @@
end

# go into the project root because it makes everything easier
::ROOT_DIR = File.expand_path('.') unless defined?(::ROOT_DIR)
::ROOT_DIR = File.expand_path(File.dirname(__FILE__)+'/..') unless defined?(::ROOT_DIR)
p ::ROOT_DIR
root = ::ROOT_DIR
Dir.chdir(root)
Expand All @@ -50,19 +50,11 @@
end

# record the Gemfile checksum so we can tell if the Gemfile has changed
# since our loadpath was last generated. this is used in config/boot.rb
# since our loadpath was last generated. this is used in lib/use_gemfile_jail.rb
# to verify the environment is bootstrapped and up-to-date.
checksum = `cksum Gemfile`.to_i
installed = File.read('.bundle/checksum').to_i rescue nil

BIN_HEADER = %q{
#!/usr/bin/env #{RbConfig::CONFIG['ruby_install_name']}
#
# This file was generated by bin/armando_gemfile_jail.rb
require '#{root}/lib/use_gemfile_jail'
load File.join('#{spec.full_gem_path}', '.vendor', '#{spec.bindir}', '#{executable}')
}

# run a quick check to see if everything's installed and up-to-date so we can
# skip the install and loadpath generation step if possible.
if checksum == installed && system('bundle check 1>/dev/null 2>&1')
Expand Down Expand Up @@ -101,10 +93,10 @@

# write binstubs for all executables. we can't use bundler's --binstubs option
# because the generated executables require 'bundler/setup'. the binstubs
# generated here require only config/boot.rb, which sets up the loadpath
# generated here require only lib/use_gemfile_jail, which sets up the loadpath
# manually using the .bundle/loadpath file.
Dir.mkdir ".vendor/bin" unless File.directory?(".vendor/bin")
template = BIN_HEADER # DATA.read
template = DATA.read
lineno = File.read(__FILE__).count("\n") - template.count("\n")
bundle.gems.each do |spec|
spec.executables.each do |executable|
Expand All @@ -119,6 +111,6 @@
__END__
#!/usr/bin/env #{RbConfig::CONFIG['ruby_install_name']}
#
# This file was generated by bin/create_gemfile_jail.rb
# This file was generated by bin/update_gemfile_jail.rb
require '#{root}/lib/use_gemfile_jail'
load File.join('#{spec.full_gem_path}', '.vendor', '#{spec.bindir}', '#{executable}')
1 change: 0 additions & 1 deletion senor_armando.gemspec
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,6 @@ Gem::Specification.new do |s|
s.date = %q{2011-07-31}
s.description = %q{Helper middlewares for a Goliath (http://goliath.io/) app as used in Infochimps Planet of the APIs}
s.email = %q{[email protected]}
s.executables = [%q{armando_demo_of_async_fibers.rb}, %q{armando_echo.rb}, %q{armando_elsewhere.rb}, %q{armando_proxy.rb}, %q{armando_raises_hell.rb}, %q{armando_sleepy.rb}, %q{auth_and_rate_limit.rb}, %q{barrier_aroundware_demo.rb}, %q{rasterize_and_shorten.rb}, %q{update_gemfile_jail.rb}]
s.extra_rdoc_files = [
"LICENSE.txt",
"README.md"
Expand Down

0 comments on commit 6287616

Please sign in to comment.