Class: Command
- Inherits:
-
Object
show all
- Defined in:
- lib/commands.rb
Instance Attribute Summary collapse
Instance Method Summary
collapse
Instance Attribute Details
#path ⇒ Object
Returns the value of attribute path.
2
3
4
|
# File 'lib/commands.rb', line 2
def path
@path
end
|
Instance Method Details
#<=>(other) ⇒ Object
26
27
28
|
# File 'lib/commands.rb', line 26
def <=> other
priority <=> other.priority
end
|
#dry_run ⇒ Object
23
|
# File 'lib/commands.rb', line 23
def dry_run ; raise NotImplementedError ; end
|
#priority ⇒ Object
4
|
# File 'lib/commands.rb', line 4
def priority ; nil ; end
|
#real_run ⇒ Object
24
|
# File 'lib/commands.rb', line 24
def real_run ; raise NotImplementedError ; end
|
#run ⇒ Object
14
15
16
17
18
19
20
21
|
# File 'lib/commands.rb', line 14
def run
unless $OPTS[:silent]
dr=dry_run
puts(dry_run) if dry_run
end
real_run unless $OPTS[:dry_run]
end
|
6
7
8
9
10
11
12
|
# File 'lib/commands.rb', line 6
def transform filename
if path
File.join path, filename
else
File.join '.', filename
end
end
|