Class: Cauchy::Cli
- Inherits:
-
Thor
- Object
- Thor
- Cauchy::Cli
- Includes:
- Thor::Actions
- Defined in:
- lib/cauchy/cli.rb
Instance Method Summary collapse
- #apply(schema_name = nil) ⇒ Object
- #init ⇒ Object
- #new(name) ⇒ Object
- #status(schema_name = nil) ⇒ Object
- #version ⇒ Object
Instance Method Details
#apply(schema_name = nil) ⇒ Object
33 34 35 36 37 38 39 40 41 42 43 44 |
# File 'lib/cauchy/cli.rb', line 33 def apply(schema_name = nil) verify_project! Migrator.migrate( client, schema_path, schema_name, .slice('reindex', 'close_index').symbolize_keys ) rescue Elastic::CannotUpdateNonDynamicSettingsError => e Cauchy.logger.warn e.to_s Cauchy.logger.warn 'Provide --close-index in order to perform this update' rescue MigrationError => e Cauchy.logger.warn e.to_s end |
#init ⇒ Object
20 21 22 |
# File 'lib/cauchy/cli.rb', line 20 def init init_project end |
#new(name) ⇒ Object
25 26 27 28 |
# File 'lib/cauchy/cli.rb', line 25 def new(name) verify_project! generate_schema name end |
#status(schema_name = nil) ⇒ Object
47 48 49 50 51 52 |
# File 'lib/cauchy/cli.rb', line 47 def status(schema_name = nil) verify_project! Migrator.status(client, schema_path, schema_name) rescue MigrationError => e Cauchy.logger.warn e.to_s end |