Class: Manifold::CLI
- Inherits:
-
Thor
- Object
- Thor
- Manifold::CLI
- Defined in:
- lib/manifold/cli.rb
Overview
CLI provides command line interface functionality for creating and managing umbrella projects for data management.
Instance Attribute Summary collapse
-
#logger ⇒ Object
Returns the value of attribute logger.
Instance Method Summary collapse
- #add(name) ⇒ Object
- #generate ⇒ Object
- #init(name) ⇒ Object
-
#initialize(*args, logger: Logger.new($stdout)) ⇒ CLI
constructor
A new instance of CLI.
Constructor Details
#initialize(*args, logger: Logger.new($stdout)) ⇒ CLI
Returns a new instance of CLI.
9 10 11 12 13 14 |
# File 'lib/manifold/cli.rb', line 9 def initialize(*args, logger: Logger.new($stdout)) super(*args) self.logger = logger logger.level = Logger::INFO end |
Instance Attribute Details
#logger ⇒ Object
Returns the value of attribute logger.
7 8 9 |
# File 'lib/manifold/cli.rb', line 7 def logger @logger end |
Instance Method Details
#add(name) ⇒ Object
42 43 44 45 46 |
# File 'lib/manifold/cli.rb', line 42 def add(name) workspace = API::Workspace.new(name) workspace.add logger.info "Added workspace '#{name}' with tables and routines directories." end |
#generate ⇒ Object
51 52 53 54 55 56 57 |
# File 'lib/manifold/cli.rb', line 51 def generate path = Pathname.pwd name = path.basename.to_s project = API::Project.new(name, directory: path, logger:) project.generate(with_terraform: true, is_submodule: [:submodule]) logger.info "Generated BigQuery schema and Terraform configurations for all workspaces in the project." end |
#init(name) ⇒ Object
17 18 19 20 |
# File 'lib/manifold/cli.rb', line 17 def init(name) Manifold::API::Project.create(name) logger.info "Created umbrella project '#{name}' with workspaces and vectors directories." end |