Sha256: a8c47e5c0506d3e106cb0dda83684efb23957acd2eb86d330d07164d2e4c7e5e

Contents?: true

Size: 594 Bytes

Versions: 14

Compression:

Stored size: 594 Bytes

Contents

module Kubes::Compiler::Shared
  module CustomHelpers
    # Load custom helper methods from project
    @@custom_helpers_loaded = false
    def load_custom_helpers
      return if @@custom_helpers_loaded
      paths = Dir.glob("#{Kubes.root}/.kubes/helpers/**/*.rb")
      paths.sort_by! { |p| p.size } # so namespaces are loaded first
      paths.each do |path|
        filename = path.sub(%r{.*.kubes/helpers/},'').sub('.rb','')
        module_name = filename.camelize
        self.class.send :include, module_name.constantize
      end
      @@custom_helpers_loaded = true
    end
  end
end

Version data entries

14 entries across 14 versions & 1 rubygems

Version Path
kubes-0.7.0 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.8 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.7 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.6 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.5 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.4 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.3 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.2 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.1 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.6.0 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.5.1 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.5.0 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.4.7 lib/kubes/compiler/shared/custom_helpers.rb
kubes-0.4.6 lib/kubes/compiler/shared/custom_helpers.rb