Class: GreenPepper::AtlassianURI
- Inherits:
-
Object
- Object
- GreenPepper::AtlassianURI
- Defined in:
- lib/greenpepper/repository/atlassianrepository.rb
Instance Attribute Summary collapse
-
#handler ⇒ Object
readonly
Returns the value of attribute handler.
-
#password ⇒ Object
readonly
Returns the value of attribute password.
-
#space ⇒ Object
readonly
Returns the value of attribute space.
-
#uri ⇒ Object
readonly
Returns the value of attribute uri.
-
#url ⇒ Object
readonly
Returns the value of attribute url.
-
#username ⇒ Object
readonly
Returns the value of attribute username.
Instance Method Summary collapse
-
#initialize(uri) ⇒ AtlassianURI
constructor
A new instance of AtlassianURI.
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
#handler ⇒ Object (readonly)
Returns the value of attribute handler.
42 43 44 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42 def handler @handler end |
#password ⇒ Object (readonly)
Returns the value of attribute password.
42 43 44 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42 def password @password end |
#space ⇒ Object (readonly)
Returns the value of attribute space.
42 43 44 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42 def space @space end |
#uri ⇒ Object (readonly)
Returns the value of attribute uri.
42 43 44 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42 def uri @uri end |
#url ⇒ Object (readonly)
Returns the value of attribute url.
42 43 44 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42 def url @url end |
#username ⇒ Object (readonly)
Returns the value of attribute username.
42 43 44 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 42 def username @username end |