class RBT::WhatCouldBecomeAnAppDir

Public Class Methods

[](i = ARGV) click to toggle source
#

RBT::WhatCouldBecomeAnAppDir[]

#
# File lib/rbt/utility_scripts/what_could_become_an_app_dir.rb, line 91
def self.[](i = ARGV)
  new(i)
end
new( i = ARGV, run_already = true ) click to toggle source
#

initialize

#
# File lib/rbt/utility_scripts/what_could_become_an_app_dir.rb, line 36
def initialize(
    i           = ARGV,
    run_already = true
  )
  reset
  set_commandline_arguments(
    i
  )
  run if run_already
end

Public Instance Methods

is_binary?(i) click to toggle source
#

is_binary?

#
# File lib/rbt/utility_scripts/what_could_become_an_app_dir.rb, line 83
def is_binary?(i)
  result = `file #{i}`
  result.include?('executable, x86-64')
end
reset() click to toggle source
#

reset

#
Calls superclass method RBT::Base#reset
# File lib/rbt/utility_scripts/what_could_become_an_app_dir.rb, line 50
def reset
  super()
  infer_the_namespace
  #reset_the_internal_hash
end
run() click to toggle source
#

run

#
# File lib/rbt/utility_scripts/what_could_become_an_app_dir.rb, line 59
def run
  _ = '/usr/bin/'
  opne 'Going through all binaries at '+sdir(_)+' next:'
  all_files = all_files_from(_)
  all_files.each_with_index {|this_file, index| index += 1
    short_name = File.basename(this_file)
    if is_this_binary_registered?(short_name) and !is_symlink?(this_file)
      opne 'This binary ('+short_name+') could be compiled in an AppDir manner, by issuing:'
      e
      e steelblue('  ntrad '+short_name)
      e
    else
      if is_binary?(this_file)
        opne lightgreen(index.to_s+') ')+
             tomato('Not registered binary: ')+
             steelblue(short_name)
      end
    end
  }
end