Class: Origen::Application::ConfigurationManager
- Inherits:
-
Object
- Object
- Origen::Application::ConfigurationManager
show all
- Defined in:
- lib/origen/application/configuration_manager.rb
Overview
All access to the configuration management system should be done through methods of this class, an instance of which is accessible via Origen.app.cm
Where possible external arguments relating to the underlying CM tool should not be used, try and keep method names and arguments generic.
Right now it supports Design Sync only, but by eliminating interaction with DS outside of this class it means that a future change to the CM system should be easily handled by simply swapping in a new ConfigurationManager class.
Instance Method Summary
collapse
Constructor Details
Returns a new instance of ConfigurationManager.
15
16
17
|
# File 'lib/origen/application/configuration_manager.rb', line 15
def initialize
@cm = Origen::Utility::DesignSync.new
end
|
Dynamic Method Handling
This class handles dynamic methods through the method_missing method
#method_missing(method, *args, &blk) ⇒ Object
73
74
75
|
# File 'lib/origen/application/configuration_manager.rb', line 73
def method_missing(method, *args, &blk)
@cm.send(method, *args, &blk)
end
|
Instance Method Details
#diff_cmd(options = {}) ⇒ Object
55
56
57
|
# File 'lib/origen/application/configuration_manager.rb', line 55
def diff_cmd(options = {})
@cm.diff_cmd(options)
end
|
#ensure_workspace_unmodified! ⇒ Object
63
64
65
66
67
68
69
70
71
|
# File 'lib/origen/application/configuration_manager.rb', line 63
def ensure_workspace_unmodified!
if modified_objects_in_workspace?
puts "Your workspace has local modifications that are preventing the requested action\n - run 'origen rc mods' to see them.\n EOT\n exit 1\n end\nend\n"
|
#fetch_latest(options = {}) ⇒ Object
Fetch the latest version of the application
48
49
50
51
52
53
|
# File 'lib/origen/application/configuration_manager.rb', line 48
def fetch_latest(options = {})
options = {
force: false
}.merge(options)
@cm.populate(workspace_dirs, rec: true, verbose: true, force: options[:force])
end
|
#import(*args) ⇒ Object
59
60
61
|
# File 'lib/origen/application/configuration_manager.rb', line 59
def import(*args)
@cm.import(*args)
end
|
#modified_objects_in_repository? ⇒ Boolean
35
36
37
|
# File 'lib/origen/application/configuration_manager.rb', line 35
def modified_objects_in_repository?
@cm.modified_objects?(workspace_dirs, rec: true, fullpath: true, remote: true)
end
|
#modified_objects_in_repository_list ⇒ Object
39
40
41
|
# File 'lib/origen/application/configuration_manager.rb', line 39
def modified_objects_in_repository_list
@cm.modified_objects(workspace_dirs, rec: true, fullpath: true, remote: true)
end
|
#modified_objects_in_workspace? ⇒ Boolean
19
20
21
|
# File 'lib/origen/application/configuration_manager.rb', line 19
def modified_objects_in_workspace?
@cm.modified_objects?(workspace_dirs, rec: true, fullpath: true)
end
|
#modified_objects_in_workspace_list ⇒ Object
23
24
25
|
# File 'lib/origen/application/configuration_manager.rb', line 23
def modified_objects_in_workspace_list
@cm.modified_objects(workspace_dirs, rec: true, fullpath: true)
end
|
#unmanaged_objects_in_workspace? ⇒ Boolean
27
28
29
|
# File 'lib/origen/application/configuration_manager.rb', line 27
def unmanaged_objects_in_workspace?
@cm.modified_objects?(workspace_dirs, rec: true, unmanaged: true, managed: false, fullpath: true)
end
|
#unmanaged_objects_in_workspace_list ⇒ Object
31
32
33
|
# File 'lib/origen/application/configuration_manager.rb', line 31
def unmanaged_objects_in_workspace_list
@cm.modified_objects(workspace_dirs, rec: true, unmanaged: true, managed: false, fullpath: true)
end
|
#workspace_dirs ⇒ Object
43
44
45
|
# File 'lib/origen/application/configuration_manager.rb', line 43
def workspace_dirs
"#{Origen.root} " + Origen.app.config.external_app_dirs.join(' ')
end
|