Sha256: aae79206abf96d460591ca6d610d6775aac970b4f5f3f46f2efed9d9a74efa91

Contents?: true

Size: 371 Bytes

Versions: 55

Compression:

Stored size: 371 Bytes

Contents

# frozen_string_literal: true

require 'active_support/core_ext/string/inflections'

module GoNative
  module Utils
    class SanitizePluginName
      class << self
        def call(raw_name, platform)
          name_components = raw_name.underscore.dasherize.split('-') - ['plugin', platform]

          name_components.join('-')
        end
      end
    end
  end
end

Version data entries

55 entries across 55 versions & 1 rubygems

Version Path
gonative-cli-1.4.4 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.4.3 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.4.2 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.4.1 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.4.0 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.9 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.8 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.7 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.6 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.5 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.4 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.3 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.2 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.1 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.3.0 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.2.4 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.2.3 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.2.2 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.2.1 lib/gonative/utils/sanitize_plugin_name.rb
gonative-cli-1.2.0 lib/gonative/utils/sanitize_plugin_name.rb