Module: PomPomPom::UrlBuilder

Included in:
Dependency, Pom
Defined in:
lib/pompompom/url_builder.rb

Instance Method Summary collapse

Instance Method Details

#append_slash(repository_url) ⇒ Object



24
25
26
27
28
29
30
# File 'lib/pompompom/url_builder.rb', line 24

def append_slash(repository_url)
  if repository_url[-1,1] == '/'
    repository_url
  else
    repository_url + '/' 
  end
end

#file_url(repository_url, type) ⇒ Object



11
12
13
14
# File 'lib/pompompom/url_builder.rb', line 11

def file_url(repository_url, type)
  file_name = "#{artifact_id}-#{version}.#{type}"
  "#{append_slash(repository_url)}#{group_path}/#{artifact_id}/#{version}/#{file_name}"
end

#group_pathObject



32
33
34
# File 'lib/pompompom/url_builder.rb', line 32

def group_path
  group_id.split('.').join('/')
end

#jar_file_nameObject



16
17
18
# File 'lib/pompompom/url_builder.rb', line 16

def jar_file_name
  "#{artifact_id}-#{version}.jar"
end

#jar_url(repository_url) ⇒ Object



3
4
5
# File 'lib/pompompom/url_builder.rb', line 3

def jar_url(repository_url)
  file_url(repository_url, 'jar')
end

#metadata_url(repository_url) ⇒ Object



20
21
22
# File 'lib/pompompom/url_builder.rb', line 20

def (repository_url)
  "#{append_slash(repository_url)}#{group_path}/#{artifact_id}/maven-metadata.xml"
end

#pom_url(repository_url) ⇒ Object



7
8
9
# File 'lib/pompompom/url_builder.rb', line 7

def pom_url(repository_url)
  file_url(repository_url, 'pom')
end