class Tennpipes::Generators::Helper

Responsible for generating route helpers and associated tests within a Tennpipes application.

Public Class Methods

banner() click to toggle source
source_root() click to toggle source
# File lib/tennpipes-init/generators/helper.rb, line 10
def self.source_root; File.expand_path(File.dirname(__FILE__)); end

Public Instance Methods

create_helper() click to toggle source

Execute helper generation

# File lib/tennpipes-init/generators/helper.rb, line 32
def create_helper
  self.destination_root = options[:root]
  if in_app_root?
    app = options[:app]
    check_app_existence(app)
    @project_name = options[:namespace].underscore.camelize
    @project_name = fetch_project_name(app) if @project_name.empty?
    @app_name     = fetch_app_name(app)

    self.behavior = :revoke if options[:destroy]

    create_helper_files(app, name)
  else
    say 'You are not at the root of a Tennpipes application! (config/boot.rb not found)'
  end
end