class Cookbooks::Blfs
Constants
- NAMESPACE
#¶ ↑
NAMESPACE¶ ↑
#¶ ↑
Public Class Methods
new( i = '', run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/blfs.rb, line 35 def initialize( i = '', run_already = true ) register_sigint reset # reset() must come before the remaining methods. set_program(i) if block_given? yielded = yield case yielded when :be_quiet_and_do_not_tamper_with_the_xorg_buffer @be_verbose = false @also_assign_the_xorg_buffer = false when :be_quiet @be_verbose = false end end run if run_already end
Public Instance Methods
all_blfs_entries()
click to toggle source
assign_xorg_buffer(i)
click to toggle source
check_blfs_entry_for(i)
click to toggle source
homepage?()
click to toggle source
#¶ ↑
homepage?¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/blfs.rb, line 115 def homepage? @homepage # Store the homepage here. end
Also aliased as: homepage, remote_url?
opnn()
click to toggle source
program?()
click to toggle source
#¶ ↑
program?¶ ↑
This will yield to us which program we are searching for. In other words, this will be equal to the input the user provided to this class.
#¶ ↑
# File lib/cookbooks/utility_scripts/blfs.rb, line 101 def program? @program end
Also aliased as: input?
report_homepage( i = homepage?, also_assign_to_the_xorg_buffer = true )
click to toggle source
#¶ ↑
#report_homepage¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/blfs.rb, line 148 def report_homepage( i = homepage?, also_assign_to_the_xorg_buffer = true ) if i.is_a? Array if i.empty? if be_verbose? report_that_no_blfs_entry_exists_for_the_program end else assign_xorg_buffer(i) i.each {|entry| report_homepage(entry, false) } end else if i.to_s.empty? and be_verbose? opnn; e 'No BLFS entry could be found for '\ 'the program `'+sfancy(input?)+'`.' else if be_verbose? opnn; e i end assign_xorg_buffer(i) if also_assign_to_the_xorg_buffer end end end
report_that_no_blfs_entry_exists_for_the_program()
click to toggle source
reset()
click to toggle source
run()
click to toggle source
#¶ ↑
run¶ ↑
#¶ ↑
# File lib/cookbooks/utility_scripts/blfs.rb, line 177 def run if @run_in_batch_mode # In this case, we check for all BLFS entries here. all_blfs_entries.each {|program_name, url| if url # Some entries currently may be nil, since we use grep. set_input(program_name) report_homepage(url) end } else # else we check on only one entry. check_blfs_entry_for(input?) end end
run_in_batch_mode()
click to toggle source
set_program(i)
click to toggle source
#¶ ↑
#set_program¶ ↑
We seek this program.
#¶ ↑
# File lib/cookbooks/utility_scripts/blfs.rb, line 70 def set_program(i) i = i.first if i.is_a? Array i = i.to_s.dup.downcase # Downcase since as of Sep 2017. i = i[0, i.index('.')] if i.include? '.' if i.empty? run_in_batch_mode end @program = i end
Also aliased as: set_input