Class: GreenPepper::AtlassianRepository
- Inherits:
-
Object
- Object
- GreenPepper::AtlassianRepository
- Defined in:
- lib/greenpepper/repository/atlassianrepository.rb
Instance Method Summary collapse
-
#initialize(uri, server = nil) ⇒ AtlassianRepository
constructor
A new instance of AtlassianRepository.
- #load_document(filename) ⇒ Object
- #parse_input_filename(filename) ⇒ Object
Constructor Details
#initialize(uri, server = nil) ⇒ AtlassianRepository
Returns a new instance of AtlassianRepository.
13 14 15 16 17 18 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 13 def initialize(uri, server = nil) uri = AtlassianURI.new(uri) if uri.is_a?(String) @uri = uri server = Confluence::Server.new(@uri.url, @uri.handler) unless server @repo = server end |
Instance Method Details
#load_document(filename) ⇒ Object
20 21 22 23 24 25 26 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 20 def load_document(filename) filename = CGI::unescape(filename) parse_input_filename filename return @repo.getRenderedSpecification(@uri.username, @uri.password, [@uri.space, @input_filename, false, true]) end |
#parse_input_filename(filename) ⇒ Object
28 29 30 31 32 33 34 35 36 37 38 |
# File 'lib/greenpepper/repository/atlassianrepository.rb', line 28 def parse_input_filename(filename) # format of filename : FILENAME?ATTRIBUTES @file_attributes = Hash.new filename_parts = filename.split "?" @input_filename = filename_parts[0] if filename_parts.size > 1 attribute_parts = filename_parts[1].split "=" @file_attributes[attribute_parts[0]] = attribute_parts[1] end end |