File: scripts.rb

package info (click to toggle)
puppet-agent 8.10.0-6
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 27,404 kB
  • sloc: ruby: 286,820; sh: 492; xml: 116; makefile: 88; cs: 68
file content (27 lines) | stat: -rw-r--r-- 573 bytes parent folder | download | duplicates (2)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

require 'puppet/file_serving/mount'

class Puppet::FileServing::Mount::Scripts < Puppet::FileServing::Mount
  # Return an instance of the appropriate class.
  def find(path, request)
    raise _("No module specified") if path.to_s.empty?

    module_name, relative_path = path.split("/", 2)
    mod = request.environment.module(module_name)
    return nil unless mod

    mod.script(relative_path)
  end

  def search(path, request)
    result = find(path, request)
    if result
      [result]
    end
  end

  def valid?
    true
  end
end