class Appboost::ForemanExportGenerator

Public Class Methods

default_app_name() click to toggle source
# File lib/generators/appboost/foreman_export_generator.rb, line 19
def self.default_app_name
  Dir.pwd.split('/').last
end
default_directory() click to toggle source
# File lib/generators/appboost/foreman_export_generator.rb, line 15
def self.default_directory
  Rails.root.to_s
end
default_log() click to toggle source
# File lib/generators/appboost/foreman_export_generator.rb, line 11
def self.default_log
  Rails.root.join('log/foreman').to_s
end
default_procfile() click to toggle source
# File lib/generators/appboost/foreman_export_generator.rb, line 6
def self.default_procfile
  e = Rails.env == 'development' ? nil : Rails.env
  ['Procfile', e].compact.join('.')
end

Public Instance Methods

export() click to toggle source
# File lib/generators/appboost/foreman_export_generator.rb, line 55
def export
  args = ["#{options[:format]} #{options[:location]}"]
  args << "-f #{options[:procfile]}"
  args << "-a #{options[:app]}"
  args << "-u #{options[:user]}"
  args << "-d #{options[:directory]}"
  args << "-l #{options[:log]}"
  args << "-c #{options[:concurrency]}" if options[:concurrency]

  system "bundle exec foreman export #{args.join(' ')}"
end