class EnvironmentInformation::Sinatra
Constants
- USE_THIS_PORT
#¶ ↑
USE_THIS_PORT
¶ ↑#¶ ↑
Public Class Methods
new()
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
Calls superclass method
# File lib/environment_information/www/sinatra_interface.rb, line 34 def initialize super() reset if ::EnvironmentInformation.is_on_roebe? require 'open_in_browser' # ===================================================================== # # Tell us which port will be used: # ===================================================================== # target = "http://localhost:#{USE_THIS_PORT}/" e sfancy(target) Thread.new { sleep 1.0 OpenInBrowser[target] } end end
Public Instance Methods
html_end()
click to toggle source
reset()
click to toggle source
return_html_start()
click to toggle source
#¶ ↑
return_html_start
¶ ↑
This method will include all parts up to the first main <div> element of the webpage.
#¶ ↑
# File lib/environment_information/www/sinatra_interface.rb, line 70 def return_html_start "<html><head><title>\n"\ "Sinatra-Interface of the EnvironmentInformation project\n"\ "</title></head><body>"\ "<div style=\"padding:2px; margin-left:0.5em\">" end
sinatra_paragraph_showing_this_component( i = :gcc )
click to toggle source
#¶ ↑
sinatra_paragraph_showing_this_component
¶ ↑
This method was added primarily so that we can use a unified (and consistent) style for display.
#¶ ↑
# File lib/environment_information/www/sinatra_interface.rb, line 160 def sinatra_paragraph_showing_this_component( i = :gcc ) content = "return_version_of_#{i}".to_s content = ::EnvironmentInformation.send(content) # ======================================================================= # # Next, we grab it from the main Hash. # ======================================================================= # case i when :awk, :bison, :boost, :coreutils, :binutils, :cmake, :diffutils, :findutils, :file, :flex, :gcc, :gettext, :glibc, :grep, :gnupg, :intltool, :ruby, :rubygems i = i.to_s.capitalize+' Version' when :linux_kernel i = 'Linux Kernel' end # ======================================================================= # # Finally return the proper <p> tag: # ======================================================================= # uniform_p_tag(i, content) end
uniform_p_tag(i, content)
click to toggle source
#¶ ↑
uniform_p_tag
¶ ↑
#¶ ↑
# File lib/environment_information/www/sinatra_interface.rb, line 138 def uniform_p_tag(i, content) i = i.to_s unless i.end_with? ':' i = i.dup if i.frozen? i << ':' end p( "#{i}<br><b style=\"color: darkblue; margin-left:1.5em\">#{content}"\ "</b>", css_style: 'margin-left: 2.5em; margin: 4px; padding: 5px; padding-top: 0.2em' ) end