class RBT::Action::ReportXfceVersion
Constants
- N_LJUST
#¶ ↑
N_LJUST
¶ ↑#¶ ↑
Public Class Methods
[](i = ARGV)
click to toggle source
new( run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/rbt/actions/individual_actions/information/report_xfce_version.rb, line 35 def initialize( run_already = true, &block ) reset # ======================================================================= # # === Handle blocks given to this method next # ======================================================================= # if block_given? yielded = yield case yielded # ===================================================================== # # === :do_not_report # ===================================================================== # when :do_not_report, :do_not_report_anything @internal_hash[:do_report] = false end end run if run_already end
Public Instance Methods
add( i = '', add_newline = true )
click to toggle source
#¶ ↑
add (add tag)¶ ↑
#¶ ↑
# File lib/rbt/actions/individual_actions/information/report_xfce_version.rb, line 80 def add( i = '', add_newline = true ) case add_newline when :no_newline add_newline = false end if add_newline i = i.dup if i.frozen? i << "\n" end @internal_hash[:string_to_display] << i end
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/actions/individual_actions/information/report_xfce_version.rb, line 171 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
do_report?()
click to toggle source
left_padded()
click to toggle source
n_ljust?()
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::Action#reset
# File lib/rbt/actions/individual_actions/information/report_xfce_version.rb, line 60 def reset super() infer_the_namespace # ======================================================================= # # === :n_ljust # ======================================================================= # @internal_hash[:n_ljust] = N_LJUST # ======================================================================= # # === :string_to_display # ======================================================================= # @internal_hash[:string_to_display] = ''.dup # ======================================================================= # # === :do_report # ======================================================================= # @internal_hash[:do_report] = true end
return_pkgconfig_result_for( i = :libmatekbd )
click to toggle source
#¶ ↑
return_pkgconfig_result_for
¶ ↑
#¶ ↑
# File lib/rbt/actions/individual_actions/information/report_xfce_version.rb, line 134 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/actions/individual_actions/information/report_xfce_version.rb, line 236 def run add grey, :no_newline add rev+'Reporting the installed versions of the '+ royalblue('xfce-desktop components')+ grey(':')+rev add_newline # ======================================================================= # # Next, add the programs that will be queried. These must all belong # to XFCE in one way or another. # ======================================================================= # n_ljust = n_ljust? 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