Sha256: 8147e518a971b0ca915591a451f0687ba9415f0ab8cbd7e1e3745b6f306f1216
Contents?: true
Size: 1.09 KB
Versions: 10
Compression:
Stored size: 1.09 KB
Contents
module Brightbox class CommandGenerator COMMAND_LIST = [ 'brightbox-accounts', 'brightbox-cloudips', 'brightbox-config', 'brightbox-groups', 'brightbox-images', 'brightbox-lbs', 'brightbox-servers', 'brightbox-firewall-policies', 'brightbox-firewall-rules', 'brightbox-types', 'brightbox-users', 'brightbox-zones' ] def initialize(brightbox_cli_path) @brightbox_cli_path = brightbox_cli_path COMMAND_LIST.each do |command| File.open("#{cli_binary_path}/#{command}","w+") do |fl| fl.write(command_template) end end end private def command_template brightbox_command =<<-EOF #!/usr/bin/env ruby begin require "brightbox_cli" rescue LoadError brightbox_cli_path = File.expand_path('../../lib', __FILE__) $:.unshift(brightbox_cli_path) require "brightbox_cli" end Brightbox::BBConfig.config do include GLI run ARGV end EOF brightbox_command end def cli_binary_path File.join(@brightbox_cli_path,"..","bin") end end end
Version data entries
10 entries across 10 versions & 1 rubygems