class RBT::Cookbooks::Homepage
Constants
- MODIFY_THE_XORG_BUFFER_IF_A_HOMEPAGE_ENTRY_EXISTS
#¶ ↑
MODIFY_THE_XORG_BUFFER_IF_A_HOMEPAGE_ENTRY_EXISTS
¶ ↑If the following constant is set to true then we will also try to modify the xorg buffer.
#¶ ↑
Public Class Methods
[](i = ARGV)
click to toggle source
new( this_program = ARGV.first, optional_use_this_dataset = nil, run_already = true ) { || ... }
click to toggle source
#¶ ↑
initialize¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/homepage.rb, line 41 def initialize( this_program = ARGV.first, optional_use_this_dataset = nil, run_already = true ) reset set_this_program( this_program ) determine_the_dataset_to_use( optional_use_this_dataset ) # ======================================================================= # # === Handle blocks given to this class # ======================================================================= # if block_given? yielded = yield case yielded # ===================================================================== # # === :be_quiet # ===================================================================== # when :be_quiet be_quiet end end run if run_already end
Public Instance Methods
consider_opening_the_url_to_the_homepage_in_the_browser()
click to toggle source
dataset?()
click to toggle source
determine_the_dataset_to_use(i = nil)
click to toggle source
#¶ ↑
determine¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/homepage.rb, line 267 def determine_the_dataset_to_use(i = nil) if i.nil? unless RBT::Cookbooks.const_defined? :SanitizeCookbook make_sure_that_the_cookbook_class_is_available end @dataset = RBT::Cookbooks::SanitizeCookbook.new(which_program?) { :fast_and_be_verbose } else @dataset = i end end
make_sure_that_the_cookbook_class_is_available()
click to toggle source
modify_the_xorg_buffer_if_a_homepage_entry_exists?()
click to toggle source
#¶ ↑
modify_the_xorg_buffer_if_a_homepage_entry_exists¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/homepage.rb, line 85 def modify_the_xorg_buffer_if_a_homepage_entry_exists? @modify_the_xorg_buffer_if_a_homepage_entry_exists end
Also aliased as: modify_the_xorg_buffer?
reset()
click to toggle source
#¶ ↑
reset (reset tag)¶ ↑
#¶ ↑
Calls superclass method
RBT::Base#reset
# File lib/rbt/cookbooks/homepage.rb, line 72 def reset super() infer_the_namespace # ======================================================================= # # === @modify_the_xorg_buffer_if_a_homepage_entry_exists # ======================================================================= # @modify_the_xorg_buffer_if_a_homepage_entry_exists = MODIFY_THE_XORG_BUFFER_IF_A_HOMEPAGE_ENTRY_EXISTS end
return_homepage()
click to toggle source
run()
click to toggle source
set_this_program(i = '')
click to toggle source
show_all_programs_that_miss_a_homepage_entry( available_programs = available_programs? )
click to toggle source
#¶ ↑
show_all_programs_that_miss_a_homepage_entry
¶ ↑
This method will show all programs that miss a homepage entry.
Invocation example:
homepage --missing-url?
#¶ ↑
# File lib/rbt/cookbooks/homepage.rb, line 148 def show_all_programs_that_miss_a_homepage_entry( available_programs = available_programs? ) make_sure_that_the_cookbook_class_is_available cliner opne "Now working through #{steelblue(available_programs.size)} "\ "different programs." opne "This may take a while, so please be patient." cliner available_programs.each {|this_program| dataset = RBT::Cookbooks::SanitizeCookbook.new(this_program) { :be_fast } homepage_entry = dataset.homepage?.to_s if homepage_entry.empty? _ = ("`#{this_program}`").ljust(15) opne "The program #{sfancy(_)} has no "\ "#{sfancy('homepage: ')} entry." end } end
show_help()
click to toggle source
#¶ ↑
show_help
(help tag)¶ ↑
Invoke this entry point via:
homepage --help
#¶ ↑
# File lib/rbt/cookbooks/homepage.rb, line 176 def show_help opne 'Currently these options are available for `'+ sfancy("class #{namespace?}")+'`:' e e " --missing-url? # show which cookbook entries lack "\ "a proper #{sfancy('homepage: entry')}" e end
show_homepage_of_this_program( this_program = which_program? )
click to toggle source
#¶ ↑
show_homepage_of_this_program
¶ ↑
#¶ ↑
# File lib/rbt/cookbooks/homepage.rb, line 210 def show_homepage_of_this_program( this_program = which_program? ) if this_program.include? '.yml' this_program.delete_suffix!('.yml') end _ = return_homepage if _ this_program = File.basename(this_program).sub(/\.yml$/,'') if _.empty? if be_verbose? opne "No homepage has been registered for the program "\ "`#{sfancy(this_program)}`." end else # =================================================================== # # Else we have found a homepage entry and will display # our findings to the end-user. # # To test this subsection, try: # # homepage geany # # =================================================================== # if be_verbose? opne "The homepage of the program `#{sfancy(this_program)}"\ "` is at:" e e " #{orange(_)}" e if modify_the_xorg_buffer? set_xorg_buffer(_) end end end else if be_verbose? opne 'No homepage entry is registered in `'+ sfancy(this_program)+'` (The .yml file should be at ' opne simp(" #{individual_cookbooks_dir?}#{this_program}.yml")+ ')' end end end
Also aliased as: report_the_homepage
this_program?()
click to toggle source