Class: AppMap::Config::Package

Inherits:
Struct
  • Object
show all
Defined in:
lib/appmap/config.rb

Instance Attribute Summary collapse

Class Method Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#excludeObject

Returns the value of attribute exclude

Returns:

  • (Object)

    the current value of exclude



5
6
7
# File 'lib/appmap/config.rb', line 5

def exclude
  @exclude
end

#gemObject

Returns the value of attribute gem

Returns:

  • (Object)

    the current value of gem



5
6
7
# File 'lib/appmap/config.rb', line 5

def gem
  @gem
end

#labelsObject

Returns the value of attribute labels

Returns:

  • (Object)

    the current value of labels



5
6
7
# File 'lib/appmap/config.rb', line 5

def labels
  @labels
end

#package_nameObject

Returns the value of attribute package_name

Returns:

  • (Object)

    the current value of package_name



5
6
7
# File 'lib/appmap/config.rb', line 5

def package_name
  @package_name
end

#pathObject

Returns the value of attribute path

Returns:

  • (Object)

    the current value of path



5
6
7
# File 'lib/appmap/config.rb', line 5

def path
  @path
end

#shallowObject

Returns the value of attribute shallow

Returns:

  • (Object)

    the current value of shallow



5
6
7
# File 'lib/appmap/config.rb', line 5

def shallow
  @shallow
end

Class Method Details

.build_from_gem(gem, shallow: true, package_name: nil, exclude: [], labels: []) ⇒ Object



18
19
20
21
22
# File 'lib/appmap/config.rb', line 18

def build_from_gem(gem, shallow: true, package_name: nil, exclude: [], labels: [])
  gem_paths(gem).map do |gem_path|
    Package.new(gem_path, gem, package_name, exclude, labels, shallow)
  end
end

.build_from_path(path, shallow: false, package_name: nil, exclude: [], labels: []) ⇒ Object



14
15
16
# File 'lib/appmap/config.rb', line 14

def build_from_path(path, shallow: false, package_name: nil, exclude: [], labels: [])
  Package.new(path, nil, package_name, exclude, labels, shallow)
end

Instance Method Details

#nameObject



36
37
38
# File 'lib/appmap/config.rb', line 36

def name
  gem || path
end

#shallow?Boolean

Indicates that only the entry points to a package will be recorded. Once the code has entered a package, subsequent calls within the package will not be recorded unless the code leaves the package and re-enters it.

Returns:

  • (Boolean)


9
10
11
# File 'lib/appmap/config.rb', line 9

def shallow?
  shallow
end

#to_hObject



40
41
42
43
44
45
46
47
48
49
# File 'lib/appmap/config.rb', line 40

def to_h
  {
    path: path,
    package_name: package_name,
    gem: gem,
    exclude: exclude.blank? ? nil : exclude,
    labels: labels.blank? ? nil : labels,
    shallow: shallow
  }.compact
end