Class: Bolt::ProjectMigrate
- Inherits:
-
Object
- Object
- Bolt::ProjectMigrate
- Defined in:
- lib/bolt/project_migrate.rb
Instance Attribute Summary collapse
-
#backup_dir ⇒ Object
readonly
Returns the value of attribute backup_dir.
-
#config_file ⇒ Object
readonly
Returns the value of attribute config_file.
-
#inventory_file ⇒ Object
readonly
Returns the value of attribute inventory_file.
-
#outputter ⇒ Object
readonly
Returns the value of attribute outputter.
-
#path ⇒ Object
readonly
Returns the value of attribute path.
-
#project_file ⇒ Object
readonly
Returns the value of attribute project_file.
Instance Method Summary collapse
-
#initialize(path, outputter, configured_inventory = nil) ⇒ ProjectMigrate
constructor
This init mostly makes testing easier.
- #migrate_project ⇒ Object
Constructor Details
#initialize(path, outputter, configured_inventory = nil) ⇒ ProjectMigrate
This init mostly makes testing easier
8 9 10 11 12 13 14 15 |
# File 'lib/bolt/project_migrate.rb', line 8 def initialize(path, outputter, configured_inventory = nil) @path = Pathname.new(path). @project_file = @path + 'bolt-project.yaml' @config_file = @path + 'bolt.yaml' @backup_dir = @path + '.bolt-bak' @inventory_file = configured_inventory || @path + 'inventory.yaml' @outputter = outputter end |
Instance Attribute Details
#backup_dir ⇒ Object (readonly)
Returns the value of attribute backup_dir.
5 6 7 |
# File 'lib/bolt/project_migrate.rb', line 5 def backup_dir @backup_dir end |
#config_file ⇒ Object (readonly)
Returns the value of attribute config_file.
5 6 7 |
# File 'lib/bolt/project_migrate.rb', line 5 def config_file @config_file end |
#inventory_file ⇒ Object (readonly)
Returns the value of attribute inventory_file.
5 6 7 |
# File 'lib/bolt/project_migrate.rb', line 5 def inventory_file @inventory_file end |
#outputter ⇒ Object (readonly)
Returns the value of attribute outputter.
5 6 7 |
# File 'lib/bolt/project_migrate.rb', line 5 def outputter @outputter end |
#path ⇒ Object (readonly)
Returns the value of attribute path.
5 6 7 |
# File 'lib/bolt/project_migrate.rb', line 5 def path @path end |
#project_file ⇒ Object (readonly)
Returns the value of attribute project_file.
5 6 7 |
# File 'lib/bolt/project_migrate.rb', line 5 def project_file @project_file end |
Instance Method Details
#migrate_project ⇒ Object
17 18 19 20 21 |
# File 'lib/bolt/project_migrate.rb', line 17 def migrate_project inv_ok = inventory_1_to_2(inventory_file, outputter) if inventory_file.file? config_ok = bolt_yaml_to_bolt_project(inventory_file, outputter) inv_ok && config_ok ? 0 : 1 end |