Class: Rosette::Client::Commands::SnapshotCommand

Inherits:
Command
  • Object
show all
Defined in:
lib/rosette/client/commands/snapshot_command.rb

Overview

a show is really just a diff against your parent (so the inheritance makes sense)

Instance Attribute Summary

Attributes inherited from Command

#api, #args, #repo, #terminal, #writer

Instance Method Summary collapse

Methods inherited from Command

#initialize

Constructor Details

This class inherits a constructor from Rosette::Client::Commands::Command

Instance Method Details

#executeObject



17
18
19
20
21
22
23
24
25
26
27
28
29
# File 'lib/rosette/client/commands/snapshot_command.rb', line 17

def execute
  response = api.snapshot(
    repo_name: derive_repo_name,
    ref: args.ref
  )

  handle_error(response) do |response|
    response.attributes.each do |item|
      print_hash(item)
      terminal.say('')
    end
  end
end

#parse_args(args) ⇒ Object



31
32
33
# File 'lib/rosette/client/commands/snapshot_command.rb', line 31

def parse_args(args)
  SnapshotCommandArgs.from_argv(args, repo)
end