Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Refactor Using Cocaine #1

Open
simeonwillbanks opened this issue Jul 25, 2013 · 6 comments
Open

Refactor Using Cocaine #1

simeonwillbanks opened this issue Jul 25, 2013 · 6 comments

Comments

@simeonwillbanks
Copy link

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

@kdaigle
Copy link
Owner

kdaigle commented Sep 22, 2013

@simeonwillbanks sorry! I totally didn't see this until right now. Let me take a read at this on Sunday (at GoGaRuCo).

@simeonwillbanks
Copy link
Author

No worries. Enjoy GoGaRuCo; its awesome!

@kdaigle
Copy link
Owner

kdaigle commented Mar 19, 2014

@simeonwillbanks if you'd like to do this refactor and drop a PR, I'd definitely accept! Sorry for the super super long delay on this. I just started my 👶 leave and been poking through my OS projects.

It looks like you shouldn't pass user entered values into new though. 1 Granted, this is a file that is committed into the repository but might want to protect people from themselves I guess. 😀

@simeonwillbanks
Copy link
Author

@kdaigle No worries and congrats! Boy or Girl?

I'm right behind you... my wife is due next month! It's our second, and it's another boy. 🎉

Nice catch and agreed. When I have some time, I'll put together a Pull Request. 😄

@kdaigle
Copy link
Owner

kdaigle commented Mar 20, 2014

@simeonwillbanks a boy! Still waiting over here... 😀 👶

@simeonwillbanks
Copy link
Author

@kdaigle Awesome. 👶's are so much fun. Good luck!!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants