Class: CoreTap

Inherits:
Tap
  • Object
show all
Defined in:
Library/Homebrew/tap.rb

Overview

A specialized Tap class for the core formulae

Constant Summary

Constants inherited from Tap

Tap::TAP_DIRECTORY

Instance Attribute Summary

Attributes inherited from Tap

#full_name, #name, #path, #repo, #user

Class Method Summary collapse

Instance Method Summary collapse

Methods inherited from Tap

#==, #alias_files, #alias_reverse_table, #alias_table, #aliases, #cask_dir, #cask_file?, #cask_files, #clear_cache, cmd_directories, #command_files, #config, #custom_remote?, each, fetch, #formula_file?, #formula_files, #formula_names, from_path, #git?, #git_branch, #git_head, #git_last_commit, #git_last_commit_date, #git_short_head, #install, #installed?, #issues_url, #link_completions_and_manpages, names, #official?, #pinned_symlink_path, #potential_formula_dirs, #private?, #remote, #shallow?, #to_hash, #to_s, #version_string

Methods included from Cachable

#cache, #clear_cache

Constructor Details

#initializeCoreTap

Returns a new instance of CoreTap



554
555
556
# File 'Library/Homebrew/tap.rb', line 554

def initialize
  super "Homebrew", "core"
end

Class Method Details

.ensure_installed!Object



562
563
564
565
# File 'Library/Homebrew/tap.rb', line 562

def self.ensure_installed!
  return if instance.installed?
  safe_system HOMEBREW_BREW_FILE, "tap", instance.name
end

.instanceObject



558
559
560
# File 'Library/Homebrew/tap.rb', line 558

def self.instance
  @instance ||= new
end

Instance Method Details

#alias_dirObject



601
602
603
604
605
606
# File 'Library/Homebrew/tap.rb', line 601

def alias_dir
  @alias_dir ||= begin
    self.class.ensure_installed!
    super
  end
end

#alias_file_to_name(file) ⇒ Object



630
631
632
# File 'Library/Homebrew/tap.rb', line 630

def alias_file_to_name(file)
  file.basename.to_s
end

#core_tap?Boolean

Returns:

  • (Boolean)


588
589
590
# File 'Library/Homebrew/tap.rb', line 588

def core_tap?
  true
end

#default_remoteObject



545
546
547
548
549
550
551
# File 'Library/Homebrew/tap.rb', line 545

def default_remote
  if OS.mac? || ENV["HOMEBREW_FORCE_HOMEBREW_ORG"]
    "https://github.com/Homebrew/homebrew-core".freeze
  else
    "https://github.com/Linuxbrew/homebrew-core".freeze
  end
end

#formula_dirObject



593
594
595
596
597
598
# File 'Library/Homebrew/tap.rb', line 593

def formula_dir
  @formula_dir ||= begin
    self.class.ensure_installed!
    super
  end
end

#formula_file_to_name(file) ⇒ Object



625
626
627
# File 'Library/Homebrew/tap.rb', line 625

def formula_file_to_name(file)
  file.basename(".rb").to_s
end

#formula_renamesObject



609
610
611
612
613
614
# File 'Library/Homebrew/tap.rb', line 609

def formula_renames
  @formula_renames ||= begin
    self.class.ensure_installed!
    super
  end
end

#pinObject



573
574
575
# File 'Library/Homebrew/tap.rb', line 573

def pin
  raise "Tap#pin is not available for CoreTap"
end

#pinned?Boolean

Returns:

  • (Boolean)


583
584
585
# File 'Library/Homebrew/tap.rb', line 583

def pinned?
  false
end

#tap_migrationsObject



617
618
619
620
621
622
# File 'Library/Homebrew/tap.rb', line 617

def tap_migrations
  @tap_migrations ||= begin
    self.class.ensure_installed!
    super
  end
end

#uninstallObject



568
569
570
# File 'Library/Homebrew/tap.rb', line 568

def uninstall
  raise "Tap#uninstall is not available for CoreTap"
end

#unpinObject



578
579
580
# File 'Library/Homebrew/tap.rb', line 578

def unpin
  raise "Tap#unpin is not available for CoreTap"
end