Class: Jenkins::Plugin::Tools::Loadpath
- Inherits:
-
Object
- Object
- Jenkins::Plugin::Tools::Loadpath
- Defined in:
- lib/jenkins/plugin/tools/loadpath.rb
Instance Method Summary collapse
-
#initialize(*groups) ⇒ Loadpath
constructor
A new instance of Loadpath.
- #to_a ⇒ Object
- #to_path ⇒ Object
Constructor Details
#initialize(*groups) ⇒ Loadpath
Returns a new instance of Loadpath.
5 6 7 8 |
# File 'lib/jenkins/plugin/tools/loadpath.rb', line 5 def initialize(*groups) require 'bundler' @groups = groups.empty? ? [:default] : groups end |
Instance Method Details
#to_a ⇒ Object
14 15 16 17 18 19 20 21 22 23 24 |
# File 'lib/jenkins/plugin/tools/loadpath.rb', line 14 def to_a [].tap do |paths| specs = Bundler.definition.specs_for @groups.map {|g| g.to_sym} for spec in specs next if spec.name == "bundler" for path in spec.require_paths paths << File.join(spec.full_gem_path, path) end end end end |
#to_path ⇒ Object
10 11 12 |
# File 'lib/jenkins/plugin/tools/loadpath.rb', line 10 def to_path to_a.join(File::PATH_SEPARATOR) end |