Class: InitCommand
- Inherits:
-
Object
- Object
- InitCommand
- Defined in:
- lib/commands/init_command.rb
Instance Method Summary collapse
-
#initialize(options) ⇒ InitCommand
constructor
A new instance of InitCommand.
- #run ⇒ Object
Constructor Details
#initialize(options) ⇒ InitCommand
Returns a new instance of InitCommand.
2 3 4 |
# File 'lib/commands/init_command.rb', line 2 def initialize() @options = end |
Instance Method Details
#run ⇒ Object
6 7 8 9 10 11 12 13 |
# File 'lib/commands/init_command.rb', line 6 def run path = File.join(Dir.pwd, CARTRCFILE) if File.exist?(path) raise AppError.new, "File #{path} already exists" else File.write(path, file_contents) end end |