Class: Gisture::Commands::Repo::File::Run

Inherits:
Object
  • Object
show all
Includes:
Kommand::Commands::Command
Defined in:
lib/gisture/commands/repo/file/run.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.usageObject



19
20
21
22
23
24
25
26
# File 'lib/gisture/commands/repo/file/run.rb', line 19

def usage
  puts "usage: #{Kommand.kommand} #{command_name} GIST_ID_OR_URL #{valid_arguments.to_s}"
  unless valid_arguments.empty?
    puts
    puts "Arguments:"
    puts valid_arguments.to_help
  end
end

Instance Method Details

#runObject



29
30
31
32
33
34
35
36
37
38
39
# File 'lib/gisture/commands/repo/file/run.rb', line 29

def run
  clone? ? repo.clone! : repo.destroy_clone!

  result = file.run!

  if strategy == :exec
    puts result
  else
    result
  end
end