class RBT::ReportXfceVersion
Constants
- N_LJUST
#¶ ↑
N_LJUST
¶ ↑#¶ ↑
Public Class Methods
[](i = '')
click to toggle source
new( commandline_arguments = nil, run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/report_xfce_version.rb, line 32 def initialize( commandline_arguments = nil, run_already = true ) reset set_commandline_arguments( commandline_arguments ) if block_given? yielded = yield case yielded when :do_not_report, :do_not_report_anything @do_report = false end end run if run_already end
Public Instance Methods
add( i = '', add_newline = true )
click to toggle source
add_garcon_version()
click to toggle source
add_newline()
click to toggle source
determine_version_of( i = 'xfdesktop' )
click to toggle source
#¶ ↑
determine_version_of
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/report_xfce_version.rb, line 151 def determine_version_of( i = 'xfdesktop' ) case i # ======================================================================= # # === exo # ======================================================================= # when 'exo' result = `pkg-config --modversion exo-2`.strip # ======================================================================= # # === libxfce4util # ======================================================================= # when 'libxfce4util' result = `pkg-config --modversion libxfce4util-1.0`.strip # ======================================================================= # # === libxfce4ui # ======================================================================= # when 'libxfce4ui' result = `pkg-config --modversion libxfce4ui-2`.strip # ======================================================================= # # === xfce4-panel # ======================================================================= # when /xfce4-?panel/ result = `pkg-config --modversion libxfce4panel-2.0`.strip # ======================================================================= # # === garcon # ======================================================================= # when 'garcon' result = `pkg-config --modversion garcon-1`.strip else # This is the default entry point. result = `#{i} --version 2>&1` end if result.include? N result = result.split(N).first end # ======================================================================= # # Check for results such as: # # "This is xfdesktop version 4.14.2, running on Xfce 4.15." # # or # # "xfce4-session 4.14.1 (Xfce 4.15)" # # ======================================================================= # if result.include?(' version ') result = result.scan( /version (\d{1,2}\.?\d{1,2}\.?\d{1,2})/ ).flatten.first elsif result.include?(' (') result = result.split(' (').first.split(' ').last end result end
left_padded()
click to toggle source
report()
click to toggle source
report_pluma_version()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/utility_scripts/report_xfce_version.rb, line 54 def reset super() infer_the_namespace # ======================================================================= # # === @n_ljust # ======================================================================= # @n_ljust = N_LJUST # ======================================================================= # # === :string_to_display # ======================================================================= # @internal_hash[:string_to_display] = ''.dup # ======================================================================= # # === @do_report # ======================================================================= # @do_report = true end
return_pkgconfig_result_for( i = :libmatekbd )
click to toggle source
#¶ ↑
return_pkgconfig_result_for
¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/report_xfce_version.rb, line 121 def return_pkgconfig_result_for( i = :libmatekbd ) result = `pkg-config --modversion #{i} 2>&1`.strip if result.include?('No package ') and result.include?(' found') result = '' end return result end
Also aliased as: pkgconfig_result
run()
click to toggle source
#¶ ↑
run (run tag)¶ ↑
#¶ ↑
# File lib/rbt/utility_scripts/report_xfce_version.rb, line 216 def run add grey, :no_newline add 'Reporting the installed versions of the '+ royalblue('xfce-desktop components')+ grey(':') add_newline # ======================================================================= # # Next, add the programs that will be queried. These must all belong # to XFCE in one way or another. # ======================================================================= # add ' thunar: '.ljust(@n_ljust)+pkgconfig_result('thunarx-3') add ' tumbler: '.ljust(@n_ljust)+pkgconfig_result('tumbler-1') add ' xfconf: '.ljust(@n_ljust)+pkgconfig_result('libxfconf-0') add ' xfdesktop: '.ljust(@n_ljust)+determine_version_of('xfdesktop') add ' xfwm4: '.ljust(@n_ljust)+determine_version_of('xfwm4') add ' xfce4-session: '.ljust(@n_ljust)+determine_version_of('xfce4-session') add ' xfce4-settings: '.ljust(@n_ljust)+determine_version_of('xfce4-settings-manager') add ' xfce4-panel: '.ljust(@n_ljust)+determine_version_of('xfce4-panel') add ' libxfce4util: '.ljust(@n_ljust)+determine_version_of('libxfce4util') add ' libxfce4ui: '.ljust(@n_ljust)+determine_version_of('libxfce4ui') add ' exo: '.ljust(@n_ljust)+determine_version_of('exo') add_garcon_version add_newline report end