Class: Deano::Command
- Inherits:
-
Object
- Object
- Deano::Command
- Defined in:
- lib/deano/commands/command.rb
Direct Known Subclasses
Class Method Summary collapse
Instance Method Summary collapse
- #app_path(*path) ⇒ Object
- #cmd(command) ⇒ Object
- #rm(path) ⇒ Object
- #rm_r(path) ⇒ Object
- #template_path(*path) ⇒ Object
Class Method Details
.command ⇒ Object
9 10 11 |
# File 'lib/deano/commands/command.rb', line 9 def self.command nil end |
.commands ⇒ Object
13 14 15 |
# File 'lib/deano/commands/command.rb', line 13 def self.commands @commands ||= [] end |
.inherited(klass) ⇒ Object
17 18 19 |
# File 'lib/deano/commands/command.rb', line 17 def self.inherited(klass) self.commands << klass end |
Instance Method Details
#app_path(*path) ⇒ Object
40 41 42 |
# File 'lib/deano/commands/command.rb', line 40 def app_path(*path) File.(File.join(@app_dir, *path)) end |
#cmd(command) ⇒ Object
21 22 23 24 |
# File 'lib/deano/commands/command.rb', line 21 def cmd(command) puts command system command end |
#rm(path) ⇒ Object
26 27 28 29 30 31 |
# File 'lib/deano/commands/command.rb', line 26 def rm(path) begin FileUtils.rm path, verbose: true rescue Errno::ENOENT => e end end |
#rm_r(path) ⇒ Object
33 34 35 36 37 38 |
# File 'lib/deano/commands/command.rb', line 33 def rm_r(path) begin FileUtils.rm_r path, verbose: true rescue Errno::ENOENT => e end end |
#template_path(*path) ⇒ Object
44 45 46 |
# File 'lib/deano/commands/command.rb', line 44 def template_path(*path) File.(File.join(Deano.template_dir, *path)) end |