lib/yamg/cli.rb in yamg-0.5.3 vs lib/yamg/cli.rb in yamg-0.5.5
- old
+ new
@@ -21,11 +21,11 @@
def setup_for(opts)
case opts
when Hash then { 'path' => './export/' }.merge(opts)
when String then { 'path' => opts }
when TrueClass then { 'path' => './export/' }
- else fail
+ else raise
end
end
def home_for(asset, setup)
path = setup['path']
@@ -33,11 +33,11 @@
File.join(path, asset)
end
def compile_screenshots(ss, size, setup)
return unless YAMG.config['screenshot'].respond_to?(:[])
- fail 'No url provided' unless (url = YAMG.config['screenshot']['url'])
+ raise 'No url provided' unless (url = YAMG.config['screenshot']['url'])
Screenshot.new(ss, 'size' => size, 'url' => url).work(setup['path'])
puts Rainbow("[o]SS #{ss}").black
end
def compile_media(i, size, setup)
@@ -63,10 +63,10 @@
YAMG.info("Splash #{size.join('x')}px #{setup['path']}#{s}", :black)
end
def compile_docs(opts)
out = opts['path']
- %w( manifest.json browserconfig.xml ).each do |doc|
+ %w(manifest.json browserconfig.xml).each do |doc|
next if File.exist?(out)
puts Rainbow("{DOCS} #{out}/#{doc} created. Please review.").red
src = File.expand_path("assets/#{doc}", File.dirname(__FILE__))
FileUtils.cp(src, out)
end