Class: NotionCf::CLI

Inherits:
Thor
  • Object
show all
Defined in:
lib/notion_cf/cli.rb

Overview

CLI class

Instance Method Summary collapse

Instance Method Details

#deploy(page_id, template_file_path) ⇒ Object



12
13
14
15
16
# File 'lib/notion_cf/cli.rb', line 12

def deploy(page_id, template_file_path)
  blueprints = Template.build_from_file(file_path: template_file_path).blueprints
  NotionCf::Resources.new(page_id:).deploy(blueprints)
  generate(page_id)
end

#generate(page_id) ⇒ Object



19
20
21
22
23
24
# File 'lib/notion_cf/cli.rb', line 19

def generate(page_id)
  resources = NotionCf::Resources.new(page_id:)
  resources.retrieve
  file_path = NotionCf::Template.new(blueprints: resources.blueprints).create(page_id)
  puts "created #{file_path}"
end

#versionObject



7
8
9
# File 'lib/notion_cf/cli.rb', line 7

def version
  puts NotionCf::VERSION
end