Sha256: 21c0d5ff5180678ac6debe9baa849a3a83771eff47f57f842709e20f55587a7c

Contents?: true

Size: 776 Bytes

Versions: 36

Compression:

Stored size: 776 Bytes

Contents

# frozen_string_literal: true

require 'bolt/module_installer/puppetfile/module'

# This class represents a resolved Git module.
#
module Bolt
  class ModuleInstaller
    class Puppetfile
      class GitModule < Module
        attr_reader :git, :ref

        def initialize(name, git, ref)
          super(name)
          @git  = git
          @ref  = ref
          @type = :git
        end

        # Returns a Puppetfile module specification.
        #
        def to_spec
          "mod '#{@name}',\n  git: '#{@git}',\n  ref: '#{@ref}'"
        end

        # Returns a hash that can be used to create a module specification.
        #
        def to_hash
          {
            'git' => @git,
            'ref' => @ref
          }
        end
      end
    end
  end
end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
bolt-3.17.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.16.1 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.16.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.15.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.14.1 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.13.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.12.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.11.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.10.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.9.2 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.9.1 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.9.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.8.1 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.8.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.7.1 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.7.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.6.1 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.6.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.5.0 lib/bolt/module_installer/puppetfile/git_module.rb
bolt-3.4.0 lib/bolt/module_installer/puppetfile/git_module.rb