Skip to content

Update homebrew version for CocoaPods #60

@orta

Description

@orta

Homebrew/homebrew-core#507
CocoaPods/CocoaPods#2238 (comment)

We do this already in the CP mac app:

    FileUtils.remove_dir("homebrew_cask") if Dir.exists? "homebrew_cask"
    sh "git clone https://github.com/caskroom/homebrew-cask.git homebrew_cask"
    Dir.chdir('homebrew_cask') do
      sh "git pull origin master"
      sh "git remote add fork https://github.com/#{cask_fork}.git"
      sh "git checkout -b #{branch}"

      cask_file = 'Casks/cocoapods.rb'
      cask = File.read(cask_file)
      cask.sub! /version '#{Gem::Version::VERSION_PATTERN}'/, "version '#{version}'"
      cask.sub! /sha256 '[[:xdigit:]]+'/, "sha256 '#{sha(tarball)}'"
      appcast_url = cask.match(/appcast '(.*)'/)[1]
      sparkle_checkpoint = %x{ cat ../gh-pages/sparkle.xml | sed 's|<pubDate>[^<]*</pubDate>||g' | shasum --algorithm 256 | awk '{ print $1 }'}.strip
      cask.sub! /checkpoint: '[[:xdigit:]]+'/, "checkpoint: '#{sparkle_checkpoint}'"
      File.open(cask_file, 'w') { |f| f.write(cask) }

      sh "git commit -am '#{message}'"
      sh "git push fork"
    end

    REST.post("https://api.github.com/repos/caskroom/homebrew-cask/pulls?access_token=#{github_access_token}",
              {title: message, head: cask_fork.split('/').first + ":#{branch}", base: 'master'}.to_json,
              github_headers)
  end
end

We can probably make a variation that does it for the main gems pretty simply

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions