Class: GreenPepper::AtlassianURI

Inherits:
Object
  • Object
show all
Defined in:
lib/greenpepper/repository/atlassianrepository.rb

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(uri) ⇒ AtlassianURI

Returns a new instance of AtlassianURI.



43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 43

def initialize(uri)
  @uri = uri
  uri_parts = @uri.split ";"
  if uri_parts.size < 2 
    raise GreenPepperRepositoryError.new("Bad format of URI. " + uri) 
  end

  success = /(.*)\?handler=(.*)&(.*)#(.*)/ === uri_parts[1]
  if success == false
    raise GreenPepperRepositoryError.new(
      "Can't parse confluence URL")
  end
  @url = $1
  @handler = $2
  @space = $4
  attribute_parts = $3.split "="

  @username = ""
  @password = ""

  if uri_parts.size > 2
    @username = uri_parts[2]
    @password = uri_parts[3]
  end
end

Instance Attribute Details

#handlerObject (readonly)

Returns the value of attribute handler.



42
43
44
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42

def handler
  @handler
end

#passwordObject (readonly)

Returns the value of attribute password.



42
43
44
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42

def password
  @password
end

#spaceObject (readonly)

Returns the value of attribute space.



42
43
44
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42

def space
  @space
end

#uriObject (readonly)

Returns the value of attribute uri.



42
43
44
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42

def uri
  @uri
end

#urlObject (readonly)

Returns the value of attribute url.



42
43
44
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42

def url
  @url
end

#usernameObject (readonly)

Returns the value of attribute username.



42
43
44
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42

def username
  @username
end