Class: Jendle::CLI
- Inherits:
-
Thor
- Object
- Thor
- Jendle::CLI
- Defined in:
- lib/jendle/cli.rb
Instance Method Summary collapse
- #apply ⇒ Object
- #apply_jobs ⇒ Object
- #apply_plugins ⇒ Object
- #apply_views ⇒ Object
- #export ⇒ Object
- #export_jobs ⇒ Object
- #export_plugins ⇒ Object
- #export_views ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #restore ⇒ Object
- #restore_jobs ⇒ Object
- #restore_plugins ⇒ Object
- #restore_views ⇒ Object
- #version ⇒ Object
Constructor Details
#initialize(args = [], options = {}, config = {}) ⇒ CLI
Returns a new instance of CLI.
11 12 13 14 15 16 17 18 19 |
# File 'lib/jendle/cli.rb', line 11 def initialize(args = [], = {}, config = {}) super(args, , config) @global_options = config[:shell].base. config = get_config(@global_options[:profile]) core = Core.new(config) @job = Job.new(core) @view = View.new(core) @plugin = Plugin.new(core) end |
Instance Method Details
#apply ⇒ Object
30 31 32 33 34 |
# File 'lib/jendle/cli.rb', line 30 def apply invoke(:apply_plugins, [], ['-d', [:'dry-run']]) invoke(:apply_jobs, [], ['-d', [:'dry-run']]) invoke(:apply_views, [], ['-d', [:'dry-run']]) end |
#apply_jobs ⇒ Object
74 75 76 |
# File 'lib/jendle/cli.rb', line 74 def apply_jobs @job.apply() end |
#apply_plugins ⇒ Object
54 55 56 |
# File 'lib/jendle/cli.rb', line 54 def apply_plugins @plugin.apply() end |
#apply_views ⇒ Object
94 95 96 |
# File 'lib/jendle/cli.rb', line 94 def apply_views @view.apply() end |
#export ⇒ Object
22 23 24 25 26 |
# File 'lib/jendle/cli.rb', line 22 def export invoke(:export_plugins, [], []) invoke(:export_jobs, [], []) invoke(:export_views, [], []) end |
#export_jobs ⇒ Object
67 68 69 |
# File 'lib/jendle/cli.rb', line 67 def export_jobs @job.export() end |
#export_plugins ⇒ Object
47 48 49 |
# File 'lib/jendle/cli.rb', line 47 def export_plugins @plugin.export() end |
#export_views ⇒ Object
87 88 89 |
# File 'lib/jendle/cli.rb', line 87 def export_views @view.export() end |
#restore ⇒ Object
39 40 41 42 43 |
# File 'lib/jendle/cli.rb', line 39 def restore invoke(:restore_plugins, [], ['-d', [:'dry-run'], 'source_profile', [:source_profile]]) invoke(:restore_jobs, [], ['-d', [:'dry-run'], 'source_profile', [:source_profile]]) invoke(:restore_views, [], ['-d', [:'dry-run'], 'source_profile', [:source_profile]]) end |
#restore_jobs ⇒ Object
81 82 83 |
# File 'lib/jendle/cli.rb', line 81 def restore_jobs @job.restore(, get_config([:source_profile])) end |
#restore_plugins ⇒ Object
61 62 63 |
# File 'lib/jendle/cli.rb', line 61 def restore_plugins @plugin.restore(, get_config([:source_profile])) end |
#restore_views ⇒ Object
101 102 103 |
# File 'lib/jendle/cli.rb', line 101 def restore_views @view.restore(, get_config([:source_profile])) end |
#version ⇒ Object
106 107 108 |
# File 'lib/jendle/cli.rb', line 106 def version puts VERSION end |