Class: InfluxdbSetup::CreateDb
- Defined in:
- lib/influxdb_setup/create_db.rb
Instance Attribute Summary
Attributes inherited from Command
Instance Method Summary collapse
Methods inherited from Command
Constructor Details
This class inherits a constructor from InfluxdbSetup::Command
Instance Method Details
#call ⇒ Object
3 4 5 6 7 8 9 10 11 12 13 |
# File 'lib/influxdb_setup/create_db.rb', line 3 def call db = @config.db_name root = @config.build_client databases = root.list_databases.map { |row| row["name"] } unless databases.include?(db) root.create_database(db) else log "Influxdb database '#{db}' already exists" end end |