From 9f58101a35e3208383088aaf237197e9a89c4c9e Mon Sep 17 00:00:00 2001 From: Sean Collins Date: Fri, 3 Jan 2025 17:58:35 -0700 Subject: [PATCH] Remove un-used files --- .../generators/app/view/app_template.html.erb | 1 - .../cli/generators/app/view/app_view.erb | 10 --- .../app/view/slice_template.html.erb | 1 - .../cli/generators/app/view/slice_view.erb | 10 --- lib/hanami/cli/generators/app/view_context.rb | 88 ------------------- 5 files changed, 110 deletions(-) delete mode 100644 lib/hanami/cli/generators/app/view/app_template.html.erb delete mode 100644 lib/hanami/cli/generators/app/view/app_view.erb delete mode 100644 lib/hanami/cli/generators/app/view/slice_template.html.erb delete mode 100644 lib/hanami/cli/generators/app/view/slice_view.erb delete mode 100644 lib/hanami/cli/generators/app/view_context.rb diff --git a/lib/hanami/cli/generators/app/view/app_template.html.erb b/lib/hanami/cli/generators/app/view/app_template.html.erb deleted file mode 100644 index f5103b48..00000000 --- a/lib/hanami/cli/generators/app/view/app_template.html.erb +++ /dev/null @@ -1 +0,0 @@ -

<%= camelized_app_name %>::Views::<%= camelized_namespace %>::<%= camelized_name %>

diff --git a/lib/hanami/cli/generators/app/view/app_view.erb b/lib/hanami/cli/generators/app/view/app_view.erb deleted file mode 100644 index 0fbe8114..00000000 --- a/lib/hanami/cli/generators/app/view/app_view.erb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module <%= camelized_app_name %> - module Views -<%= module_namespace_declaration %> -<%= module_namespace_offset %>class <%= camelized_name %> < <%= camelized_app_name %>::View -<%= module_namespace_offset %>end -<%= module_namespace_end %> - end -end diff --git a/lib/hanami/cli/generators/app/view/slice_template.html.erb b/lib/hanami/cli/generators/app/view/slice_template.html.erb deleted file mode 100644 index 3ca74de9..00000000 --- a/lib/hanami/cli/generators/app/view/slice_template.html.erb +++ /dev/null @@ -1 +0,0 @@ -

<%= camelized_slice_name %>::Views::<%= camelized_namespace %>::<%= camelized_name %>

diff --git a/lib/hanami/cli/generators/app/view/slice_view.erb b/lib/hanami/cli/generators/app/view/slice_view.erb deleted file mode 100644 index fe7e897d..00000000 --- a/lib/hanami/cli/generators/app/view/slice_view.erb +++ /dev/null @@ -1,10 +0,0 @@ -# frozen_string_literal: true - -module <%= camelized_slice_name %> - module Views -<%= module_namespace_declaration %> -<%= module_namespace_offset %>class <%= camelized_name %> < <%= camelized_slice_name %>::View -<%= module_namespace_offset %>end -<%= module_namespace_end %> - end -end diff --git a/lib/hanami/cli/generators/app/view_context.rb b/lib/hanami/cli/generators/app/view_context.rb deleted file mode 100644 index ff434864..00000000 --- a/lib/hanami/cli/generators/app/view_context.rb +++ /dev/null @@ -1,88 +0,0 @@ -# frozen_string_literal: true - -require_relative "slice_context" -require "dry/files/path" -require_relative "../constants" - -module Hanami - module CLI - module Generators - # @since 2.1.0 - # @api private - module App - # @since 2.1.0 - # @api private - class ViewContext < SliceContext - # @since 2.1.0 - # @api private - attr_reader :key - - # @since 2.1.0 - # @api private - def initialize(inflector, app, slice, key) - @key = key - super(inflector, app, slice, nil) - end - - # @since 2.1.0 - # @api private - def namespaces - @namespaces ||= key.split(KEY_SEPARATOR)[..-2] - end - - # @since 2.1.0 - # @api private - def name - @name ||= key.split(KEY_SEPARATOR)[-1] - end - - # @since 2.1.0 - # @api private - def camelized_namespace - namespaces.map { inflector.camelize(_1) }.join(NAMESPACE_SEPARATOR) - end - - # @since 2.1.0 - # @api private - def camelized_name - inflector.camelize(name) - end - - # @since 2.1.0 - # @api private - def underscored_namespace - namespaces.map { inflector.underscore(_1) } - end - - # @since 2.1.0 - # @api private - def underscored_name - inflector.underscore(name) - end - - # @since 2.1.0 - # @api private - def module_namespace_declaration - namespaces.each_with_index.map { |token, i| - "#{NESTED_OFFSET}#{INDENTATION * i}module #{inflector.camelize(token)}" - }.join($/) - end - - # @since 2.1.0 - # @api private - def module_namespace_end - namespaces.each_with_index.map { |_, i| - "#{NESTED_OFFSET}#{INDENTATION * i}end" - }.reverse.join($/) - end - - # @since 2.1.0 - # @api private - def module_namespace_offset - "#{NESTED_OFFSET}#{INDENTATION * namespaces.count}" - end - end - end - end - end -end