class RBT::GenerateMachomebrewFormula
Constants
- DEFAULT_PROGRAM
#¶ ↑
DEFAULT_PROGRAM
¶ ↑#¶ ↑
Public Class Methods
new( commandline_arguments = ARGV, run_already = true )
click to toggle source
Public Instance Methods
determine_the_program()
click to toggle source
extra_information?()
click to toggle source
find_remote_homepage()
click to toggle source
generate_main_string()
click to toggle source
#¶ ↑
generate_main_string
¶ ↑
#¶ ↑
# File lib/rbt/generate_files/generate_machomebrew_formula.rb, line 185 def generate_main_string short_name = @dataset.short_name?.to_s.capitalize if short_name.empty? short_name = program_name?.to_s.dup.capitalize end link_to_remote_package = @dataset.url1? dependencies = @dataset.required_deps_on? configure_options = @dataset.configure_options_or_meson_options? program_homepage = find_remote_homepage @_ << "require 'formula' class #{short_name.to_s} < Formula desc '"+return_short_description.to_s.chomp('.')+"' homepage '"+program_homepage+"' url '"+link_to_remote_package+"' sha256 '#{shasum?}' revision 1 " # Next, add the dependencies: dependencies.each {|dep| @_ << " depends_on '"+dep+"'"+N } @_ << " skip_clean :all def options [['--disable-etcdir', 'Disable the reading of Zsh rc files in /etc']] end def install args = %w( " # ======================================================================= # # Next, add the dependencies onto args: # ======================================================================= # if configure_options.is_a? String @_ << "#{configure_options}\n" elsif configure_options.is_a? Array configure_options.each {|option| @_ << "#{option}#{N}" } unless configure_options.empty? end @_ << ")\n" # ======================================================================= # # And add more to the main String: # ======================================================================= # @_ << " system './configure', \"--prefix=#{prefix?}\", *args system 'make install' end def caveats; <<-EOS #{extra_information?} EOS end end " end
prefix?()
click to toggle source
program?()
click to toggle source
#¶ ↑
program?¶ ↑
#¶ ↑
# File lib/rbt/generate_files/generate_machomebrew_formula.rb, line 96 def program? @program end
Also aliased as: program_name?
program_path?()
click to toggle source
reset()
click to toggle source
#¶ ↑
reset¶ ↑
#¶ ↑
Calls superclass method
RBT::LeanPrototype#reset
# File lib/rbt/generate_files/generate_machomebrew_formula.rb, line 46 def reset super() infer_the_namespace # ======================================================================= # # === @program # ======================================================================= # @program = nil # ======================================================================= # # === @_ # ======================================================================= # @_ = ''.dup # This is the string we use to generate a machomebrew formula. setup_dataset end
return_short_description()
click to toggle source
run()
click to toggle source
save_string()
click to toggle source
#¶ ↑
save_string
¶ ↑
#¶ ↑
# File lib/rbt/generate_files/generate_machomebrew_formula.rb, line 255 def save_string _ = "#{rbt_log_directory?}homebrew_formulas/#{program?}.rb" unless File.directory? File.dirname(_) mkdir(File.dirname(_)) end orev "Saving into the file `#{sfile(_)}#{rev}`." save_what_to(@_, _) end
set_commandline_arguments( i )
click to toggle source
#¶ ↑
set_commandline_arguments
¶ ↑
#¶ ↑
# File lib/rbt/generate_files/generate_machomebrew_formula.rb, line 63 def set_commandline_arguments( i ) i = [i].flatten.compact if i.any? {|entry| entry.start_with?('--') } selection = i.select {|entry| entry.start_with?('--') } menu(selection) i.reject! {|entry| entry.start_with?('--') } end @internal_hash[:commandline_arguments] = i determine_the_program end
set_program( i = DEFAULT_PROGRAM )
click to toggle source
setup_dataset(i = program?)
click to toggle source
shasum?( i = program_path? )
click to toggle source