# frozen_string_literal: true require 'thor/group' require 'active_support/inflector' module Funkce module Generators class Function < Thor::Group include Thor::Actions argument :group, type: :string argument :name, type: :string def self.source_root "#{File.dirname(__FILE__)}/function" end def create_group empty_directory(group.to_s) empty_directory("#{group}/#{name}") empty_directory("#{group}/#{name}/lib") end def create_app_file template('app.tt', "#{group}/#{name}/app.rb") end def create_gemfile template('Gemfile.tt', "#{group}/#{name}/Gemfile") end def create_lib_file template('lib.tt', "#{group}/#{name}/lib/#{name}.rb") end end end end