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
- #delete_jobs ⇒ Object
- #export ⇒ Object
- #export_jobs ⇒ Object
- #export_plugins ⇒ Object
- #export_views ⇒ Object
-
#initialize(args = [], options = {}, config = {}) ⇒ CLI
constructor
A new instance of CLI.
- #restart ⇒ Object
- #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
95 96 97 |
# File 'lib/jendle/cli.rb', line 95 def apply_views @view.apply() end |
#delete_jobs ⇒ Object
112 113 114 |
# File 'lib/jendle/cli.rb', line 112 def delete_jobs @job.delete_jobs() 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
88 89 90 |
# File 'lib/jendle/cli.rb', line 88 def export_views @view.export() end |
#restart ⇒ Object
107 108 109 |
# File 'lib/jendle/cli.rb', line 107 def restart @core.restart 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
82 83 84 |
# File 'lib/jendle/cli.rb', line 82 def restore_jobs @job.restore(, get_config([:source_profile]), [:job_name]) 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
102 103 104 |
# File 'lib/jendle/cli.rb', line 102 def restore_views @view.restore(, get_config([:source_profile])) end |
#version ⇒ Object
117 118 119 |
# File 'lib/jendle/cli.rb', line 117 def version puts VERSION end |