Sha256: 454bed51976090266e9a7c098f9e9afd2211871ca7bc1fee9897c427eb2556b6

Contents?: true

Size: 973 Bytes

Versions: 31

Compression:

Stored size: 973 Bytes

Contents

module Praxis


  module BootloaderStages

    class WarnUnloadedFiles < Stage
      @enabled = true

      def self.enabled=(enabled)
        @enabled = enabled
      end

      def self.enabled
        @enabled
      end

      def execute
        return unless self.class.enabled

        if application.file_layout[:app] == []
          return
        end

        base = application.file_layout[:app].base
        return unless base.exist?
        file_enum = base.find.to_a
        files = file_enum.select do |file|
          path = file.relative_path_from(base)
          path.extname == '.rb'
        end

        missing = Set.new(files) - application.loaded_files
        if missing.any?
          msg = "The following application files under #{base} were not loaded:\n"
          missing.each do |file|
            path = file.relative_path_from(base)
            msg << " * #{path}\n"
          end
          warn msg
        end
      end


    end
  end
end

Version data entries

31 entries across 31 versions & 1 rubygems

Version Path
praxis-2.0.pre.18 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.17 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.16 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.15 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.14 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.13 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.12 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.11 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.10 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.9 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.8 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.7 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.6 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.5 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.4 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.3 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.2 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-2.0.pre.1 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-0.22.pre.2 lib/praxis/bootloader_stages/warn_unloaded_files.rb
praxis-0.22.pre.1 lib/praxis/bootloader_stages/warn_unloaded_files.rb