Class: Appboost::ForemanExportGenerator
- Inherits:
-
Rails::Generators::Base
- Object
- Rails::Generators::Base
- Appboost::ForemanExportGenerator
- Defined in:
- lib/generators/appboost/foreman_export_generator.rb
Class Method Summary collapse
- .default_app_name ⇒ Object
- .default_directory ⇒ Object
- .default_log ⇒ Object
- .default_procfile ⇒ Object
Instance Method Summary collapse
Class Method Details
.default_app_name ⇒ Object
19 20 21 |
# File 'lib/generators/appboost/foreman_export_generator.rb', line 19 def self.default_app_name Dir.pwd.split('/').last end |
.default_directory ⇒ Object
15 16 17 |
# File 'lib/generators/appboost/foreman_export_generator.rb', line 15 def self.default_directory Rails.root.to_s end |
.default_log ⇒ Object
11 12 13 |
# File 'lib/generators/appboost/foreman_export_generator.rb', line 11 def self.default_log Rails.root.join('log/foreman').to_s end |
.default_procfile ⇒ Object
6 7 8 9 |
# 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 |
Instance Method Details
#export ⇒ Object
55 56 57 58 59 60 61 62 63 64 65 |
# File 'lib/generators/appboost/foreman_export_generator.rb', line 55 def export args = ["#{[:format]} #{[:location]}"] args << "-f #{[:procfile]}" args << "-a #{[:app]}" args << "-u #{[:user]}" args << "-d #{[:directory]}" args << "-l #{[:log]}" args << "-c #{[:concurrency]}" if [:concurrency] system "bundle exec foreman export #{args.join(' ')}" end |