Sha256: e1412c4bd4184d575bcc906fafaf10ab9af2f0cdfd19733e7dadf093bed9b05d

Contents?: true

Size: 993 Bytes

Versions: 2

Compression:

Stored size: 993 Bytes

Contents

module Cany
  module Recipes
    class Bundler < Cany::Recipe
      register_as :bundler

      def clean
        rmtree 'bundler'
        # rmtree 'vendor/bundle' -- do not remove gems, increase testing time
        inner.clean
      end

      def build
        ENV['GEM_PATH'] = 'bundler'
        ENV['PATH'] = 'bundler/bin:' + ENV['PATH']
        ruby_bin 'gem', %w(install bundler --no-ri --no-rdoc --install-dir bundler --bindir bundler/bin)
        ruby_bin 'bundle', %w(install --deployment --without development test)
        inner.build
      end

      def binary
        install 'bundler', "/usr/share/#{spec.name}"
        install '.bundle', "/usr/share/#{spec.name}"
        install 'vendor/bundle', "/usr/share/#{spec.name}/vendor"
        install_content "/usr/bin/#{spec.name}", "#!/bin/sh
cd /usr/share/#{spec.name}
export GEM_PATH=/usr/share/#{spec.name}/bundler
exec /usr/share/#{spec.name}/bundler/bin/bundle exec \"$@\"
"
        inner.binary
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
cany-0.0.2 lib/cany/recipes/bundler.rb
cany-0.0.1 lib/cany/recipes/bundler.rb