Skip to content

Refactor Using Cocaine #1

Description

@simeonwillbanks

Hi Kyle,

This gem is a great idea! Automate everything... and its more powerful than a Brewfile.

I'd love to contribute, and I have a suggestion. Would you consider a refactor using cocaine?

Here is an example refactor of Strapper::Brew#install.

def install
  Cocaine::CommandLine.new("brew", "install #{@name}").run if brewable?
rescue Cocaine::ExitStatusError
  puts "Error: Installing #{@name} has failed"
end

def brewable?
  !!Cocaine::CommandLine.new("brew", "info #{@name}").run
rescue Cocaine::ExitStatusError
  puts "Error: No available formula for #{@name}"
end

Thanks,
Simeon

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions