Class: TwitterCldr::Resources::Requirements::PomManager::Dep

Inherits:
Object
  • Object
show all
Defined in:
lib/twitter_cldr/resources/requirements/pom_manager.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(pom, group_id, artifact_id, version) ⇒ Dep

Returns a new instance of Dep.



18
19
20
21
22
23
# File 'lib/twitter_cldr/resources/requirements/pom_manager.rb', line 18

def initialize(pom, group_id, artifact_id, version)
  @pom = pom
  @group_id = group_id
  @artifact_id = artifact_id
  @version = version
end

Instance Attribute Details

#artifact_idObject (readonly)

Returns the value of attribute artifact_id.



16
17
18
# File 'lib/twitter_cldr/resources/requirements/pom_manager.rb', line 16

def artifact_id
  @artifact_id
end

#group_idObject (readonly)

Returns the value of attribute group_id.



16
17
18
# File 'lib/twitter_cldr/resources/requirements/pom_manager.rb', line 16

def group_id
  @group_id
end

#pomObject (readonly)

Returns the value of attribute pom.



16
17
18
# File 'lib/twitter_cldr/resources/requirements/pom_manager.rb', line 16

def pom
  @pom
end

#versionObject (readonly)

Returns the value of attribute version.



16
17
18
# File 'lib/twitter_cldr/resources/requirements/pom_manager.rb', line 16

def version
  @version
end

Instance Method Details

#pathObject



25
26
27
28
29
30
31
32
33
# File 'lib/twitter_cldr/resources/requirements/pom_manager.rb', line 25

def path
  @path ||= begin
    sub_path = File.join(*group_id.split('.'), artifact_id, version)

    pom.classpath.find do |cp|
      cp.include?(sub_path)
    end
  end
end