Sha256: 990f224639ec28747606bc594d2de1f3fb951df92206f40531ddc089e87f5551

Contents?: true

Size: 819 Bytes

Versions: 4

Compression:

Stored size: 819 Bytes

Contents

module Pah
  module Templates
    class Gem < Pah::Template
      def call
        copy_static_file 'Gemfile'

        gsub_file 'Gemfile', /RUBY_VERSION/, ::Pah::RUBY_VERSION
        gsub_file 'Gemfile', /RAILS_VERSION/, ::Pah::RAILS_VERSION

        begin
          require 'bundler'
        rescue LoadError
          # Install bundler if needed
          unless run 'gem install bundler --no-ri --no-rdoc'
            puts 'Error installing bundler, will attempt to continue'
          end
          require 'bundler'
        end

        # Install all other gems needed from Gemfile
        unless run 'bundle install --jobs=4'
          puts 'Error installing gems, aborting'
          exit 1
        end

        git add: 'Gemfile*'
        git_commit 'Add Gemfile and Gemfile.lock.'
      end
    end
  end
end

Version data entries

4 entries across 4 versions & 1 rubygems

Version Path
pah-0.0.20 lib/pah/templates/gems.rb
pah-0.0.19 lib/pah/templates/gems.rb
pah-0.0.17 lib/pah/templates/gems.rb
pah-0.0.16 lib/pah/templates/gems.rb