Sha256: e65f256f0559daadbd58308a1830ff3ebec288e1493cddfe449b9e1679fa39aa

Contents?: true

Size: 546 Bytes

Versions: 8

Compression:

Stored size: 546 Bytes

Contents

require_relative "../base"

module Hexx
  module Generators

    # Use case scaffolder.
    class UseCase < Base

      def self.source_root
        super __FILE__
      end

      def add_use_case
        template "use_case.erb", "app/#{ use_cases_path }/#{ file_name }.rb"
      end

      def add_use_case_spec
        template(
          "use_case_spec.erb",
          "spec/#{ use_cases_path }/#{ file_name }_spec.rb"
        )
      end

      private

      def use_cases_path
        "use_cases/#{ gem_name }"
      end
    end
  end
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
hexx-1.1.1 lib/generators/use_case/use_case.rb
hexx-1.1.0 lib/generators/use_case/use_case.rb
hexx-1.0.2 lib/generators/use_case/use_case.rb
hexx-1.0.1 lib/generators/use_case/use_case.rb
hexx-1.0.0 lib/generators/use_case/use_case.rb
hexx-0.1.1 lib/generators/use_case/use_case.rb
hexx-0.1.0 lib/generators/use_case/use_case.rb
hexx-0.0.1 lib/generators/use_case/use_case.rb