Sha256: 1c769b207ca496d040b8e9a93299307d75a99092fdd8f7af89c082339c3f2775

Contents?: true

Size: 558 Bytes

Versions: 3

Compression:

Stored size: 558 Bytes

Contents

require 'thor'
require 'active_support/all'

module ServiceTemplate
  module Generators
    class ApiGenerator < Thor::Group
      include Thor::Actions
      argument :name

      def name_underscore
        name.underscore
      end

      def name_tableize
        name.tableize
      end

      def output_directory
        '.'
      end

      def api
        self.class.source_root "#{File.dirname(__FILE__)}/templates/api"
        say 'Generating api...'
        directory '.', output_directory
        say 'Done!', :green
      end
    end
  end
end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
service_template-0.5.2 lib/service_template/generators/api_generator.rb
service_template-0.5.1 lib/service_template/generators/api_generator.rb
service_template-0.5.0 lib/service_template/generators/api_generator.rb