Class: Prez::New

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/prez/new.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



30
31
32
# File 'lib/prez/new.rb', line 30

def source_root
  File.absolute_path File.expand_path("../../../templates", __FILE__)
end

Instance Method Details

#check_file!Object



9
10
11
12
13
# File 'lib/prez/new.rb', line 9

def check_file!
  if File.exists? filename
    raise Prez::Error.new("There is already a presentation file named '#{filename}'")
  end
end

#generate_prezObject



15
16
17
# File 'lib/prez/new.rb', line 15

def generate_prez
  template "new.prez.tt", "#{name}.prez"
end