lib/hanzo.rb in hanzo-0.4.2 vs lib/hanzo.rb in hanzo-0.4.3
- old
+ new
@@ -5,20 +5,22 @@
require 'hanzo/base'
require 'hanzo/cli'
require 'hanzo/heroku'
require 'hanzo/version'
+require 'hanzo/fetchers/environment'
+
module Hanzo
def self.run(command, fetch_output = false)
print(command, :green)
output = true
_run do
if fetch_output
output = `#{command}`
else
- system(command)
+ output = system(command)
end
end
output
end
@@ -35,10 +37,15 @@
colors = colors.map { |c| HighLine.const_get(c.to_s.upcase) }
text = text.join("\n ") if text.is_a?(Array)
HighLine.say HighLine.color(" #{text}", *colors)
end
+ def self.unindent_print(text = '', *colors)
+ colors = colors.map { |c| HighLine.const_get(c.to_s.upcase) }
+ HighLine.say HighLine.color(text, *colors)
+ end
+
def self.title(text)
HighLine.say HighLine.color("-----> #{text}", :blue)
end
def self.agree(question)
@@ -50,8 +57,8 @@
end
end
class String
def unindent
- gsub /^#{scan(/^\s*/).min_by{|l|l.length}}/, ''
+ gsub(/^#{scan(/^\s*/).min_by { |l| l.length }}/, '')
end
end