Skip to content

Refactor Using Cocaine #1

@simeonwillbanks

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

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