claui / homebrew-textmate

External Homebrew command and repo for TextMate bundles
14 stars 5 forks source link

`brew tm install` results in “Error: wrong number of arguments” #6

Open claui opened 7 years ago

claui commented 7 years ago

It seems that a few days ago, parts of the Homebrew core have been refactored in a way that seems to break homebrew-textmate:

$ brew tm install 6502-assembler.rb
[…]
==> Installing Cask tm-6502-assembler
Error: wrong number of arguments (2 for 1)

Breakage like this is to be expected because Homebrew’s infrastructure currently is not designed to allow for external commands (like brew tm) to introduce new artifact types or stanzas. With the custom tmbundle stanza being a crucial feature of brew tm, I had to find another way to get this done; I ultimately managed to implement it with only a few lines of code while at the same time depending on as few Homebrew-specific implementation details as possible (i. e., Hbc::Artifact and Hbc::DSL).

Unfortunately, Homebrew’s recent PR (see above) has refactored exactly those two classes and many more.

To fix this, I think we need figure out the following things:

@reitermarkus Can you help shed light on this?

reitermarkus commented 7 years ago

I am quite into TextMate myself as you can see here: https://github.com/reitermarkus/homebrew-tap/tree/master/Casks

Off the top of my head: Hbc::Artifact::Base -> Hbc::Artifact::Abstract

Anything else you'll have to figure out yourself, since this API is as private as it gets. 😉

You could however make it more resistant to change without even using the internal classes with something like

  def tmbundle(bundle)
    artifact bundle, target: "#{tmbundledir}/#{bundle}"
  end