Sha256: 7f905e6b46b3c72909b949a6eab17aa6918474f9f30aeb2104a1184be922c814

Contents?: true

Size: 744 Bytes

Versions: 30

Compression:

Stored size: 744 Bytes

Contents

module RakeFactory
  module Namespaceable
    def self.prepended(base)
      super(base)
      base.class_eval do
        parameter(:namespace,
            transform: lambda { |name|
              name = name.to_s if name.kind_of?(Symbol)
              name = name.to_str if name.respond_to?(:to_str)
              unless name.kind_of?(String) || name.nil?
                raise ArgumentError,
                    "Expected a String or Symbol for a namespace name"
              end
              name
            })
      end
    end

    def around_define(application)
      if namespace
        application.in_namespace(namespace) do
          super(application)
        end
      else
        super(application)
      end
    end
  end
end

Version data entries

30 entries across 30 versions & 1 rubygems

Version Path
rake_factory-0.30.0.pre.5 lib/rake_factory/namespaceable.rb
rake_factory-0.30.0.pre.4 lib/rake_factory/namespaceable.rb
rake_factory-0.30.0.pre.3 lib/rake_factory/namespaceable.rb
rake_factory-0.30.0.pre.2 lib/rake_factory/namespaceable.rb
rake_factory-0.30.0.pre.1 lib/rake_factory/namespaceable.rb
rake_factory-0.29.0 lib/rake_factory/namespaceable.rb
rake_factory-0.28.0.pre.2 lib/rake_factory/namespaceable.rb
rake_factory-0.28.0.pre.1 lib/rake_factory/namespaceable.rb
rake_factory-0.27.0 lib/rake_factory/namespaceable.rb
rake_factory-0.26.0.pre.1 lib/rake_factory/namespaceable.rb
rake_factory-0.24.0.pre.2 lib/rake_factory/namespaceable.rb
rake_factory-0.25.0 lib/rake_factory/namespaceable.rb
rake_factory-0.24.0.pre.1 lib/rake_factory/namespaceable.rb
rake_factory-0.23.0 lib/rake_factory/namespaceable.rb
rake_factory-0.22.0.pre.1 lib/rake_factory/namespaceable.rb
rake_factory-0.21.0 lib/rake_factory/namespaceable.rb
rake_factory-0.20.0.pre.1 lib/rake_factory/namespaceable.rb
rake_factory-0.19.0 lib/rake_factory/namespaceable.rb
rake_factory-0.18.0.pre.2 lib/rake_factory/namespaceable.rb
rake_factory-0.18.0.pre.1 lib/rake_factory/namespaceable.rb