lib/hyde/cli/helpers.rb in hydeweb-0.1.6 vs lib/hyde/cli/helpers.rb in hydeweb-0.1.7
- old
+ new
@@ -25,16 +25,26 @@
def say_info(str)
say_status '*', str, 30
end
+ def say_error(str)
+ say_status 'error', str, 31
+ end
+
def say_status(what, cmd, color=32)
c1 = "\033[0;#{color}m"
c0 = "\033[0;m"
puts "#{c1}%10s#{c0} %s" % [ what, cmd ]
end
+ def show_needed_gem(name)
+ err
+ say_error "You will need additional gems for this project."
+ say_info "To install: gem install #{name}"
+ end
+
def no_project
"Error: no Hyde config file found.\n" +
"(Looked for #{Hyde::CONFIG_FILES.join(', ')})\n\n" +
"You start by creating a config file for this project:\n" +
" $ #{executable} create .\n\n" +
@@ -42,9 +52,17 @@
" $ #{executable} create NAME\n"
end
def project?
!! @hydefile
+ end
+
+ # Gets the gem name from a LoadError exception.
+ def gem_name(e)
+ name = e.message.split(' ').last
+ name = 'RedCloth' if name == 'redcloth'
+ name = 'haml' if name == 'sass/plugin'
+ name
end
def project
@project ||= begin
pass no_project unless project?