Sha256: 436561fae9880d9ebe4109eb37daa419570774778a234cead9cc9e136a4961b8
Contents?: true
Size: 812 Bytes
Versions: 9
Compression:
Stored size: 812 Bytes
Contents
# frozen_string_literal: true module RakeFactory module Namespaceable # rubocop:disable Metrics/MethodLength def self.prepended(base) super(base) base.class_eval do parameter(:namespace, transform: lambda { |name| name = name.to_s if name.is_a?(Symbol) name = name.to_str if name.respond_to?(:to_str) unless name.is_a?(String) || name.nil? raise ArgumentError, 'Expected a String or Symbol for a namespace name' end name }) end end # rubocop:enable Metrics/MethodLength def around_define(application) if namespace application.in_namespace(namespace) do super(application) end else super(application) end end end end
Version data entries
9 entries across 9 versions & 1 rubygems