Class: PGit::Command::Show

Inherits:
Object
  • Object
show all
Extended by:
Forwardable
Defined in:
lib/pgit/command/show.rb

Instance Method Summary collapse

Constructor Details

#initialize(app) ⇒ Show

Returns a new instance of Show.

[View source]

11
12
13
# File 'lib/pgit/command/show.rb', line 11

def initialize(app)
  @app = app
end

Instance Method Details

#execute!Object

Raises:

[View source]

15
16
17
18
19
20
21
22
23
24
# File 'lib/pgit/command/show.rb', line 15

def execute!
  error_message = "No commands are listed for this project. Run `pgit cmd add --help` for more info."
  raise PGit::Error::User, error_message if commands.empty?

  if search.empty?
    show_all_of_current_project
  else
    show_one
  end
end

#searchObject

[View source]

26
27
28
# File 'lib/pgit/command/show.rb', line 26

def search
  args.first || []
end