Sha256: 2923cf7a6fe08ebca25bf98b36bed4235fad5946314c24a881a77c28bc9e1999

Contents?: true

Size: 1.13 KB

Versions: 14

Compression:

Stored size: 1.13 KB

Contents

require_relative 'base/object_helpers'
require_relative 'base/class_helpers'
require_relative 'base/class_inheritable'
require_relative 'base/class_auto_loader'
require_relative 'base/custom_error'
require_relative 'rake_task'
require_relative 'options'

class RakeCommander
  module Base
    class << self
      def included(base)
        super(base)
        base.extend RakeCommander::Base::ClassAutoLoader
        base.autoloads_children_of RakeCommander

        base.extend ClassMethods
        base.send :include, RakeTask
        base.send :include, Options
        #autoload_namespace_ignore "RakeCommander::Samples"
      end
    end

    module ClassMethods
      # Loads children classes by keeping a cache.
      def self_load
        autoload_children
      end

      # Clears track on any auto-loaded children
      # @note required for reload.
      def self_load_reset
        clear_autoloaded_children
      end

      # Clears the cache of autoloaded children classes and loads them again.
      def self_reload
        self_load_reset
        autoload_children
      end
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
rake-commander-0.4.0 lib/rake-commander/base.rb
rake-commander-0.3.6 lib/rake-commander/base.rb
rake-commander-0.3.5 lib/rake-commander/base.rb
rake-commander-0.3.3 lib/rake-commander/base.rb
rake-commander-0.2.12 lib/rake-commander/base.rb
rake-commander-0.2.11 lib/rake-commander/base.rb
rake-commander-0.2.10 lib/rake-commander/base.rb
rake-commander-0.2.7 lib/rake-commander/base.rb
rake-commander-0.2.6 lib/rake-commander/base.rb
rake-commander-0.2.5 lib/rake-commander/base.rb
rake-commander-0.2.4 lib/rake-commander/base.rb
rake-commander-0.2.3 lib/rake-commander/base.rb
rake-commander-0.2.2 lib/rake-commander/base.rb
rake-commander-0.2.0 lib/rake-commander/base.rb