class Bard::CLI

Public Class Methods

exit_on_failure?(= true) click to toggle source
# File lib/bard/cli.rb, line 34
  def self.exit_on_failure? = true

  private

  def config
    @config ||= Bard::Config.new(project_name, path: "bard.rb")
  end

  def project_name
    @project_name ||= File.expand_path(".").split("/").last
  end

  def run!(...)
    Bard::Command.run!(...)
  rescue Bard::Command::Error => e
    puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
    exit 1
  end
end

Public Instance Methods

config() click to toggle source
# File lib/bard/cli.rb, line 38
def config
  @config ||= Bard::Config.new(project_name, path: "bard.rb")
end
project_name() click to toggle source
# File lib/bard/cli.rb, line 42
def project_name
  @project_name ||= File.expand_path(".").split("/").last
end
run!(...) click to toggle source
# File lib/bard/cli.rb, line 46
def run!(...)
  Bard::Command.run!(...)
rescue Bard::Command::Error => e
  puts red("!!! ") + "Running command failed: #{yellow(e.message)}"
  exit 1
end