Sha256: 9ddbbafabe2e9e1153f8205b26bb66a43f5b56a24908fcfd6a4bd70550decbcd

Contents?: true

Size: 558 Bytes

Versions: 12

Compression:

Stored size: 558 Bytes

Contents

# frozen_string_literal: true

module Jive
  class Project
    attr_reader :path

    def initialize(path)
      @path = path
    end

    def bootstrap(shell)
      tasks = []
      tasks << [:asdf, "install"]
      tasks << [:bundle, "install"] if bundler?
      tasks << [:yarn, "install"] if yarn?

      shell.run_safely do
        shell.run_each(tasks)
      end
    end

    private

    def bundler?
      path.join("Gemfile").exist? ||
        path.glob("*.gemspec").any?
    end

    def yarn?
      path.join("yarn.lock").exist?
    end
  end
end

Version data entries

12 entries across 12 versions & 1 rubygems

Version Path
jive-0.7.0 lib/jive/project.rb
jive-0.6.0 lib/jive/project.rb
jive-0.5.0 lib/jive/project.rb
jive-0.4.4 lib/jive/project.rb
jive-0.4.3 lib/jive/project.rb
jive-0.4.2 lib/jive/project.rb
jive-0.4.1 lib/jive/project.rb
jive-0.4.0 lib/jive/project.rb
jive-0.3.3 lib/jive/project.rb
jive-0.3.2 lib/jive/project.rb
jive-0.3.1 lib/jive/project.rb
jive-0.3.0 lib/jive/project.rb