Sha256: e8a17d6b801d8ff09e60895dc16d63754bfc95a9d9cbbfcef4f5a3a7b0730b0b

Contents?: true

Size: 668 Bytes

Versions: 9

Compression:

Stored size: 668 Bytes

Contents

#!/usr/bin/env ruby
# frozen_string_literal: true

root = Dir.pwd
$LOAD_PATH << File.join(root, 'lib')

require 'yaml'
LB_PROJECT_YML = 'config/lb-project.yml'
config_file = File.join(root, LB_PROJECT_YML)
unless File.exist?(config_file)
  puts "#{LB_PROJECT_YML} not found: '#{config_file}'"
  exit 1
end
config = YAML.load_file(config_file)

begin
  namespace = config.fetch('namespace')
  require namespace
  LB::Project::Render.new.call
  exit 0
rescue KeyError
  puts "'namespace' not set in '#{LB_PROJECT_YML}'!"
  raise
rescue LoadError
  puts "Can not require namespace '#{namespace}'!"
  puts "Please fix namespace in '#{LB_PROJECT_YML}'."
  raise
end
exit 1

Version data entries

9 entries across 9 versions & 1 rubygems

Version Path
lb-project-0.3.1 bin/lb-project
lb-project-0.3.0 bin/lb-project
lb-project-0.2.3 bin/lb-project
lb-project-0.2.2 bin/lb-project
lb-project-0.2.1 bin/lb-project
lb-project-0.2.0 bin/lb-project
lb-project-0.1.1 bin/lb-project
lb-project-0.1.0 bin/lb-project
lb-project-0.0.1 bin/lb-project