Sha256: 55dbe1b0127830e264b7a3962b08e957114b39122aed1c1dcefe809d469084c4

Contents?: true

Size: 603 Bytes

Versions: 24

Compression:

Stored size: 603 Bytes

Contents

module Riveter
  module Generators
    class ServiceGenerator < ::Rails::Generators::NamedBase
      source_root File.expand_path('../templates', __FILE__)

      check_class_collision :suffix => 'Service'

      def create_service_file
        template 'service.rb', File.join('app/services', class_path, "#{file_name}_service.rb")
      end

      def create_module_file
        return if regular_class_path.empty?
        template 'module.rb', File.join('app/services', "#{class_path.join('/')}.rb") if behavior == :invoke
      end

      hook_for :test_framework, :as => :service
    end
  end
end

Version data entries

24 entries across 24 versions & 1 rubygems

Version Path
riveter-0.8.3 lib/generators/riveter/service/service_generator.rb
riveter-0.8.2 lib/generators/riveter/service/service_generator.rb
riveter-0.8.1 lib/generators/riveter/service/service_generator.rb
riveter-0.8.0 lib/generators/riveter/service/service_generator.rb
riveter-0.7.0 lib/generators/riveter/service/service_generator.rb
riveter-0.6.0 lib/generators/riveter/service/service_generator.rb
riveter-0.3.0 lib/generators/riveter/service/service_generator.rb
riveter-0.2.1 lib/generators/riveter/service/service_generator.rb
riveter-0.2.0 lib/generators/riveter/service/service_generator.rb
riveter-0.1.1 lib/generators/riveter/service/service_generator.rb
riveter-0.0.15 lib/generators/riveter/service/service_generator.rb
riveter-0.0.14 lib/generators/riveter/service/service_generator.rb
riveter-0.0.13 lib/generators/riveter/service/service_generator.rb
riveter-0.0.12 lib/generators/riveter/service/service_generator.rb
riveter-0.0.11 lib/generators/riveter/service/service_generator.rb
riveter-0.0.10 lib/generators/riveter/service/service_generator.rb
riveter-0.0.9 lib/generators/riveter/service/service_generator.rb
riveter-0.0.8 lib/generators/riveter/service/service_generator.rb
riveter-0.0.7 lib/generators/riveter/service/service_generator.rb
riveter-0.0.6 lib/generators/riveter/service/service_generator.rb