Class: Screengrab::Setup
- Inherits:
-
Object
- Object
- Screengrab::Setup
- Defined in:
- lib/screengrab/setup.rb
Class Method Summary collapse
-
.create(path) ⇒ Object
This method will take care of creating a screengrabfile and other necessary files.
Class Method Details
.create(path) ⇒ Object
This method will take care of creating a screengrabfile and other necessary files
4 5 6 7 8 9 10 11 12 13 14 |
# File 'lib/screengrab/setup.rb', line 4 def self.create(path) screengrabfile_path = File.join(path, 'Screengrabfile') if File.exist?(screengrabfile_path) UI.user_error!("Screengrabfile already exists at path '#{screengrabfile_path}'. Run 'screengrab' to use screengrab.") end File.write(screengrabfile_path, File.read("#{Screengrab::ROOT}/lib/assets/ScreengrabfileTemplate")) UI.success("Successfully created new Screengrabfile at '#{screengrabfile_path}'") end |