Class: Kozeki::Cli

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

Instance Method Summary collapse

Instance Method Details

#build(config_file) ⇒ Object



16
17
18
19
20
21
22
# File 'lib/kozeki/cli.rb', line 16

def build(config_file)
  client = make_client(config_file)
  client.build(
    incremental_build: !options[:full],
    events: options[:events_from_stdin] ? load_events_from_stdin() : nil,
  )
end

#debug_state(config_file) ⇒ Object



31
32
33
34
35
36
37
# File 'lib/kozeki/cli.rb', line 31

def debug_state(config_file)
  client = make_client(config_file)
  state = State.open(path: client.config.state_path)
  state.db.execute(%{select * from "records" order by "id" asc}).map { p record: _1 }
  state.db.execute(%{select * from "collection_memberships" order by "collection" asc, "record_id" asc}).map { p collection_membership: _1 }
  state.db.execute(%{select * from "item_ids" order by "id" asc}).map { p item_id: _1 }
end

#watch(config_file) ⇒ Object



25
26
27
28
# File 'lib/kozeki/cli.rb', line 25

def watch(config_file)
  client = make_client(config_file)
  client.watch
end