Class: RestoreBundledWith::CLI
- Inherits:
-
Thor
- Object
- Thor
- RestoreBundledWith::CLI
- Defined in:
- lib/restore_bundled_with/cli.rb
Class Method Summary collapse
Instance Method Summary collapse
Class Method Details
.exit_on_failure? ⇒ Boolean
5 6 7 |
# File 'lib/restore_bundled_with/cli.rb', line 5 def self.exit_on_failure? true end |
Instance Method Details
#delete ⇒ Object
56 57 58 59 60 61 62 63 64 |
# File 'lib/restore_bundled_with/cli.rb', line 56 def delete setup_logger() data = read_data() puts Lock.new(data).delete_bundled_with rescue StandardError => e () raise e end |
#fetch ⇒ Object
74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 |
# File 'lib/restore_bundled_with/cli.rb', line 74 def fetch setup_logger() lock_file = Repository .new([:git_path], [:git_options]) .fetch_file( [:lockfile], [:ref], [:new_line] ) puts Lock .new(lock_file) .pick rescue StandardError => e () raise e end |
#restore ⇒ Object
30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 |
# File 'lib/restore_bundled_with/cli.rb', line 30 def restore setup_logger() params = .dup params[:file] = [:lockfile] if ![:data] && ![:file] data = read_data(params) lock_file = Lock.restore( data, [:lockfile], [:ref], [:git_path], [:git_options], [:new_line] ) File.write([:lockfile], lock_file.body) rescue StandardError => e () raise e end |
#version ⇒ Object
12 13 14 15 16 17 18 |
# File 'lib/restore_bundled_with/cli.rb', line 12 def version if [:digit] print ::RestoreBundledWith::VERSION else puts "RestoreBundledWith version #{::RestoreBundledWith::VERSION}" end end |