Class: Funkce::Generators::Function

Inherits:
Thor::Group
  • Object
show all
Includes:
Thor::Actions
Defined in:
lib/funkce/generators/function.rb

Class Method Summary collapse

Instance Method Summary collapse

Class Method Details

.source_rootObject



14
15
16
# File 'lib/funkce/generators/function.rb', line 14

def self.source_root
  "#{File.dirname(__FILE__)}/function"
end

Instance Method Details

#create_app_fileObject



24
25
26
# File 'lib/funkce/generators/function.rb', line 24

def create_app_file
  template('app.tt', "#{group}/#{name}/app.rb")
end

#create_gemfileObject



28
29
30
# File 'lib/funkce/generators/function.rb', line 28

def create_gemfile
  template('Gemfile.tt', "#{group}/#{name}/Gemfile")
end

#create_groupObject



18
19
20
21
22
# File 'lib/funkce/generators/function.rb', line 18

def create_group
  empty_directory(group.to_s)
  empty_directory("#{group}/#{name}")
  empty_directory("#{group}/#{name}/lib")
end

#create_lib_fileObject



32
33
34
# File 'lib/funkce/generators/function.rb', line 32

def create_lib_file
  template('lib.tt', "#{group}/#{name}/lib/#{name}.rb")
end