class Bosh::Gen::Command
Public Instance Methods
bold()
click to toggle source
# File lib/bosh/gen/cli.rb, line 124 def bold; "\033[1m" end
clear()
click to toggle source
# File lib/bosh/gen/cli.rb, line 123 def clear; "\033[0m" end
cli_plugin(plugin_name)
click to toggle source
# File lib/bosh/gen/cli.rb, line 116 def cli_plugin(plugin_name) require 'bosh/gen/generators/bosh_cli_plugin_generator' Bosh::Gen::Generators::BoshCliPluginGenerator.start([plugin_name]) end
cyan()
click to toggle source
# File lib/bosh/gen/cli.rb, line 122 def cyan; "\033[36m" end
errand(name)
click to toggle source
# File lib/bosh/gen/cli.rb, line 84 def errand(name) dependencies = options[:dependencies] || [] require 'bosh/gen/generators/errand_generator' Bosh::Gen::Generators::ErrandGenerator.start([name, dependencies]) end
extract_job(source_package_path)
click to toggle source
# File lib/bosh/gen/cli.rb, line 100 def extract_job(source_package_path) source_package_path = File.expand_path(source_package_path) require 'bosh/gen/generators/extract_job_generator' Bosh::Gen::Generators::ExtractJobGenerator.start([source_package_path]) end
extract_pkg(source_package_path)
click to toggle source
# File lib/bosh/gen/cli.rb, line 109 def extract_pkg(source_package_path) source_package_path = File.expand_path(source_package_path) require 'bosh/gen/generators/extract_package_generator' Bosh::Gen::Generators::ExtractPackageGenerator.start([source_package_path]) end
green()
click to toggle source
# File lib/bosh/gen/cli.rb, line 126 def green; "\033[32m" end
job(name)
click to toggle source
# File lib/bosh/gen/cli.rb, line 75 def job(name) dependencies = options[:dependencies] || [] require 'bosh/gen/generators/job_generator' Bosh::Gen::Generators::JobGenerator.start([name, dependencies, 'simple']) end
new(path)
click to toggle source
# File lib/bosh/gen/cli.rb, line 16 def new(path) require 'bosh/gen/generators/new_release_generator' Bosh::Gen::Generators::NewReleaseGenerator.start([path]) end
package(name)
click to toggle source
# File lib/bosh/gen/cli.rb, line 32 def package(name) dependencies = options[:dependencies] || [] if options[:apt] require 'bosh/gen/generators/package_apt_generator' Bosh::Gen::Generators::PackageAptGenerator.start([name, dependencies]) elsif options[:docker_image] docker_image = options[:docker_image] require 'bosh/gen/generators/package_docker_image_generator' Bosh::Gen::Generators::PackageDockerImageGenerator.start([name, docker_image]) else files = options[:files] || [] sources = options[:src] || [] require 'bosh/gen/generators/package_generator' Bosh::Gen::Generators::PackageGenerator.start( [name, dependencies, files, sources]) end end
red()
click to toggle source
# File lib/bosh/gen/cli.rb, line 125 def red; "\033[31m" end
source(name, uri)
click to toggle source
# File lib/bosh/gen/cli.rb, line 53 def source(name, uri) flags = { :blob => options[:blob] || false } dir = Dir.mktmpdir files = [] if File.exist?(uri) files = [uri] else say "Downloading #{uri}..." FileUtils.chdir(dir) do %x`wget '#{uri}'` files = Dir['*'].map {|f| File.expand_path(f)} end end require 'bosh/gen/generators/package_source_generator' Bosh::Gen::Generators::PackageSourceGenerator.start( [name, files, flags]) end
template(job_name, file_path)
click to toggle source
# File lib/bosh/gen/cli.rb, line 92 def template(job_name, file_path) require 'bosh/gen/generators/job_template_generator' Bosh::Gen::Generators::JobTemplateGenerator.start([job_name, file_path]) end
yellow()
click to toggle source
# File lib/bosh/gen/cli.rb, line 127 def yellow; "\033[33m" end