Sha256: c912105a65f78a7319713c924a7355f47cd5506a2a0f71f7f63d2c6137143746

Contents?: true

Size: 402 Bytes

Versions: 13

Compression:

Stored size: 402 Bytes

Contents

# frozen_string_literal: true

require "shellwords"

module Hanami
  module CLI
    class Naming
      def initialize(inflector:)
        @inflector = inflector
      end

      def action_name(name)
        inflector.underscore(escape(name)).gsub("/", ".")
      end

      private

      attr_reader :inflector

      def escape(name)
        Shellwords.shellescape(name)
      end
    end
  end
end

Version data entries

13 entries across 13 versions & 1 rubygems

Version Path
hanami-cli-2.2.1 lib/hanami/cli/naming.rb
hanami-cli-2.2.0 lib/hanami/cli/naming.rb
hanami-cli-2.2.0.rc1 lib/hanami/cli/naming.rb
hanami-cli-2.2.0.beta2 lib/hanami/cli/naming.rb
hanami-cli-2.2.0.beta1 lib/hanami/cli/naming.rb
hanami-cli-2.1.1 lib/hanami/cli/naming.rb
hanami-cli-2.1.0 lib/hanami/cli/naming.rb
hanami-cli-2.1.0.rc3 lib/hanami/cli/naming.rb
hanami-cli-2.1.0.rc2 lib/hanami/cli/naming.rb
hanami-cli-2.1.0.rc1 lib/hanami/cli/naming.rb
hanami-cli-2.1.0.beta2 lib/hanami/cli/naming.rb
hanami-cli-2.1.0.beta1 lib/hanami/cli/naming.rb
hanami-cli-2.0.3 lib/hanami/cli/naming.rb