Class: Bridgetown::Commands::Apply

Inherits:
Thor::Group
  • Object
show all
Extended by:
Summarizable
Includes:
Actions, Thor::Actions
Defined in:
bridgetown-core/lib/bridgetown-core/commands/apply.rb

Constant Summary

Constants included from Actions

Bridgetown::Commands::Actions::GITHUB_BLOB_REGEX, Bridgetown::Commands::Actions::GITHUB_REGEX, Bridgetown::Commands::Actions::GITHUB_REPO_REGEX, Bridgetown::Commands::Actions::GITHUB_TREE_REGEX

Class Method Summary collapse

Instance Method Summary collapse

Methods included from Summarizable

summary

Methods included from Actions

#add_gem, #add_initializer, #add_npm_for_gem, #add_npm_package, #apply_from_url, #create_builder, #javascript_import, #ruby_configure

Class Method Details



14
15
16
# File 'bridgetown-core/lib/bridgetown-core/commands/apply.rb', line 14

def self.banner
  "bridgetown apply PATH or URL"
end

.exit_on_failure?Boolean

Returns:

  • (Boolean)


23
24
25
# File 'bridgetown-core/lib/bridgetown-core/commands/apply.rb', line 23

def self.exit_on_failure?
  true
end

.source_rootObject



19
20
21
# File 'bridgetown-core/lib/bridgetown-core/commands/apply.rb', line 19

def self.source_root
  Dir.pwd
end

Instance Method Details

#apply_automationObject



27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
# File 'bridgetown-core/lib/bridgetown-core/commands/apply.rb', line 27

def apply_automation
  @source_paths = [Dir.pwd]
  @logger = Bridgetown.logger

  if options[:apply]
    apply_after_new_command
  else
    apply_in_pwd
  end
rescue SystemExit => e
  @logger.error "Problem occurred while running automation:"
  e.backtrace[0..3].each do |backtrace_line|
    @logger.info backtrace_line if backtrace_line.include?(":in `apply'")
  end
  raise e
end