File: path.rb

package info (click to toggle)
ruby-byebug 11.1.3-5
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 1,252 kB
  • sloc: ruby: 8,835; ansic: 1,662; sh: 6; makefile: 4
file content (40 lines) | stat: -rw-r--r-- 756 bytes parent folder | download | duplicates (4)
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
28
29
30
31
32
33
34
35
36
37
38
39
40
# frozen_string_literal: true

module Byebug
  module Helpers
    #
    # Utilities for managing gem paths
    #
    module PathHelper
      def bin_file
        @bin_file ||= File.join(root_path, "exe", "byebug")
      end

      def root_path
        @root_path ||= File.expand_path(File.join("..", "..", ".."), __dir__)
      end

      def lib_files
        @lib_files ||= glob_for("lib")
      end

      def test_files
        @test_files ||= glob_for("test")
      end

      def gem_files
        @gem_files ||= [bin_file] + lib_files
      end

      def all_files
        @all_files ||= gem_files + test_files
      end

      private

      def glob_for(dir)
        Dir.glob(File.join(root_path, dir, "**", "*.rb"))
      end
    end
  end
end