Module: Jets::Builders::Util

Included in:
CodeBuilder, Md5Zip, RubyPackager
Defined in:
lib/jets/builders/util.rb

Instance Method Summary collapse

Instance Method Details

#full(relative_path) ⇒ Object

Provide pretty clear way to desinate full path. full(“bundled”) => /tmp/jets/demo/bundled



16
17
18
# File 'lib/jets/builders/util.rb', line 16

def full(relative_path)
  "#{Jets.build_root}/#{relative_path}"
end

#headline(message) ⇒ Object



10
11
12
# File 'lib/jets/builders/util.rb', line 10

def headline(message)
  puts "=> #{message}".colorize(:cyan)
end

#poly_only?Boolean

Finds out of the app has polymorphic functions only and zero ruby functions. In this case, we can skip a lot of the ruby related building and speed up the deploy process.

Returns:

  • (Boolean)


23
24
25
26
# File 'lib/jets/builders/util.rb', line 23

def poly_only?
  return true if ENV['POLY_ONLY'] # bypass to allow rapid development of handlers
  Jets::Commands::Build.poly_only?
end

#sh(command) ⇒ Object



3
4
5
6
7
8
# File 'lib/jets/builders/util.rb', line 3

def sh(command)
  puts "=> #{command}".colorize(:green)
  success = system(command)
  abort("#{command} failed to run") unless success
  success
end