Outputter #64

Merged
merged 8 commits into from Oct 14, 2011

Projects

None yet

2 participants

@gabebw
thoughtbot, inc. member

Adds CommandLine class to run commands, and uses Kumade.outputter instead of inheriting from Base.

@mike-burns mike-burns commented on an outdated diff Oct 14, 2011
lib/kumade.rb
@@ -21,4 +22,12 @@ module Kumade
def self.configuration=(new_configuration)
@@configuration = new_configuration
end
+
+ def self.outputter
+ @@outputter ||= Outputter.new
+ end
+
+ def self.outputter=(new_outputter)
+ @@outputter = new_outputter
+ end
@mike-burns
mike-burns Oct 14, 2011

Move this into the Configuration object.

@mike-burns mike-burns commented on an outdated diff Oct 14, 2011
lib/kumade/git.rb
end
def create(branch)
- unless branch_exist?(branch)
- run_or_error("git branch #{branch}", "Failed to create #{branch}")
+ unless has_branch?(branch)
@mike-burns
mike-burns Oct 14, 2011

How about:

if needs_branch?(branch)
@mike-burns mike-burns commented on an outdated diff Oct 14, 2011
lib/kumade/packager.rb
end
def package
- return success(success_message) if Kumade.configuration.pretending?
+ return Kumade.outputter.success(success_message) if Kumade.configuration.pretending?
@mike-burns
mike-burns Oct 14, 2011

Moving the Outputter into the Configuration could turn this line into:

return configuration.pretend_success(success_message)
@gabebw gabebw merged commit 342082a into master Oct 14, 2011
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment