diff options
Diffstat (limited to 'Library/Homebrew/dev-cmd')
| -rw-r--r-- | Library/Homebrew/dev-cmd/irb.rb | 54 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/linkage.rb | 2 | ||||
| -rwxr-xr-x | Library/Homebrew/dev-cmd/ruby.rb | 2 | ||||
| -rw-r--r-- | Library/Homebrew/dev-cmd/tap-new.rb | 3 |
4 files changed, 57 insertions, 4 deletions
diff --git a/Library/Homebrew/dev-cmd/irb.rb b/Library/Homebrew/dev-cmd/irb.rb new file mode 100644 index 000000000..700cbe009 --- /dev/null +++ b/Library/Homebrew/dev-cmd/irb.rb @@ -0,0 +1,54 @@ +#: * `irb` [`--examples`] [`--pry`]: +#: Enter the interactive Homebrew Ruby shell. +#: +#: If `--examples` is passed, several examples will be shown. +#: If `--pry` is passed or HOMEBREW_PRY is set, pry will be +#: used instead of irb. + +class Symbol + def f(*args) + Formulary.factory(to_s, *args) + end +end + +class String + def f(*args) + Formulary.factory(self, *args) + end +end + +module Homebrew + module_function + + def irb + if ARGV.include? "--examples" + puts "'v8'.f # => instance of the v8 formula" + puts ":hub.f.installed?" + puts ":lua.f.methods - 1.methods" + puts ":mpd.f.recursive_dependencies.reject(&:installed?)" + return + end + + if ARGV.pry? + Homebrew.install_gem_setup_path! "pry" + require "pry" + Pry.config.prompt_name = "brew" + else + require "irb" + end + + require "formula" + require "keg" + + $LOAD_PATH.unshift("#{HOMEBREW_LIBRARY_PATH}/cask/lib") + require "hbc" + + ohai "Interactive Homebrew Shell" + puts "Example commands available with: brew irb --examples" + if ARGV.pry? + Pry.start + else + IRB.start + end + end +end diff --git a/Library/Homebrew/dev-cmd/linkage.rb b/Library/Homebrew/dev-cmd/linkage.rb index 31e9bd103..c33c181a1 100644 --- a/Library/Homebrew/dev-cmd/linkage.rb +++ b/Library/Homebrew/dev-cmd/linkage.rb @@ -10,7 +10,7 @@ #: If `--reverse` is passed, print the dylib followed by the binaries #: which link to it for each library the keg references. -require "os/mac/linkage_checker" +require "linkage_checker" module Homebrew module_function diff --git a/Library/Homebrew/dev-cmd/ruby.rb b/Library/Homebrew/dev-cmd/ruby.rb index 2df212301..c5696d6bb 100755 --- a/Library/Homebrew/dev-cmd/ruby.rb +++ b/Library/Homebrew/dev-cmd/ruby.rb @@ -8,6 +8,6 @@ module Homebrew module_function def ruby - exec ENV["HOMEBREW_RUBY_PATH"], "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", "-rcmd/irb", *ARGV + exec ENV["HOMEBREW_RUBY_PATH"], "-I#{HOMEBREW_LIBRARY_PATH}", "-rglobal", "-rdev-cmd/irb", *ARGV end end diff --git a/Library/Homebrew/dev-cmd/tap-new.rb b/Library/Homebrew/dev-cmd/tap-new.rb index 38cdb1c2e..31299d2b0 100644 --- a/Library/Homebrew/dev-cmd/tap-new.rb +++ b/Library/Homebrew/dev-cmd/tap-new.rb @@ -50,8 +50,7 @@ module Homebrew osx_image: xcode9.2 cache: directories: - - $HOME/.gem/ruby - - Library/Homebrew/vendor/bundle + - /usr/local/Homebrew/Library/Homebrew/vendor/bundle branches: only: - master |
