From 962773d59d94f8d16dae11b6290fdf30aaf09d7b Mon Sep 17 00:00:00 2001 From: rautenberg Date: Mon, 3 Jun 2013 15:25:33 +0200 Subject: make yard documentation full yard 0.8.6.1 compatible --- lib/overwrite.rb | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) (limited to 'lib/overwrite.rb') diff --git a/lib/overwrite.rb b/lib/overwrite.rb index 52b8a9f..6a71338 100644 --- a/lib/overwrite.rb +++ b/lib/overwrite.rb @@ -38,19 +38,18 @@ class String # format of text (=string params) is preserved (e.g. line breaks) # urls are marked as links # - # @param [String] text this is the actual content, - # @param [optional,String] related_links info on related resources - # @param [optional,String] description general info - # @param [optional,Array] post_command, infos for the post operation, object defined below + # @param related_links [optional,String] uri on related resources + # @param description [optional,String] general info + # @param png_image [optional,String] imagename # @return [String] html page def to_html(related_links=nil, description=nil, png_image=nil ) - + # TODO add title as parameter title = nil #$sinatra.to($sinatra.request.env['PATH_INFO'], :full) if $sinatra html = "" html << ""+title+"" if title #html += "<\/img>" - + html << "

Description

"+description.link_urls+"

" if description html << "

Related links

"+related_links.link_urls+"

" if related_links html << "

Content

" if description || related_links @@ -60,7 +59,7 @@ class String html << "

" html end - + def uri? URI.valid?(self) end @@ -76,7 +75,7 @@ module URI def self.task? uri uri =~ /task/ and URI.valid? uri end - + def self.dataset? uri, subjectid=nil uri =~ /dataset/ and URI.accessible? uri, subjectid=nil end @@ -119,7 +118,7 @@ end class File # @return [String] mime_type including charset using linux cmd command - def mime_type + def mime_type `file -ib #{self.path}`.chomp end end @@ -138,12 +137,12 @@ module Kernel internal_server_error "`" + cmd + "` failed.\n" + stdout + stderr unless status.success? return stdout rescue - internal_server_error $!.message + internal_server_error $!.message end # @return [String] uri of task result, if task fails, an error according to task is raised def wait_for_task uri - if URI.task?(uri) + if URI.task?(uri) t = OpenTox::Task.new uri t.wait unless t.completed? -- cgit v1.2.3